Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Accelerator Wrapper Tech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
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
SoCLabs
Accelerator Wrapper Tech
Commits
196ecaaf
Commit
196ecaaf
authored
2 years ago
by
dam1n19
Browse files
Options
Downloads
Patches
Plain Diff
UPdate Stimgen script to create adp commands
parent
0c8cc332
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flow/stimgen.py
+34
-10
34 additions, 10 deletions
flow/stimgen.py
with
34 additions
and
10 deletions
flow/stimgen.py
+
34
−
10
View file @
196ecaaf
...
@@ -17,22 +17,20 @@ class TransactionType(Enum):
...
@@ -17,22 +17,20 @@ class TransactionType(Enum):
READ
=
1
READ
=
1
WRITE
=
2
WRITE
=
2
def
__str__
(
self
):
def
__str__
(
self
):
match
self
:
if
(
self
==
TransactionType
.
READ
):
case
TransactionType
.
READ
:
return
"
R
"
return
"
R
"
elif
(
self
==
TransactionType
.
WRITE
):
case
TransactionType
.
WRITE
:
return
"
W
"
return
"
W
"
class
TransactionSize
(
Enum
):
class
TransactionSize
(
Enum
):
"""
Enumerated Types for Transaction Types for ASCII Debug
"""
"""
Enumerated Types for Transaction Types for ASCII Debug
"""
WORD
=
1
WORD
=
1
HALFWORD
=
2
HALFWORD
=
2
def
__str__
(
self
):
def
__str__
(
self
):
match
self
:
if
(
self
==
TransactionSize
.
WORD
):
case
TransactionSize
.
WORD
:
return
"
word
"
return
"
word
"
elif
(
self
==
TransactionSize
.
HALFWORD
):
case
TransactionSize
.
HALFWORD
:
return
"
halfword
"
return
"
halfword
"
class
InputBlockStruct
:
class
InputBlockStruct
:
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -57,6 +55,28 @@ class WordStruct:
...
@@ -57,6 +55,28 @@ class WordStruct:
self
.
block_num
=
block_num
self
.
block_num
=
block_num
self
.
size
=
size
self
.
size
=
size
def
adp_output
(
out_file
,
word_list
):
"""
This function takes a list of 32 bit words and addresses and formats
the data into .cmd format for the ADP module
testbench
"""
data
=
[]
for
word
in
word_list
:
if
(
word
.
data
>
0
):
data
.
append
([
"
a
"
,
"
{0:#0{1}x}
"
.
format
(
word
.
addr
,
10
)])
data
.
append
([
str
(
word
.
trans
).
lower
(),
"
{0:#0{1}x}
"
.
format
(
word
.
data
,
10
)])
table_str
=
tabulate
.
tabulate
(
data
,
headers
=
col_names
,
tablefmt
=
"
plain
"
)
with
open
(
out_file
,
"
w
"
,
encoding
=
"
UTF8
"
,
newline
=
''
)
as
f
:
f
.
write
(
"
A
"
)
f
.
write
(
table_str
)
f
.
write
(
"
A
"
)
f
.
write
(
"
X
"
)
f
.
write
(
"
!
"
)
def
fri_output
(
out_file
,
word_list
):
def
fri_output
(
out_file
,
word_list
):
"""
"""
This function takes a list of 32 bit words and addresses and formats
This function takes a list of 32 bit words and addresses and formats
...
@@ -167,6 +187,10 @@ def stimulus_generation(stim_file, ref_file, input_start_address, input_size, ou
...
@@ -167,6 +187,10 @@ def stimulus_generation(stim_file, ref_file, input_start_address, input_size, ou
read_addr
+=
0x4
read_addr
+=
0x4
# Generate ADP Command File with Write Transactions
adp_file
=
os
.
environ
[
"
WRAP_ACC_DIR
"
]
+
"
/simulate/stimulus/
"
+
"
adp_hash_stim.cmd
"
adp_output
(
adp_file
,
output_word_list
)
# Generate FRI File with Write Transactions
# Generate FRI File with Write Transactions
fri_file
=
os
.
environ
[
"
WRAP_ACC_DIR
"
]
+
"
/simulate/stimulus/
"
+
"
ahb_input_hash_stim.fri
"
fri_file
=
os
.
environ
[
"
WRAP_ACC_DIR
"
]
+
"
/simulate/stimulus/
"
+
"
ahb_input_hash_stim.fri
"
fri_output
(
fri_file
,
output_word_list
)
fri_output
(
fri_file
,
output_word_list
)
...
...
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