-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprime_feed_tb.sv
73 lines (59 loc) · 1.19 KB
/
prime_feed_tb.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
67
68
69
70
71
72
`timescale 1ns / 1ps
module prime_feed_tb ();
localparam CLK = 4;
localparam HALF_CLK = CLK/2;
localparam WIDTH = 512;
reg aclk;
reg aresetn;
reg next;
reg pqrs_ready;
reg [WIDTH-1:0] p;
reg [WIDTH-1:0] q;
reg [WIDTH-1:0] r;
reg [WIDTH-1:0] s;
prime_feed
#(
.WIDTH(WIDTH)
)
prime_feed_dut
(
.aclk(aclk),
.aresetn(aresetn),
.next(next),
.pqrs_ready(pqrs_ready),
.p(p),
.q(q),
.r(r),
.s(s)
);
initial begin
aclk = 0;
forever begin
#(HALF_CLK) aclk = ~aclk;
end
end
initial begin
aresetn = 1'b0;
@(negedge aclk);
aresetn = 1'b1;
@(posedge aclk);
next = 1'b1;
@(posedge aclk);
next = 1'b0;
/*if (done) begin
next = 1'b1;
@(posedge aclk);
next = 1'b0;
end*/
end // initial
always @(posedge aclk) begin
if(!aresetn) begin
end else begin
if (pqrs_ready) begin
next = 1'b1;
@(posedge aclk);
next = 1'b0;
end
end
end
endmodule