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: hadd.v
// Verilog HDL for "LIB", "hadd" "_functional" module hadd (clock, A_in, B_in, carry, sum); // Default values for the timing parameters parameter delay_carry = 33, delay_sum = 37, t_hold = 1, t_setup = 31, t_sep = 11, warning_file = 2; // Declaration of data types input clock, A_in, B_in; output carry, sum; reg trig, carry, sum, data_A, data_B, extra_A, extra_B; // Multi-pulse indicators integer current_time, holdtime, sep_time, left_bound, right_bound, time_A, time_B; initial begin // Initialization trig = 0; left_bound = 0; {data_A, data_B} = 0; {carry, sum} = 0; #0 holdtime = (t_hold < 0) ? 0 : t_hold; end // initial always @(posedge A_in) begin // Store the time position of the data (center of the pulse) time_A = $time + 1; // Store the value of the data input data_A = A_in; // Display warning if more than 1 data pulse comes in 1 clock cycle if (extra_A == 'b1) $fdisplay(warning_file, "Extra pulse detected in module %m at input A at %0d ps.\n", time_A); extra_A = 1; // Set after 1 data pulse comes end // always always @(posedge B_in) begin // Store the time position of the data (center of the pulse) time_B = $time + 1; // Store the value of the data input data_B = B_in; // Display warning if more than 1 data pulse comes in 1 clock cycle if (extra_B == 'b1) $fdisplay(warning_file, "Extra pulse detected in module %m at input B at %0d ps.\n", time_B); extra_B = 1; // Set after 1 data pulse comes end // always always @(posedge clock) // Trigger after clock+holdtime trig <= #(holdtime-1) 1; always @(posedge trig) begin current_time = $time+1-(holdtime-1); // Present time of clock // Delay = 0.5 so that clock cycles do not overlap #0.5 trig = 0; // Generate output only if there are input pulses if ((data_A !== 'b0) | (data_B !== 'b0)) begin // Reset to receive data input in a new clock cycle extra_A = 0; extra_B = 0; // Determine the right boundary of the time range in which there is no timing violation right_bound = current_time - t_setup; casex ({(data_A !== 'b0), (data_B !== 'b0), ((time_A >= left_bound) & (time_A <= right_bound)), ((time_B >= left_bound) & (time_B <= right_bound))}) // Two data inputs and no timing violation 4'b1111: begin sep_time = time_A - time_B; sep_time = (sep_time < 0) ? -sep_time : sep_time; // Separation time violation? if (sep_time < t_sep) begin carry <= #(delay_carry - holdtime) 'bx; sum <= #(delay_sum - holdtime) 'bx; $fdisplay(warning_file, "Violation of separation time in module %m.\nInput A at %0d ps, input B at %0d ps.\n", time_A, time_B); end else carry <= #(delay_carry - holdtime) (data_A & data_B); // Reset to receive new data values in a new clock cycle {data_A, data_B} = 0; end // One data input and no timing violation 4'b101x: begin sum <= #(delay_sum - holdtime) data_A; data_A = 0; end // One data input and no timing violation 4'b01x1: begin sum <= #(delay_sum - holdtime) data_B; data_B = 0; end // Two data inputs and there is timing violation 4'b1100: begin carry <= #(delay_carry - holdtime) 'bx; sum <= #(delay_sum - holdtime) 'bx; // Issue a warning if ((time_A > right_bound) & (time_B > right_bound)) $fdisplay(warning_file, "Violation of hold/setup time in module %m. \nInput A at %0d ps, input B at %0d ps, clock at %0d ps.\n", time_A, time_B, current_time); else if (time_A > right_bound) begin $fdisplay(warning_file, "Violation of hold/setup time in module %m. \nInput A at %0d ps, clock at %0d ps.\n", time_A, current_time); data_B = 0; end else if (time_B > right_bound) begin $fdisplay(warning_file, "Violation of hold/setup time in module %m. \nInput B at %0d ps, clock at %0d ps.\n", time_B, current_time); data_A = 0; end // If a warning has been issued before else {data_A, data_B} = 0; end // One data input and there is timing violation 4'b100x: begin sum <= #(delay_sum - holdtime) 'bx; // Issue a warning if (time_A > right_bound) $fdisplay(warning_file, "Violation of hold/setup time in module %m. \nInput A at %0d ps, clock at %0d ps.\n", time_A, current_time); // If a warning has been issued before else data_A = 0; end // One data input and there is timing violation 4'b01x0: begin sum <= #(delay_sum - holdtime) 'bx; // Issue a warning if (time_B > right_bound) $fdisplay(warning_file, "Violation of hold/setup time in module %m. \nInput B at %0d ps, clock at %0d ps.\n", time_B, current_time); // If a warning has been issued before else data_B = 0; end // Two data inputs and there is timing violation 4'b1110: begin carry <= #(delay_carry - holdtime) 'bx; sum <= #(delay_sum - holdtime) 'bx; // Issue a warning if (time_A > right_bound) $fdisplay(warning_file, "Violation of hold/setup time in module %m. \nInput A at %0d ps, clock at %0d ps.\n", time_A, current_time); // If a warning has been issued before else data_A = 0; end // Two data inputs and there is timing violation 4'b1101: begin carry <= #(delay_carry - holdtime) 'bx; sum <= #(delay_sum - holdtime) 'bx; // Issue a warning if (time_B > right_bound) $fdisplay(warning_file, "Violation of hold/setup time in module %m. \nInput B at %0d ps, clock at %0d ps.\n", time_B, current_time); // If a warning has been issued before else data_B = 0; end endcase // Reset the outputs after 2ps carry <= #(delay_carry - holdtime + 2) 0; sum <= #(delay_sum - holdtime + 2) 0; end // if // Determine the left boundary of the time range in which there is no timing violation left_bound = current_time + t_hold; end // always endmodule
SIMPAN PERUBAHAN