1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-17 20:02:53 +08:00
oh/stdlib/testbench/dv_random.v
Andreas.Olofsson 19f278ddb3 Changing name dv to testbench
-Clarity...
2022-06-22 11:12:51 -04:00

56 lines
938 B
Verilog

module dv_ctrl(/*AUTOARG*/
// Outputs
nreset, clk, start,
// Inputs
stim_done, test_done
);
parameter N = 5000;
input nreset; // async active low reset
input clk; // main clock
input [15:0]
output [N-1:0] stim_done; //stimulus is done
input test_done; //test is done
//signal declarations
reg nreset = 1'b0;
reg clk = 1'b0;
reg start = 1'b0;
//init
initial
begin
#(CLK_PERIOD*10)
nreset = 'b1;
#(CLK_PERIOD*100)
start = 'b1;
end
//finish circuitry
always @*
if(stim_done & test_done)
begin
#(TIMEOUT) $finish;
end
//Clock generator
always
#(CLK_PHASE) clk = ~clk;
//Waveform dump
//Better solution?
`ifdef NOVCD
`else
initial
begin
$dumpfile("waveform.vcd");
$dumpvars(0, dv_top);
end
`endif
endmodule // dv_init