1
0
mirror of git://projects.qi-hardware.com/nn-usb-fpga.git synced 2025-01-10 00:30:14 +02:00
nn-usb-fpga/Examples/blink/logic/blink_TB.v
2010-05-12 10:06:23 -05:00

56 lines
1.0 KiB
Verilog

`timescale 1ns / 1ps
module blink_TB;
reg clk;
reg reset;
wire led;
blink uut ( .clk(clk), .reset(reset), .led(led));
parameter PERIOD = 20;
parameter real DUTY_CYCLE = 0.5;
parameter OFFSET = 0;
parameter TSET = 3;
parameter THLD = 3;
parameter NWS = 3;
event reset_trigger;
initial begin // Initialize Inputs
clk = 0; reset = 0;
end
initial begin // Process for clk
#OFFSET;
forever
begin
clk = 1'b0;
#(PERIOD-(PERIOD*DUTY_CYCLE)) clk = 1'b1;
#(PERIOD*DUTY_CYCLE);
end
end
initial begin // Reset the system, Start the image capture process
forever begin
@ (reset_trigger);
@ (negedge clk);
reset = 1;
@ (negedge clk);
reset = 0;
end
end
initial begin: TEST_CASE
$dumpfile("blink_TB.vcd");
$dumpvars(-1, uut);
#10 -> reset_trigger;
#((PERIOD*DUTY_CYCLE)*100) $finish;
end
endmodule