-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpattern_test.sv
More file actions
69 lines (60 loc) · 1.01 KB
/
Copy pathpattern_test.sv
File metadata and controls
69 lines (60 loc) · 1.01 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
`timescale 1ns / 1ps
module Pattern_TB();
parameter nx = 4;
parameter nh = 6;
parameter wordlen = 16;
reg clk;
reg TR, VL, SW;
reg [nx:0][wordlen-1:0] W1;
reg [nh:0][wordlen-1:0] W2;
wire [wordlen-1:0] lr;
wire [nx-1:0][wordlen-1:0] x;
wire [wordlen-1:0] y;
wire [wordlen-1:0] TRAIN, VALID, EPOCH;
Pattern #(.NX(nx), .NH(nh), .BITS(wordlen)) PB(
.clk(clk),
.TR(TR),
.VL(VL),
.SW(SW),
.W1(W1),
.W2(W2),
.lr(lr),
.x(x),
.y(y),
.TRAIN(TRAIN),
.VALID(VALID),
.EPOCH(EPOCH)
);
initial begin
$dumpfile("pattern.vcd");
$dumpvars(0, Pattern_TB);
clk <= 1'b0;
TR <= 1'b0;
VL <= 1'b0;
SW <= 1'b0;
end
always #10 clk <= ~ clk;
always begin
#10 TR <= 1'b1;
#20 TR <= 1'b0;
#40 TR <= 1'b1;
#20 TR <= 1'b0;
#40 TR <= 1'b1;
#20 TR <= 1'b0;
#40 TR <= 1'b1;
#20 TR <= 1'b0;
#60 VL <= 1'b1;
#20 VL <= 1'b0;
#60 VL <= 1'b1;
#20 VL <= 1'b0;
#60 VL <= 1'b1;
#20 VL <= 1'b0;
#40 VL <= 1'b1;
#20 VL <= 1'b0;
#40 TR <= 1'b1;
#20 TR <= 1'b0;
#20 VL <= 1'b1;
#20 VL <= 1'b0;
#30 $finish;
end
endmodule // Pattern_TB