-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest.v
57 lines (50 loc) · 1.33 KB
/
test.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
49
50
51
52
53
54
55
56
57
/* ------------------------------------------------ *
* Title : ENC Test *
* Project : Pmod ENC Decoder *
* ------------------------------------------------ *
* File : test.v *
* Author : Yigit Suoglu *
* Last Edit : 05/02/2021 *
* ------------------------------------------------ *
* Description : Test code for ENC *
* ------------------------------------------------ */
module testboard(
input clk,
input rst,
input A,
input B,
output A_o,
output B_o,
output dir0,
output dir1,
output [6:0] seg,
output [3:0] an);
wire clk_ENC;
reg [3:0] counter0, counter1;
assign {A_o,B_o} = {A,B};
always@(posedge dir1 or posedge rst)
begin
if(rst)
begin
counter1 <= 0;
end
else
begin
counter1 <= counter1 + 4'd1;
end
end
always@(posedge dir0 or posedge rst)
begin
if(rst)
begin
counter0 <= 0;
end
else
begin
counter0 <= counter0 + 4'd1;
end
end
cclk_div6 testClkGen(clk, rst, clk_ENC);
ssdController4 ssdCntr(clk, rst, 4'b1001, counter1, , , counter0, seg, an);
enc uut(clk_ENC, rst, A,B,dir0,dir1,1'd0,1'd0,,);
endmodule