-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsha3_test.sv
66 lines (58 loc) · 1.6 KB
/
sha3_test.sv
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
`default_nettype none
module test;
logic [4:0][4:0][63:0] st, out;
logic [4:0] round;
logic clk, rdy, out_rdy, rst_l;
initial begin
clk = 0;
forever #5 clk = ~clk;
end
//logic [4:0][63:0] out;
//keccak_f_simple kf(st, out);
keccak_f(clk, rdy, st, out_rdy, out);
//keccak_f_fsm(clk, rst_l, rdy, st, out_rdy, out);
integer i, j;
initial begin
$monitor($time,,"st[0]=%h, st[1]=%h, out[0]=%h, out[1][0]=%h, out[0][1]=%h, out_rdy=%b", st[0][0], st[1][0], out[0][0], out[1][0], out[0][1], out_rdy);
for (i = 0; i < 5; i=i+1) begin
for (j = 0; j < 5; j=j+1) begin
st[i][j] <= 0;
end
end
st[0][0] <= 'h0D09DE907CCC2F9F;
st[1][0] <= 'hEAC118977ECD876B;
st[2][0] <= 'hE95D2DFC1811B26C;
st[3][0] <= 'h109C1EACB65D7EF9;
st[4][0] <= 'h6;
st[1][3] <= 'h8000000000000000;
round <= 'd3;
rdy <= 1'b1;
@(posedge clk);
rdy <= 1'b0;
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
@(posedge clk);
$finish;
end
endmodule: test