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: wpulse.v
// // // This circuit generates WE pulses. For example, if you have a chip that // needs to access an asynchronous SRAM in a single cycle and you wanted // generate the WE pulse synchronous with your system clock. // // Every clk cycle, generate an active // low WE pulse. The delay from the clk rising edge to the falling edge of // we is based on abits setting, which affects delay taps, etc. Likewise, // bbits controls the following rising edge of we. The module contains // two flip flops that generate two opposite poraity toggling levels. // A delay chain is attached to each of these outputs. The abits and bbits // get the desired tap, and the final two delayed signals are XORed together // to get the final we. None of this is very tuned, you would look at your // cycle time and pick a delay chain that makes sense for that. But, this // shows the effect. // // The we pulse always occurs. You will probably want to combine this with // you write_enable signal. This sort of circuit is, of course, highly dependent // on post-layout timing, etc. but that's why its programable. You probably // want more taps, too.. // // module wpulse ( reset, clk, abits, bbits, we ); input clk; input reset; input [3:0] abits; // bits to select which delay tap to use for first edge input [3:0] bbits; // bits to select which delay tap to use for pulse width output we; reg p1, p2; wire adel1out; wire adel2out; wire adel3out; wire adel4out; wire bdel1out; wire bdel2out; wire bdel3out; wire bdel4out; wire adelout; wire bdelout; // 2 flip-flops that are opposite polarity. Each flop toggles // every cycles. // always @(posedge clk) p1 <= (reset) | (~reset & ~p1); // reset to 1 always @(posedge clk) p2 <= (~reset & ~p2); // reset to 0 // Delay chain off of the p1 flop. delay4 adel1 (.a(p1), .z(adel1out)); delay4 adel2 (.a(adel1out), .z(adel2out)); delay4 adel3 (.a(adel2out), .z(adel3out)); delay4 adel4 (.a(adel3out), .z(adel4out)); // Delay chain off of the p2 flop. delay4 bdel1 (.a(p2), .z(bdel1out)); delay4 bdel2 (.a(bdel1out), .z(bdel2out)); delay4 bdel3 (.a(bdel2out), .z(bdel3out)); delay4 bdel4 (.a(bdel3out), .z(bdel4out)); // Select the tap of the p1 and p2 delay chains we want based on abits assign adelout = abits[3] & adel1out | abits[2] & adel2out | abits[1] & adel3out | abits[0] & adel4out; assign bdelout = bbits[3] & bdel1out | bbits[2] & bdel2out | bbits[1] & bdel3out | bbits[0] & bdel4out; // Final we pulse is just the XOR of the two chains. assign we = adelout ^ bdelout; endmodule // This is our delay cell. Pick whatever cell makes sense from your library. module delay4 (a, z); input a; output z; reg z; always @(a) z = #4 a; endmodule // synopsys translate_off module testwpulse; reg clk; reg reset; reg [3:0] abits; // bits to select which delay tap to use for first edge reg [3:0] bbits; // bits to select which delay tap to use for pulse width wire we; wpulse wpulse_inst ( .reset (reset), .clk (clk), .abits (abits), .bbits (bbits), .we (we) ); initial begin abits = 4'b1000; // Shortest pulse, earliest in cycle. bbits = 4'b0100; #200; abits = 4'b0010; // Shortest pulse, latest in the cycle. bbits = 4'b0001; #200; abits = 4'b0100; // Shortest pulse, middle of the cycle. bbits = 4'b0010; #200; abits = 4'b1000; // Longest cycle bbits = 4'b0001; #200; abits = 4'b1000; // Early in cycle, but not quite the longest. bbits = 4'b0010; #200; $finish; end // Reset initial begin reset = 0; #5 reset = 1; #100 reset = 0; end // Generate the 50MHz clock initial begin clk = 0; forever begin #10 clk = 1; #10 clk = 0; end end `define WAVES `ifdef WAVES initial begin $dumpfile ("wpulse.vcd"); $dumpvars (0,testwpulse); end `endif endmodule // synopsys translate_on
SIMPAN PERUBAHAN