-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCoor_gen_tb.v
48 lines (40 loc) · 840 Bytes
/
Coor_gen_tb.v
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
module Coor_gen_tb;
reg clk, reset;
reg [3:0] dones;
wire [3:0] key;
wire latch;
wire [2:0] engine_addr;
wire [82:0] word;
assign key[3:0] = 4'b0000;
// define the clock
initial
begin
clk = 1'b0;
forever #100 clk = ~clk;
end
// define input sequence
initial
begin
#0 reset = 1'b1;
#150 reset = 1'b0; dones = 5'b1111;
@ (posedge clk);
@ (negedge clk) dones = 5'b1110;
@ (posedge clk);
@ (negedge clk) dones = 5'b1100;
@ (posedge clk);
@ (negedge clk) dones = 5'b0000;
@ (posedge clk); @ (posedge clk);
@ (negedge clk) dones = 5'b0010;
@ (posedge clk);
@ (negedge clk) dones = 5'b0000;
end
Coor_gen u1 (
.cclk( clk ),
.ckey( key ),
.creset( reset ),
.cdones( dones ),
.clatch_en( latch ),
.cengine_addr( engine_addr ),
.cword2engines( word ) // x,y in int and fractional integer. To engines.
);
endmodule