Skip to content

Commit 69800cf

Browse files
committed
checked-in release tb
1 parent 6fd2728 commit 69800cf

File tree

3 files changed

+123
-1
lines changed

3 files changed

+123
-1
lines changed

sim_models/tb/MIPI_TX_tb.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,4 @@ module MIPI_TX_tb;
151151
$dumpfile("waves.vcd");
152152
$dumpvars;
153153
end
154-
endmodule
154+
endmodule
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
module SOC_FPGA_INTF_IRQ_tb;
3+
reg IRQ_CLK;
4+
reg IRQ_RST_N;
5+
reg [3:0] IRQ_SRC;
6+
wire [3:0] IRQ_SET;
7+
8+
reg [3:0] irq_src;
9+
10+
SOC_FPGA_INTF_IRQ soc_fpga_intf_irq(
11+
.IRQ_SRC(IRQ_SRC),
12+
.IRQ_SET(IRQ_SET),
13+
.IRQ_CLK(IRQ_CLK),
14+
.IRQ_RST_N(IRQ_RST_N)
15+
);
16+
17+
initial begin
18+
//generating clock
19+
IRQ_CLK = 0;
20+
forever #5 IRQ_CLK = ~IRQ_CLK;
21+
end
22+
23+
initial begin
24+
IRQ_SRC = 0;
25+
IRQ_RST_N = 0;
26+
27+
repeat(2) @(posedge IRQ_CLK);
28+
IRQ_RST_N = 1;
29+
30+
for (int i=0; i<10; i++) begin
31+
IRQ_SRC = $random();
32+
@(posedge IRQ_CLK);
33+
end
34+
35+
$finish;
36+
37+
end
38+
39+
always @(posedge IRQ_CLK) irq_src <= IRQ_SRC;
40+
41+
initial begin
42+
forever begin
43+
if(IRQ_RST_N)
44+
if (IRQ_SET == irq_src)
45+
$info("True IRQ_SET");
46+
else $error("False IRQ_SET %0d , IRQ_SRC %0d ", IRQ_SET ,irq_src );
47+
@(posedge IRQ_CLK);
48+
end
49+
end
50+
51+
endmodule
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
`timescale 1ns/1ps
2+
3+
module SOC_FPGA_INTF_JTAG_tb;
4+
5+
// Inputs
6+
reg BOOT_JTAG_TCK;
7+
reg BOOT_JTAG_TDO;
8+
reg BOOT_JTAG_EN;
9+
10+
// Outputs
11+
wire BOOT_JTAG_TDI;
12+
wire BOOT_JTAG_TMS;
13+
wire BOOT_JTAG_TRSTN;
14+
15+
reg [3:0] tdo;
16+
17+
SOC_FPGA_INTF_JTAG dut (
18+
.BOOT_JTAG_TCK(BOOT_JTAG_TCK),
19+
.BOOT_JTAG_TDI(BOOT_JTAG_TDI),
20+
.BOOT_JTAG_TDO(BOOT_JTAG_TDO),
21+
.BOOT_JTAG_TMS(BOOT_JTAG_TMS),
22+
.BOOT_JTAG_TRSTN(BOOT_JTAG_TRSTN),
23+
.BOOT_JTAG_EN(BOOT_JTAG_EN)
24+
);
25+
26+
27+
initial begin
28+
BOOT_JTAG_TCK = 0;
29+
forever #5 BOOT_JTAG_TCK = ~BOOT_JTAG_TCK;
30+
end
31+
32+
33+
// Stimulus
34+
initial begin
35+
36+
BOOT_JTAG_TDO = 1'b0;
37+
BOOT_JTAG_EN = 1'b0;
38+
39+
#10;
40+
41+
for (int i=0; i<10; i++) begin
42+
BOOT_JTAG_TDO = ~BOOT_JTAG_TDO;
43+
@(posedge BOOT_JTAG_TCK);
44+
end
45+
46+
#10;
47+
48+
BOOT_JTAG_EN = 1'b1;
49+
50+
for (int i=0; i<10; i++) begin
51+
BOOT_JTAG_TDO = ~BOOT_JTAG_TDO;
52+
@(posedge BOOT_JTAG_TCK);
53+
end
54+
55+
#10;
56+
$finish;
57+
end
58+
59+
always @(posedge BOOT_JTAG_TCK) tdo <= BOOT_JTAG_TDO;
60+
61+
initial begin
62+
forever begin
63+
if(BOOT_JTAG_TRSTN && BOOT_JTAG_TMS)
64+
if (BOOT_JTAG_TDI == tdo)
65+
$info("True BOOT_JTAG_TDI");
66+
else $error("False BOOT_JTAG_TDI %0d , BOOT_JTAG_TDO %0d ", BOOT_JTAG_TDI ,tdo );
67+
@(posedge BOOT_JTAG_TCK);
68+
end
69+
end
70+
71+
endmodule

0 commit comments

Comments
 (0)