File: checker_tb.v

package info (click to toggle)
fpga-icestorm 0~20250207git7fbf8c0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,440 kB
  • sloc: python: 28,401; cpp: 4,970; sh: 2,594; ansic: 1,206; makefile: 697; xml: 16
file content (40 lines) | stat: -rw-r--r-- 652 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module testbench;
	reg clk;
	always #5 clk = (clk === 1'b0);

	wire ok;

	top uut (
		.clk(clk),
		.LED5(ok)
	);

	reg [4095:0] vcdfile;

	initial begin
		if ($value$plusargs("vcd=%s", vcdfile)) begin
			$dumpfile(vcdfile);
			$dumpvars(0, testbench);
		end
	end

	initial begin
		@(posedge ok);
		@(negedge ok);
		$display("ERROR: detected falling edge on OK pin!");
		$stop;
	end

	initial begin
		repeat (3000) @(posedge clk);

		if (!ok) begin
			$display("ERROR: OK pin not asserted after 3000 cycles!");
			$stop;
		end

		repeat (10000) @(posedge clk);
		$display("SUCCESS: OK pin still asserted after 10000 cycles.");
		$finish;
	end
endmodule