Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
NanoSoC Tech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SoCLabs
NanoSoC Tech
Commits
60f7dada
Commit
60f7dada
authored
2 years ago
by
Daniel Newbrook
Browse files
Options
Downloads
Patches
Plain Diff
Add recursiive read to flist tcl script
parent
786ca96d
No related branches found
No related tags found
1 merge request
!1
changed imem to rom to allow initial program loading, updated bootloader code...
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
fpga_imp/scripts/flist_to_tcl.py
+28
-7
28 additions, 7 deletions
fpga_imp/scripts/flist_to_tcl.py
with
28 additions
and
7 deletions
fpga_imp/scripts/flist_to_tcl.py
+
28
−
7
View file @
60f7dada
import
argparse
import
os
import
argparse
parser
=
argparse
.
ArgumentParser
(
description
=
"
Take flist file for verilog simulation and convert to tcl readable
"
,
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
)
parser
.
add_argument
(
"
-i
"
,
"
--input
"
,
help
=
"
input flist file
"
)
...
...
@@ -7,19 +7,40 @@ parser.add_argument("-o", "--output", help="output tcl file")
args
=
parser
.
parse_args
()
config
=
vars
(
args
)
if
not
os
.
path
.
exists
(
config
[
"
output
"
]):
outfile
=
open
(
config
[
"
output
"
],
"
a
"
)
for
line
in
open
(
config
[
"
input
"
]):
def
readFlist
(
fname
,
outfile
):
for
line
in
open
(
fname
):
li
=
line
.
strip
()
if
not
li
.
startswith
(
"
//
"
):
if
li
.
endswith
(
"
.v
"
):
if
li
.
startswith
(
"
-f
"
):
#Read file and run readFlist
li
=
li
.
replace
(
"
-f
"
,
""
)
tmp
=
li
.
split
(
'
/
'
)
tmp
[
0
]
=
tmp
[
0
].
replace
(
"
$
"
,
""
)
tmp
[
0
]
=
tmp
[
0
].
replace
(
'
(
'
,
''
)
tmp
[
0
]
=
tmp
[
0
].
replace
(
'
)
'
,
''
)
print
(
tmp
)
envPath
=
os
.
environ
.
get
(
tmp
[
0
])
print
(
envPath
)
tmp
.
pop
(
0
)
infile
=
envPath
for
dir
in
tmp
:
infile
+=
'
/
'
+
dir
print
(
infile
)
readFlist
(
infile
,
outfile
)
elif
li
.
endswith
(
"
.v
"
):
output
=
(
line
.
rstrip
()).
replace
(
"
$
"
,
"
read_verilog $env
"
)
outfile
.
write
(
output
+
'
\n
'
)
return
if
not
os
.
path
.
exists
(
config
[
"
output
"
]):
if
os
.
path
.
exists
(
config
[
"
input
"
]):
outfile
=
open
(
config
[
"
output
"
],
"
a
"
)
readFlist
(
config
[
"
input
"
],
outfile
)
outfile
.
close
()
else
:
print
(
"
ERROR: Input file does not exist
"
)
else
:
print
(
"
ERROR: Output file already exists
"
)
...
...
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