-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtb_trafficv2.v
More file actions
53 lines (46 loc) · 1.08 KB
/
Copy pathtb_trafficv2.v
File metadata and controls
53 lines (46 loc) · 1.08 KB
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
51
52
53
// tb_trafficv2_fixed.v
`timescale 1ns/1ps
module tb_trafficv2;
reg clk;
reg clear;
reg X;
reg B;
reg [4:0] hours;
reg [5:0] minutes;
reg [7:0] char;
wire [1:0] hwy, country;
wire is_true1;
wire is_true;
// Instantiate DUT
first DUT (
.hwy(hwy),
.country(country),
.X(X),
.B(B),
.clock(clk),
.clear(clear),
.hours(hours),
.minutes(minutes),
.char(char),
.is_true(is_true),
.is_true1(is_true1)
);
// clock
initial begin
clk = 0;
forever #5 clk = ~clk; // 10 ns period
end
initial begin
$display("Starting TB...");
$dumpfile("trafficv2.vcd");
$dumpvars(0, tb_trafficv2);
// initial stimulus
clear = 1; X = 0; B = 0; hours = 4; minutes = 59; char = 8'h00;
#12; clear = 0;
// test: day time and an 'A' char to trigger detector
#20; hours = 5; minutes = 0; char = 8'h41; // daytime begins
#200;
$display("Ending TB...");
$finish;
end
endmodule