Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SoCTools Flow
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
SoCTools Flow
Commits
71b65e95
Commit
71b65e95
authored
1 year ago
by
dam1n19
Browse files
Options
Downloads
Patches
Plain Diff
Added ability to pass defines to filelist compiler
parent
f9899e9b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/filelist_compile.py
+11
-3
11 additions, 3 deletions
bin/filelist_compile.py
with
11 additions
and
3 deletions
bin/filelist_compile.py
+
11
−
3
View file @
71b65e95
...
...
@@ -148,7 +148,14 @@ def incdir_compile(args, incdirs):
temp_str
+=
'"
[current_fileset]
'
return
temp_str
def
defines_compile
(
args
):
temp_str
=
""
if
len
(
args
.
defines
)
>
0
:
for
define
in
args
.
defines
:
temp_str
+=
"
set_property generic {
"
+
str
(
define
)
+
"
} [current_fileset]
\n
"
temp_str
+=
"
set_property verilog_define {
"
+
str
(
define
)
+
"
} [current_fileset]
\n
"
return
temp_str
def
filelist_compile
(
args
):
input_filelist
=
args
.
filelist
output_filelist
=
args
.
output
...
...
@@ -161,8 +168,8 @@ def filelist_compile(args):
filelist_str
=
filelist_header
if
(
args
.
tcl
==
False
)
else
filelist_header
.
replace
(
"
//
"
,
"
#
"
)
for
path
in
filelist
:
filelist_str
+=
path
if
args
.
tcl
==
True
:
filelist_str
+=
incdir
_compile
(
args
,
incdirs
)
filelist_str
+=
incdir_compile
(
args
,
incdirs
)
+
"
\n
"
filelist_str
+=
defines
_compile
(
args
)
# Write out output filelist
f_outlist
=
open
(
output_filelist
,
"
w
"
)
f_outlist
.
write
(
filelist_str
)
...
...
@@ -177,5 +184,6 @@ if __name__ == "__main__":
parser
.
add_argument
(
"
-t
"
,
"
--tcl
"
,
action
=
'
store_true
'
,
help
=
"
Generate a TCL Script
"
)
parser
.
add_argument
(
"
-a
"
,
"
--absolute
"
,
action
=
'
store_true
'
,
help
=
"
Substitute environment Variables with Absolute Path
"
)
parser
.
add_argument
(
"
-r
"
,
"
--rtldir
"
,
type
=
str
,
help
=
"
Directory where RTL Source will be copied to in TCL mode
"
)
parser
.
add_argument
(
'
-d
'
,
'
--defines
'
,
nargs
=
'
+
'
,
default
=
[])
args
=
parser
.
parse_args
()
filelist_compile
(
args
)
\ No newline at end of file
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