aboutsummaryrefslogtreecommitdiffstats
path: root/tests/sim/tb/tb_dlatch.v
blob: aea6cb0a3d5e6b98779355d1a13031bb23fe5556 (plain)
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
41
42
43
44
45
46
47
48
49
50
`timescale 1ns/1ns 
module tb_dlatch();
	reg clk = 0;
	reg en = 0;
	reg d = 0;
	wire q;

	dlatch uut(.d(d),.en(en),.q(q));

	always
		#(5) clk <= !clk;

	initial
	begin
		$dumpfile("tb_dlatch");
		$dumpvars(0,tb_dlatch);
		#10
		d = 1;
		#10
		d = 0;
		#10
		d = 1;
		#10
		d = 0;
		#10
		d = 1;
		#10
		d = 0;
		#10
		en = 1;
		#10
		d = 1;
		#10
		d = 0;
		#10
		d = 1;
		#10
		d = 0;
		#10
		d = 1;
		#10
		d = 0;
		#10
		d = 1;
		#10
		d = 0;
		#10
		$finish;
	end
endmodule