PATH: //opt/alt/python311/share/doc/alt-python311-pyparsing-doc/examples/verilog
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 Ctr3sr.v
↓
X
📄 INIT
↓
X
📄 RANDOM_GATE
↓
X
📄 RANDOM_INTERCONNECT
↓
X
📄 SEED
↓
X
📄 TestCtr3sr.v
↓
X
📄 addacc.v
↓
X
📄 addacc1_dro.v
↓
X
📄 addacc1_t1ff.v
↓
X
📄 addacc_conf.v
↓
X
📄 addacc_dro.v
↓
X
📄 addacc_t1ff.v
↓
X
📄 allParseOutput.zip
↓
X
📄 and.v
↓
X
📄 and_gate.v
↓
X
📄 conf.v
↓
X
📄 core_test.v
↓
X
📄 count2bit.v
↓
X
📄 count_all_prims_test.v
↓
X
📄 count_loads_test.v
↓
X
📄 dds.v
↓
X
📄 diff_udp.v
↓
X
📄 display_all_nets_test.v
↓
X
📄 div16.v
↓
X
📄 dro.v
↓
X
📄 dro1_cell.v
↓
X
📄 dro_cell.v
↓
X
📄 dump_and_fill_mem_test.v
↓
X
📄 exprinfo_test.v
↓
X
📄 fetch_values_test.v
↓
X
📄 ff.v
↓
X
📄 ff_test.v
↓
X
📄 fifo.v
↓
X
📄 find_driver.tcl.gz
↓
X
📄 framer.v
↓
X
📄 func_72bit_test.v
↓
X
📄 gen.v
↓
X
📄 gencrc.v
↓
X
📄 gzip.exe
↓
X
📄 hadd.v
↓
X
📁 hasCompilerDirectives/
X
📄 hello_test.v
↓
X
📄 in_port.v
↓
X
📄 inv.v
↓
X
📄 inv_cell.v
↓
X
📄 invoke_commands_test.v
↓
X
📄 invoke_options_test.v
↓
X
📄 jtl2.v
↓
X
📄 jutzi
↓
X
📄 list_cells_test.v
↓
X
📄 list_nets_test.v
↓
X
📄 list_parameters_test.v
↓
X
📄 list_path_delays_test.v
↓
X
📄 list_pathout_ports_test.v
↓
X
📄 list_prim_delays_test.v
↓
X
📄 load_in.v
↓
X
📄 load_out.v
↓
X
📄 mem_arb.v
↓
X
📄 mipd_delays_test.v
↓
X
📄 mult16.v
↓
X
📄 multi21_udp.v
↓
X
📄 my_monitor1_test.v
↓
X
📄 my_monitor2_test.v
↓
X
📄 my_monitor_test.v
↓
X
📄 my_strobe_test.v
↓
X
📄 myram64x16.v
↓
X
📄 nco.v
↓
X
📄 ndro.v
↓
X
📁 new/
X
📁 new2/
X
📁 new3/
X
📄 nodeinfo_test.v
↓
X
📄 onehot.v
↓
X
📄 or.v
↓
X
📄 out_port.v
↓
X
📁 parseOutput/
X
📄 pic.v
↓
X
📄 pipe1.v
↓
X
📄 pipe2.v
↓
X
📄 pl.v
↓
X
📄 pli_handbook_examples_pc.zip
↓
X
📄 port_info_test.v
↓
X
📄 pow_test.v
↓
X
📄 primitives.v
↓
X
📄 propagatep_test.v
↓
X
📄 psr1.v
↓
X
📄 psr1_conf.v
↓
X
📄 psr1_dro.v
↓
X
📄 psr1_split.v
↓
X
📄 psr2.v
↓
X
📄 psr2_and.v
↓
X
📄 psr2_split.v
↓
X
📄 read_4state_value_test.v
↓
X
📄 read_attribute_test.v
↓
X
📄 read_delays_test.v
↓
X
📄 read_stimulus_short_test.v
↓
X
📄 read_stimulus_test.v
↓
X
📄 read_strengthval_test.v
↓
X
📄 read_test_vector_test.v
↓
X
📄 read_timeval_test.v
↓
X
📄 read_vector_test.v
↓
X
📄 read_vecval_test.v
↓
X
📄 realpow_test.v
↓
X
📄 rf.v
↓
X
📄 sci_alu_comb_calltf_shell.v
↓
X
📄 sci_alu_comb_calltf_test.v
↓
X
📄 sci_alu_comb_misctf_shell.v
↓
X
📄 sci_alu_comb_misctf_test.v
↓
X
📄 sci_alu_combinational_shell.v
↓
X
📄 sci_alu_combinational_test.v
↓
X
📄 sci_alu_latched_shell.v
↓
X
📄 sci_alu_latched_test.v
↓
X
📄 sci_alu_sequential_shell.v
↓
X
📄 sci_alu_sequential_test.v
↓
X
📄 sci_alu_synchronized_shell.v
↓
X
📄 sci_alu_synchronized_test.v
↓
X
📄 sci_alu_with_delays_shell.v
↓
X
📄 sci_alu_with_delays_test.v
↓
X
📄 set_mipd_delays_test.v
↓
X
📄 show_all_nets_test.v
↓
X
📄 show_all_signals1_test.v
↓
X
📄 show_all_signals2_test.v
↓
X
📄 show_all_signals3_test.v
↓
X
📄 show_all_signals_1_test.v
↓
X
📄 show_all_signals_2_test.v
↓
X
📄 show_all_signals_3_test.v
↓
X
📄 show_value_test.v
↓
X
📄 sig_gen.v
↓
X
📄 simple_core.v
↓
X
📄 splitter.v
↓
X
📄 sqrt32.v
↓
X
📄 sqrt8m.v
↓
X
📄 sr_nv_ctf.v
↓
X
📄 srcnt.v
↓
X
📄 string.v
↓
X
📄 t1ff.v
↓
X
📄 testcase.v
↓
X
📄 testcase2.v
↓
X
📄 testcase3.v
↓
X
📄 testcase4.v
↓
X
📄 testcase5.v
↓
X
📄 tff.v
↓
X
📄 timescale_info_test.v
↓
X
📄 usb.v
↓
X
📄 use_workarea_test.v
↓
X
📄 utmi_if.v
↓
X
📄 vpi_utilities_test.v
↓
X
📄 wb.v
↓
X
📄 wpulse.v
↓
X
📄 xor.v
↓
X
📄 zzzexample.v
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: xor.v
// Verilog HDL for "gates.lib", "xor_gate" "_functional" // Module XOR gate module xor_gate (a, b, clk, out); input a, b, clk; output out; reg out; parameter t_hold=5, t_setup=10, delay=15, warning_file=3; // multichannel description of a warning file reg a_internal, b_internal, clk_internal, a_state, b_state, // internal state at inputs a and b a_violation, b_violation, // timing violation at inputs a and b a_set, b_set; // signals determining the moment when // the state of the a,b inputs changes to "1" integer data_delay, // delay between a (b) and a_internal (b_internal) clk_delay, // delay between clk and clk_internal out_delay, // delay between clk_internal and out out_value, // output value in a given clock cycle last_clk_time; // time when the last clock pulse appeared initial begin // define delays between inputs & outputs and the corresponding // internal auxiliary registers if(t_hold<0) begin data_delay = -t_hold; clk_delay = 0; out_delay = delay; end else begin data_delay = 0; clk_delay = t_hold; out_delay=delay-t_hold; end // clear internal registers and the output signal a_internal = 0; b_internal = 0; clk_internal = 0; last_clk_time = 0; a_state = 0; b_state = 0; a_violation = 0; b_violation = 0; a_set = 0; b_set = 0; out = 0; end always @(posedge a) // Execute at positive edge of a a_internal <= #(data_delay) a; always @(posedge b) // Execute at positive edge of b b_internal <= #(data_delay) b; always @(posedge clk) // Execute at positive edge of clk clk_internal <= #(clk_delay) clk; always @(posedge a_internal) begin // setting an internal state at the input a a_violation = 1; if (a_internal === 1) a_set <= #(t_hold+t_setup) 1; a_internal <= 0; end always @(posedge b_internal) begin // setting an internal state at the input a b_violation = 1; if (b_internal === 1) b_set <= #(t_hold+t_setup) 1; b_internal <= 0; end always @(posedge a_set) begin if ($stime - last_clk_time >= t_hold+t_setup) a_state = a_state^1; else begin a_state = 1'bx; // generating a warning $fwrite(warning_file, "Violation of hold/setup time in module %m.\n"); $fwrite(warning_file, "Input A pulse at %0d,", $stime-data_delay-t_hold-t_setup); $fwrite(warning_file, "\tClock pulse at %0d.\n", last_clk_time-clk_delay); end a_violation <= 0; a_set <= 0; end always @(posedge b_set) begin if ($stime - last_clk_time >= t_hold+t_setup) b_state = b_state^1; else begin b_state = 1'bx; // generating a warning $fwrite(warning_file, "Violation of hold/setup time in module %m.\n"); $fwrite(warning_file, "Input B pulse at %0d,", $stime-data_delay-t_hold-t_setup); $fwrite(warning_file, "\tClock pulse at %0d.\n", last_clk_time-clk_delay); end b_violation <= 0; b_set <= 0; end always @(posedge clk_internal) begin // computing the output if ((clk_internal === 1'bx) || (a_violation | b_violation)) out_value = 1'bx; else out_value = a_state ^ b_state; // transfering the result to the output out <= #(out_delay) out_value; out <= #(out_delay+2) 0; // clearing the internal state of A and B inputs a_state <= 0; b_state <= 0; clk_internal <= 0; last_clk_time = $stime; end endmodule
SIMPAN PERUBAHAN