Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
Gennum GN4124 core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Gennum GN4124 core
Commits
3159ffcd
Commit
3159ffcd
authored
Aug 08, 2019
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hdl] update and expand example testbench
parent
dcf190ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
main.sv
hdl/sim/example_tb/main.sv
+37
-3
run.do
hdl/sim/example_tb/run.do
+1
-1
No files found.
hdl/sim/example_tb/main.sv
View file @
3159ffcd
...
...
@@ -142,7 +142,7 @@ module main;
@
(
posedge
clk_125m
)
;
$
write
(
"Test 1/
3
: simple read/write accesses over Wishbone: "
)
;
$
write
(
"Test 1/
4
: simple read/write accesses over Wishbone: "
)
;
// Verify simple read/writes over wishbone
reg_check
(
'h0
,
'h0
)
;
...
...
@@ -161,7 +161,7 @@ module main;
$
write
(
"PASS
\n
"
)
;
$
write
(
"Test 2/
3
: 32 reads over DMA, abort after first read: "
)
;
$
write
(
"Test 2/
4
: 32 reads over DMA, abort after first read: "
)
;
// Perform 32 reads over DMA
reg_check
(
'h00
,
'h00000000
)
;
...
...
@@ -193,7 +193,7 @@ module main;
$
write
(
"PASS
\n
"
)
;
$
write
(
"Test 3/
3
: 32 reads over DMA: "
)
;
$
write
(
"Test 3/
4
: 32 reads over DMA: "
)
;
// Restart
acc
.
write
(
'h14
,
'h80
)
;
// count
...
...
@@ -227,6 +227,40 @@ module main;
$
write
(
"PASS
\n
"
)
;
$
write
(
"Test 4/4: 16 reads over DMA: "
)
;
// Restart
acc
.
write
(
'h14
,
'h40
)
;
// count
acc
.
write
(
'h00
,
'h01
)
;
// start
@
(
posedge
i_gn4124
.
l2p_valid
)
;
// skip header
@
(
posedge
i_gn4124
.
l2p_valid
)
;
for
(
addr
=
'h20
;
addr
>
'h10
;
addr
-=
1
)
begin
expected
=
64'h80000000
+
addr
-
1
;
val
=
i_gn4124
.
l2p_data
;
@
(
posedge
i_gn4124
.
l2p_clk_n
)
;
val
|=
i_gn4124
.
l2p_data
<<
16
;
val_check
(
"DMA read-back"
,
'h20
-
addr
,
val
,
expected
)
;
@
(
posedge
i_gn4124
.
l2p_clk_p
)
;
end
repeat
(
4
)
@
(
posedge
clk_125m
)
;
// Check irq status
reg_check
(
'h04
,
'h04
)
;
if
(
dma_irq
!=
1'b1
)
$
fatal
(
1
,
"dma irq should be 1"
)
;
// clear irq
acc
.
write
(
'h04
,
'h04
)
;
reg_check
(
'h04
,
'h00
)
;
if
(
dma_irq
!=
1'b0
)
$
fatal
(
1
,
"dma irq should be 0"
)
;
$
write
(
"PASS
\n
"
)
;
#
1u
s
;
$
display
()
;
...
...
hdl/sim/example_tb/run.do
View file @
3159ffcd
vsim -quiet -L unisim work.main
vsim -quiet -L unisim
-classdebug -voptargs=+acc
work.main
set StdArithNoWarnings 1
set NumericStdNoWarnings 1
...
...
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