Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
e587e420
Commit
e587e420
authored
9 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added support for testing MB_I and MB_II in parallel.
parent
23bae0be
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
boards/uniboard2/designs/unb2_test/tb/python/tc_unb2_test_ddr.py
+70
-56
70 additions, 56 deletions
...uniboard2/designs/unb2_test/tb/python/tc_unb2_test_ddr.py
with
70 additions
and
56 deletions
boards/uniboard2/designs/unb2_test/tb/python/tc_unb2_test_ddr.py
+
70
−
56
View file @
e587e420
...
@@ -27,13 +27,15 @@ Description:
...
@@ -27,13 +27,15 @@ Description:
Usage:
Usage:
1) Load and run tb_unb2_test_ddr simulation.
1) Load and run simulation of tb_unb2_test_ddr_MB_I, tb_unb2_test_ddr_MB_II or tb_unb2_test_ddr_MB_I_II
2) > python tc_unb2_test_ddr.py --sim --unb 0 --gn 3 -v 5
2) > python tc_unb2_test_ddr.py --sim --unb 0 --gn 3 -v 5 -s I --rep 1
3) After about 160 us cal_ok
"""
"""
###############################################################################
###############################################################################
# System imports
# System imports
import
sys
import
test_case
import
test_case
import
node_io
import
node_io
import
pi_diag_tx_seq
import
pi_diag_tx_seq
...
@@ -53,7 +55,7 @@ from pi_common import *
...
@@ -53,7 +55,7 @@ from pi_common import *
tc
=
test_case
.
Testcase
(
'
TB -
'
,
''
)
tc
=
test_case
.
Testcase
(
'
TB -
'
,
''
)
tc
.
set_result
(
'
PASSED
'
)
tc
.
set_result
(
'
PASSED
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
1
,
'
>>> Title : Test case for the unb
1
_ddr
3
design
on %s
'
%
tc
.
unb_nodes_string
())
tc
.
append_log
(
1
,
'
>>> Title : Test case for the unb
2_test
_ddr design
with MB = %s on %s
'
%
(
tc
.
gpString
,
tc
.
unb_nodes_string
())
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
3
,
'
>>>
'
)
tc
.
append_log
(
3
,
''
)
tc
.
append_log
(
3
,
''
)
...
@@ -61,14 +63,21 @@ tc.append_log(3, '')
...
@@ -61,14 +63,21 @@ tc.append_log(3, '')
io
=
node_io
.
NodeIO
(
tc
.
nodeImages
,
tc
.
base_ip
)
io
=
node_io
.
NodeIO
(
tc
.
nodeImages
,
tc
.
base_ip
)
# Create instances for the periperals
# Create instances for the periperals
c_nof_streams
=
1
mb_list
=
tc
.
gpString
.
split
(
'
,
'
);
io_ddr
=
dict
()
tx_seq_ddr
=
dict
()
rx_seq_ddr
=
dict
()
rx_db_ddr
=
dict
()
for
mb
in
mb_list
:
if
mb
==
'
I
'
or
mb
==
'
II
'
:
io_ddr
[
mb
]
=
pi_io_ddr
.
PiIoDdr
(
tc
,
io
,
inst_name
=
"
MB_
"
+
mb
,
nof_inst
=
1
)
tx_seq_ddr
[
mb
]
=
pi_diag_tx_seq
.
PiDiagTxSeq
(
tc
,
io
,
inst_name
=
"
DDR_MB_
"
+
mb
,
nof_inst
=
1
)
rx_seq_ddr
[
mb
]
=
pi_diag_rx_seq
.
PiDiagRxSeq
(
tc
,
io
,
inst_name
=
"
DDR_MB_
"
+
mb
,
nof_inst
=
1
)
rx_db_ddr
[
mb
]
=
pi_diag_data_buffer
.
PiDiagDataBuffer
(
tc
,
io
,
instanceName
=
"
DDR_MB_
"
+
mb
,
nofStreams
=
1
)
else
:
sys
.
exit
(
"
Wrong type of MB argument, must be -s I or -s II or -s I,II
"
)
tx_seq
=
pi_diag_tx_seq
.
PiDiagTxSeq
(
tc
,
io
,
inst_name
=
"
DDR
"
,
nof_inst
=
c_nof_streams
)
rx_seq
=
pi_diag_rx_seq
.
PiDiagRxSeq
(
tc
,
io
,
inst_name
=
"
DDR
"
,
nof_inst
=
c_nof_streams
)
rx_db
=
pi_diag_data_buffer
.
PiDiagDataBuffer
(
tc
,
io
,
instanceName
=
"
DDR
"
,
nofStreams
=
c_nof_streams
)
# Create object for DDR register map
ddr
=
pi_io_ddr
.
PiIoDdr
(
tc
,
io
,
nof_inst
=
1
)
##################################################################################################################
##################################################################################################################
# Test
# Test
...
@@ -77,58 +86,63 @@ ddr = pi_io_ddr.PiIoDdr(tc, io, nof_inst = 1)
...
@@ -77,58 +86,63 @@ ddr = pi_io_ddr.PiIoDdr(tc, io, nof_inst = 1)
io
.
wait_for_time
(
hw_time
=
0.01
,
sim_time
=
(
1
,
'
us
'
))
io
.
wait_for_time
(
hw_time
=
0.01
,
sim_time
=
(
1
,
'
us
'
))
# Control defaults
# Control defaults
nof_mon
=
2
nof_mon
=
5
start_address
=
0
start_address
=
7
nof_words
=
100
nof_words
=
100
for
rep
in
range
(
tc
.
repeat
):
for
rep
in
range
(
tc
.
repeat
):
tc
.
append_log
(
5
,
''
)
tc
.
append_log
(
5
,
''
)
tc
.
append_log
(
3
,
'
>>> Rep-%d
'
%
rep
)
tc
.
append_log
(
3
,
'
>>> Rep-%d
'
%
rep
)
# Use separate for-loop sections to access the MB I and MB II more simultaneously instead of sequentially
for
mb
in
mb_list
:
# Initialization
# Initialization
tx_seq
.
write_disable
(
vLevel
=
5
)
tx_seq
_ddr
[
mb
]
.
write_disable
(
vLevel
=
5
)
rx_seq
.
write_disable
(
vLevel
=
5
)
rx_seq
_ddr
[
mb
]
.
write_disable
(
vLevel
=
5
)
# Wait for the DDR memory to become available
# Wait for the DDR memory to become available
do_until_eq
(
ddr
.
read_init_done
,
ms_retry
=
3000
,
val
=
1
,
s_timeout
=
3600
)
do_until_eq
(
io_ddr
[
mb
]
.
read_init_done
,
ms_retry
=
3000
,
val
=
1
,
s_timeout
=
3600
)
for
mb
in
mb_list
:
# Flush Tx FIFO
# Flush Tx FIFO
ddr
.
write_flush_pulse
(
vLevel
=
5
)
io_ddr
[
mb
]
.
write_flush_pulse
(
vLevel
=
5
)
io
.
wait_for_time
(
hw_time
=
0.01
,
sim_time
=
(
1
,
'
us
'
))
io
.
wait_for_time
(
hw_time
=
0.01
,
sim_time
=
(
1
,
'
us
'
))
# Set DDR controller in write mode and start writing
# Set DDR controller in write mode and start writing
ddr
.
write_set_address
(
data
=
start_address
,
vLevel
=
5
)
io_ddr
[
mb
]
.
write_set_address
(
data
=
start_address
,
vLevel
=
5
)
ddr
.
write_access_size
(
data
=
nof_words
,
vLevel
=
5
)
io_ddr
[
mb
]
.
write_access_size
(
data
=
nof_words
,
vLevel
=
5
)
ddr
.
write_mode_write
(
vLevel
=
5
)
io_ddr
[
mb
]
.
write_mode_write
(
vLevel
=
5
)
ddr
.
write_begin_access
(
vLevel
=
5
)
io_ddr
[
mb
]
.
write_begin_access
(
vLevel
=
5
)
# Tx sequence start
# Tx sequence start
tx_seq
.
write_enable_cntr
(
vLevel
=
5
)
tx_seq
_ddr
[
mb
]
.
write_enable_cntr
(
vLevel
=
5
)
# Tx sequence monitor
# Tx sequence monitor
for
mon
in
range
(
nof_mon
):
for
mon
in
range
(
nof_mon
):
io
.
wait_for_time
(
hw_time
=
0.01
,
sim_time
=
(
1
,
'
us
'
))
io
.
wait_for_time
(
hw_time
=
0.01
,
sim_time
=
(
1
,
'
us
'
))
tx_seq
.
read_cnt
(
vLevel
=
5
)
tx_seq
_ddr
[
mb
]
.
read_cnt
(
vLevel
=
5
)
for
mb
in
mb_list
:
# Wait until controller write access is done
# Wait until controller write access is done
do_until_eq
(
ddr
.
read_done
,
ms_retry
=
3000
,
val
=
1
,
s_timeout
=
3600
)
do_until_eq
(
io_ddr
[
mb
]
.
read_done
,
ms_retry
=
3000
,
val
=
1
,
s_timeout
=
3600
)
# Rx sequence start
# Rx sequence start
rx_seq
.
write_enable_cntr
(
vLevel
=
5
)
rx_seq
_ddr
[
mb
]
.
write_enable_cntr
(
vLevel
=
5
)
# Set DDR3 controller in read mode and start reading
# Set DDR3 controller in read mode and start reading
ddr
.
write_mode_read
(
vLevel
=
5
)
io_ddr
[
mb
]
.
write_mode_read
(
vLevel
=
5
)
ddr
.
write_begin_access
(
vLevel
=
5
)
io_ddr
[
mb
]
.
write_begin_access
(
vLevel
=
5
)
# Rx sequence monitor
# Rx sequence monitor
for
mon
in
range
(
nof_mon
):
for
mon
in
range
(
nof_mon
):
io
.
wait_for_time
(
hw_time
=
0.01
,
sim_time
=
(
1
,
'
us
'
))
io
.
wait_for_time
(
hw_time
=
0.01
,
sim_time
=
(
1
,
'
us
'
))
rx_seq
.
read_cnt
(
vLevel
=
5
)
rx_seq
_ddr
[
mb
]
.
read_cnt
(
vLevel
=
5
)
for
mb
in
mb_list
:
# Wait until controller read access is done
# Wait until controller read access is done
do_until_eq
(
ddr
.
read_done
,
ms_retry
=
3000
,
val
=
1
,
s_timeout
=
3600
)
do_until_eq
(
io_ddr
[
mb
]
.
read_done
,
ms_retry
=
3000
,
val
=
1
,
s_timeout
=
3600
)
rx_seq
.
read_result
(
vLevel
=
5
)
rx_seq
_ddr
[
mb
]
.
read_result
(
vLevel
=
5
)
# End
# End
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment