Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393_sata
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393_sata
Commits
4b361952
Commit
4b361952
authored
Jul 14, 2015
by
Alexey Grebenkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simple tests for a new testbench
parent
992333fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
36 deletions
+50
-36
axi_regs.v
axi_regs.v
+8
-5
tb_top.v
tb/tb_top.v
+30
-30
test_top.v
tb/test_top.v
+12
-1
No files found.
axi_regs.v
View file @
4b361952
...
@@ -126,13 +126,16 @@ endgenerate
...
@@ -126,13 +126,16 @@ endgenerate
// read from memory. Interface's protocol assumes returning data to delay
// read from memory. Interface's protocol assumes returning data to delay
reg
[
3
:
0
]
bram_raddr_r
;
reg
[
3
:
0
]
bram_raddr_r
;
always
@
(
posedge
ACLK
)
reg
[
31
:
0
]
bram_rdata_r
;
bram_raddr_r
<=
bram_regen
?
bram_raddr
[
3
:
0
]
:
bram_raddr_r
;
always
@
(
posedge
ACLK
)
begin
assign
bram_rdata
=
mem
[
32
*
bram_raddr_r
+
31
-:
32
]
;
bram_raddr_r
<=
bram_ren
?
bram_raddr
[
3
:
0
]
:
bram_raddr_r
;
bram_rdata_r
<=
bram_regen
?
mem
[
32
*
bram_raddr_r
+
31
-:
32
]
:
bram_rdata_r
;
end
assign
bram_rdata
=
bram_rdata_r
;
// Interface's instantiation
// Interface's instantiation
axibram_write
#(
axibram_write
#(
.
ADDRESS_BITS
(
32
)
.
ADDRESS_BITS
(
16
)
)
)
axibram_write
(
axibram_write
(
.
aclk
(
ACLK
)
,
.
aclk
(
ACLK
)
,
...
@@ -164,7 +167,7 @@ axibram_write(
...
@@ -164,7 +167,7 @@ axibram_write(
.
bram_wdata
(
bram_wdata
)
.
bram_wdata
(
bram_wdata
)
)
;
)
;
axibram_read
#(
axibram_read
#(
.
ADDRESS_BITS
(
32
)
.
ADDRESS_BITS
(
16
)
)
)
axibram_read
(
axibram_read
(
.
aclk
(
ACLK
)
,
.
aclk
(
ACLK
)
,
...
...
tb/tb_top.v
View file @
4b361952
...
@@ -163,28 +163,28 @@ always #(CLKIN_PERIOD/2) CLK = ~CLK;
...
@@ -163,28 +163,28 @@ always #(CLKIN_PERIOD/2) CLK = ~CLK;
assign
dut
.
ps7_i
.
FCLKCLK
=
{
4
{
CLK
}};
assign
dut
.
ps7_i
.
FCLKCLK
=
{
4
{
CLK
}};
assign
dut
.
ps7_i
.
FCLKRESETN
=
{
RST
,~
RST
,
RST
,~
RST
};
assign
dut
.
ps7_i
.
FCLKRESETN
=
{
RST
,~
RST
,
RST
,~
RST
};
// Read address
// Read address
assign
dut
.
ps7_i
.
MAXIGP
0
ARADDR
=
araddr
;
assign
dut
.
ps7_i
.
MAXIGP
1
ARADDR
=
araddr
;
assign
dut
.
ps7_i
.
MAXIGP
0
ARVALID
=
arvalid
;
assign
dut
.
ps7_i
.
MAXIGP
1
ARVALID
=
arvalid
;
assign
arready
=
dut
.
ps7_i
.
MAXIGP
0
ARREADY
;
assign
arready
=
dut
.
ps7_i
.
MAXIGP
1
ARREADY
;
assign
dut
.
ps7_i
.
MAXIGP
0
ARID
=
arid
;
assign
dut
.
ps7_i
.
MAXIGP
1
ARID
=
arid
;
assign
dut
.
ps7_i
.
MAXIGP
0
ARLEN
=
arlen
;
assign
dut
.
ps7_i
.
MAXIGP
1
ARLEN
=
arlen
;
assign
dut
.
ps7_i
.
MAXIGP
0
ARSIZE
=
arsize
[
1
:
0
]
;
// arsize[2] is not used
assign
dut
.
ps7_i
.
MAXIGP
1
ARSIZE
=
arsize
[
1
:
0
]
;
// arsize[2] is not used
assign
dut
.
ps7_i
.
MAXIGP
0
ARBURST
=
arburst
;
assign
dut
.
ps7_i
.
MAXIGP
1
ARBURST
=
arburst
;
// Read data
// Read data
assign
rdata
=
dut
.
ps7_i
.
MAXIGP
0
RDATA
;
assign
rdata
=
dut
.
ps7_i
.
MAXIGP
1
RDATA
;
assign
rvalid
=
dut
.
ps7_i
.
MAXIGP
0
RVALID
;
assign
rvalid
=
dut
.
ps7_i
.
MAXIGP
1
RVALID
;
assign
dut
.
ps7_i
.
MAXIGP
0
RREADY
=
rready
;
assign
dut
.
ps7_i
.
MAXIGP
1
RREADY
=
rready
;
assign
rid
=
dut
.
ps7_i
.
MAXIGP
0
RID
;
assign
rid
=
dut
.
ps7_i
.
MAXIGP
1
RID
;
assign
rlast
=
dut
.
ps7_i
.
MAXIGP
0
RLAST
;
assign
rlast
=
dut
.
ps7_i
.
MAXIGP
1
RLAST
;
assign
rresp
=
dut
.
ps7_i
.
MAXIGP
0
RRESP
;
assign
rresp
=
dut
.
ps7_i
.
MAXIGP
1
RRESP
;
// Write address
// Write address
assign
dut
.
ps7_i
.
MAXIGP
0
AWADDR
=
awaddr
;
assign
dut
.
ps7_i
.
MAXIGP
1
AWADDR
=
awaddr
;
assign
dut
.
ps7_i
.
MAXIGP
0
AWVALID
=
awvalid
;
assign
dut
.
ps7_i
.
MAXIGP
1
AWVALID
=
awvalid
;
assign
awready
=
dut
.
ps7_i
.
MAXIGP
0
AWREADY
;
assign
awready
=
dut
.
ps7_i
.
MAXIGP
1
AWREADY
;
//assign awready= AWREADY_AAAA;
//assign awready= AWREADY_AAAA;
assign
dut
.
ps7_i
.
MAXIGP
0
AWID
=
awid
;
assign
dut
.
ps7_i
.
MAXIGP
1
AWID
=
awid
;
// SuppressWarnings VEditor all
// SuppressWarnings VEditor all
// wire [ 1:0] AWLOCK;
// wire [ 1:0] AWLOCK;
...
@@ -192,23 +192,23 @@ assign dut.ps7_i.MAXIGP0AWID=awid;
...
@@ -192,23 +192,23 @@ assign dut.ps7_i.MAXIGP0AWID=awid;
// wire [ 3:0] AWCACHE;
// wire [ 3:0] AWCACHE;
// SuppressWarnings VEditor all
// SuppressWarnings VEditor all
// wire [ 2:0] AWPROT;
// wire [ 2:0] AWPROT;
assign
dut
.
ps7_i
.
MAXIGP
0
AWLEN
=
awlen
;
assign
dut
.
ps7_i
.
MAXIGP
1
AWLEN
=
awlen
;
assign
dut
.
ps7_i
.
MAXIGP
0
AWSIZE
=
awsize
[
1
:
0
]
;
// awsize[2] is not used
assign
dut
.
ps7_i
.
MAXIGP
1
AWSIZE
=
awsize
[
1
:
0
]
;
// awsize[2] is not used
assign
dut
.
ps7_i
.
MAXIGP
0
AWBURST
=
awburst
;
assign
dut
.
ps7_i
.
MAXIGP
1
AWBURST
=
awburst
;
// SuppressWarnings VEditor all
// SuppressWarnings VEditor all
// wire [ 3:0] AWQOS;
// wire [ 3:0] AWQOS;
// Write data
// Write data
assign
dut
.
ps7_i
.
MAXIGP
0
WDATA
=
wdata
;
assign
dut
.
ps7_i
.
MAXIGP
1
WDATA
=
wdata
;
assign
dut
.
ps7_i
.
MAXIGP
0
WVALID
=
wvalid
;
assign
dut
.
ps7_i
.
MAXIGP
1
WVALID
=
wvalid
;
assign
wready
=
dut
.
ps7_i
.
MAXIGP
0
WREADY
;
assign
wready
=
dut
.
ps7_i
.
MAXIGP
1
WREADY
;
assign
dut
.
ps7_i
.
MAXIGP
0
WID
=
wid
;
assign
dut
.
ps7_i
.
MAXIGP
1
WID
=
wid
;
assign
dut
.
ps7_i
.
MAXIGP
0
WLAST
=
wlast
;
assign
dut
.
ps7_i
.
MAXIGP
1
WLAST
=
wlast
;
assign
dut
.
ps7_i
.
MAXIGP
0
WSTRB
=
wstrb
;
assign
dut
.
ps7_i
.
MAXIGP
1
WSTRB
=
wstrb
;
// Write response
// Write response
assign
bvalid
=
dut
.
ps7_i
.
MAXIGP
0
BVALID
;
assign
bvalid
=
dut
.
ps7_i
.
MAXIGP
1
BVALID
;
assign
dut
.
ps7_i
.
MAXIGP
0
BREADY
=
bready
;
assign
dut
.
ps7_i
.
MAXIGP
1
BREADY
=
bready
;
assign
bid
=
dut
.
ps7_i
.
MAXIGP
0
BID
;
assign
bid
=
dut
.
ps7_i
.
MAXIGP
1
BID
;
assign
bresp
=
dut
.
ps7_i
.
MAXIGP
0
BRESP
;
assign
bresp
=
dut
.
ps7_i
.
MAXIGP
1
BRESP
;
// Simulation modules
// Simulation modules
...
...
tb/test_top.v
View file @
4b361952
...
@@ -35,9 +35,20 @@ begin
...
@@ -35,9 +35,20 @@ begin
RST
=
1'b1
;
RST
=
1'b1
;
NUM_WORDS_EXPECTED
=
0
;
NUM_WORDS_EXPECTED
=
0
;
// #99000; // same as glbl
// #99000; // same as glbl
#
900
0
;
// same as glbl
#
900
;
// same as glbl
repeat
(
20
)
@
(
posedge
CLK
)
;
repeat
(
20
)
@
(
posedge
CLK
)
;
RST
=
1'b0
;
RST
=
1'b0
;
repeat
(
20
)
@
(
posedge
CLK
)
;
axi_set_rd_lag
(
0
)
;
axi_write_single
(
32'h4
,
32'hdeadbeef
)
;
axi_read_addr
(
12'h777
,
32'h4
,
4'h3
,
2'b01
)
;
repeat
(
7
)
@
(
posedge
CLK
)
;
axi_write_single
(
32'h8
,
32'hd34db33f
)
;
axi_read_addr
(
12'h555
,
32'h0
,
4'h3
,
2'b01
)
;
end
end
initial
initial
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment