// A stimulus file provides inputs signals to the design under test (DUT). // This stimulus module is designed to be compatible with verilog simulators, // emulators, and FPGA prototyping. This is akin to a simple test vector generator // No looping supported! // // Memory format: // b0 = valid, // b1-15 = wait time // b16-bxxx = packet // // Test Process: // 1. Zero out memory (or write program) // 2. Set go signal // module stimulus #( parameter PW = 32, // Memory width=PW+ parameter MAW = 15, // Memory address width parameter INIT = 1, // 1=init from memh file parameter FILENAME = "NONAME" // Name of memh file ) ( //Inputs input nreset, // Async negative edge reset input ext_clk,// External clock for write path input ext_access, // Valid packet for memory input [PW-1:0] ext_packet, // Packet for memory input ext_start, // Start driving stimulus //DUT Drive port input dut_clk, // DUT side clock input dut_wait, // DUT stall signal output stim_access, // Access signal output [PW-1:0] stim_packet, // Packet output stim_done // Stimulus program done ); localparam MD = 1<0) begin mem_access <= 1'b0; wait_counter[15:0] <= wait_counter[15:0] - 1'b1; end //Use to finish simulation assign stim_done = ~dut_wait & (state[1:0]==`DONE); //Removing delay value always @ (posedge clk or negedge nreset) if(~nreset) begin mem_access_reg <= 'b0; mem_packet_reg <= 'b0; stim_packet <= 'b0; stim_access <= 'b0; end else if(~dut_wait) begin mem_access_reg <= mem_access; mem_packet_reg <= mem_data[PW+16-1:16]; stim_packet <= mem_packet_reg; stim_access <= mem_access_reg; end endmodule // stimulus