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
Compare revisions
7e49a11b40b02c7879275a95c0b174cffa5f413d to a3302e548fff525c88fad50b3c10f335391db100
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
soclabs/soctools_flow
Select target project
No results found
a3302e548fff525c88fad50b3c10f335391db100
Select Git revision
Branches
at-adipisci-ducimus-qui-nihil
atque-corrupti-laboriosam-nobis-explicabo
aut-deleniti-est-voluptatum-repellat
autem-at-dolore-molestiae-et
autem-vitae-sequi-commodi-velit
cumque-occaecati-veniam-qui-sit
dolorem-ratione-sed-illum-minima
dolores-sit-quos-explicabo-ut
doloribus-dolorem-quos-adipisci-et
ea-dolor-quia-et-sint
et-laudantium-voluptas-quos-pariatur
et-non-impedit-praesentium-ex
et-recusandae-deleniti-voluptas-consectetur
fugiat-libero-sit-magnam-ad
inventore-temporibus-ipsum-neque-rerum
ipsum-consequatur-et-in-et
iste-consequatur-dolor-odio-dolorum
laudantium-unde-et-iste-et
main
modi-et-quam-sunt-consequatur
natus-autem-dolores-incidunt-nostrum
nostrum-ut-vel-voluptates-et
possimus-pariatur-autem-magni-animi
qui-in-quod-nam-voluptatem
qui-quidem-animi-inventore-in
quisquam-dolorum-minus-non-ipsam
recusandae-ex-ipsam-libero-fugit
sapiente-et-possimus-neque-est
sed-sit-tempore-expedita-possimus
voluptatem-quas-error-et-molestiae
voluptatem-quia-fugit-ut-perferendis
31 results
Swap
Target
soclabs/soctools_flow
Select target project
soclabs/soctools_flow
1 result
7e49a11b40b02c7879275a95c0b174cffa5f413d
Select Git revision
Branches
at-adipisci-ducimus-qui-nihil
atque-corrupti-laboriosam-nobis-explicabo
aut-deleniti-est-voluptatum-repellat
autem-at-dolore-molestiae-et
autem-vitae-sequi-commodi-velit
cumque-occaecati-veniam-qui-sit
dolorem-ratione-sed-illum-minima
dolores-sit-quos-explicabo-ut
doloribus-dolorem-quos-adipisci-et
ea-dolor-quia-et-sint
et-laudantium-voluptas-quos-pariatur
et-non-impedit-praesentium-ex
et-recusandae-deleniti-voluptas-consectetur
fugiat-libero-sit-magnam-ad
inventore-temporibus-ipsum-neque-rerum
ipsum-consequatur-et-in-et
iste-consequatur-dolor-odio-dolorum
laudantium-unde-et-iste-et
main
modi-et-quam-sunt-consequatur
natus-autem-dolores-incidunt-nostrum
nostrum-ut-vel-voluptates-et
possimus-pariatur-autem-magni-animi
qui-in-quod-nam-voluptatem
qui-quidem-animi-inventore-in
quisquam-dolorum-minus-non-ipsam
recusandae-ex-ipsam-libero-fugit
sapiente-et-possimus-neque-est
sed-sit-tempore-expedita-possimus
voluptatem-quas-error-et-molestiae
voluptatem-quia-fugit-ut-perferendis
31 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
add -v argument support for verilog .vc file lists
· a3302e54
dwf1m12
authored
1 year ago
a3302e54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/filelist_compile.py
+24
-7
24 additions, 7 deletions
bin/filelist_compile.py
with
24 additions
and
7 deletions
bin/filelist_compile.py
View file @
a3302e54
...
...
@@ -34,6 +34,13 @@ filelist_header = """//---------------------------------------------------------
"""
def
file_contains_module
(
f
):
if
'
module
'
in
open
(
f
).
read
():
return
True
else
:
print
(
'
### -y strip: no module in
'
+
f
)
return
False
def
env_var_substitute
(
path
,
tcl
=
False
,
synthesis
=
False
):
# Interpret the path and remove brackets from path
if
tcl
==
False
:
...
...
@@ -77,7 +84,7 @@ def read_list(filelist, first, incdirs, args):
elif
line_list
[
0
]
==
"
-y
"
:
# Append to filelist
for
file
in
os
.
listdir
(
env_var_substitute
(
line_list
[
1
])):
if
file
.
endswith
(
verilog_extensions
):
if
(
file
.
endswith
(
verilog_extensions
)
and
file_contains_module
(
str
(
env_var_substitute
(
line_list
[
1
],
tcl
=
False
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
)))
:
# Append to filelist
if
args
.
absolute
==
True
:
if
args
.
tcl
==
True
:
...
...
@@ -87,7 +94,9 @@ def read_list(filelist, first, incdirs, args):
else
:
compiled_filelist
.
append
(
"
read_hdl
"
+
str
(
env_var_substitute
(
line_list
[
1
],
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
))
elif
args
.
synthesis
==
True
:
compiled_filelist
.
append
(
"
cp
"
+
str
(
env_var_substitute
((
line_list
[
1
])
+
"
/
"
+
str
(
file
),
tcl
=
True
,
synthesis
=
True
)))
compiled_filelist
.
append
(
"
cp -p
"
+
str
(
env_var_substitute
((
line_list
[
1
])
+
"
/
"
+
str
(
file
),
tcl
=
True
,
synthesis
=
True
)))
elif
args
.
makefile
==
True
:
compiled_filelist
.
append
(
"
VERILOG_SOURCES +=
"
+
str
(
env_var_substitute
((
line_list
[
1
])
+
"
/
"
+
str
(
file
),
synthesis
=
True
)))
else
:
compiled_filelist
.
append
(
"
read_verilog
"
+
str
(
env_var_substitute
(
line_list
[
1
],
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
))
else
:
...
...
@@ -98,9 +107,11 @@ def read_list(filelist, first, incdirs, args):
if
file
.
endswith
(
"
.sv
"
):
compiled_filelist
.
append
(
"
read_hdl -language sv
"
+
str
(
env_var_substitute
(
line_list
[
1
],
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
))
else
:
compiled_filelist
.
append
(
"
read_hdl
"
+
str
(
env_var_substitute
(
line_list
[
1
],
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
))
compiled_filelist
.
append
(
"
read_hdl
"
+
str
(
env_var_substitute
(
line_list
[
1
],
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
))
elif
args
.
synthesis
==
True
:
compiled_filelist
.
append
(
"
cp
"
+
str
(
line_list
[
1
])
+
"
/
"
+
str
(
file
))
compiled_filelist
.
append
(
"
cp -p
"
+
str
(
env_var_substitute
(
line_list
[
1
],
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
))
elif
args
.
makefile
==
True
:
compiled_filelist
.
append
(
"
VERILOG_SOURCES +=
"
+
str
(
line_list
[
1
]).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
))
else
:
compiled_filelist
.
append
(
"
read_verilog
"
+
str
(
line_list
[
1
])
+
"
/
"
+
str
(
file
))
else
:
...
...
@@ -158,7 +169,8 @@ def read_list(filelist, first, incdirs, args):
# first = False
# else:
# compiled_filelist.append("set search_path [ concat $search_path " + str(line_list[0].lstrip("+incdir+")).replace("$","$env") + " ]")
elif
args
.
makefile
==
False
:
##elif args.makefile == False:
elif
((
args
.
makefile
==
False
)
and
(
args
.
vfiles
==
False
)):
for
file
in
os
.
listdir
(
env_var_substitute
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
))):
if
file
.
endswith
(
verilog_extensions
):
# Append to filelist
...
...
@@ -204,7 +216,7 @@ def read_list(filelist, first, incdirs, args):
elif
args
.
synthesis
==
True
:
temp_str
=
""
for
file
in
hdl_files
:
temp_str
+=
f
'
cp
{
file
}
{
args
.
rtldir
}
/
\n
'
temp_str
+=
f
'
cp
-p
{
file
}
{
args
.
rtldir
}
/
\n
'
compiled_filelist
.
append
(
temp_str
)
else
:
temp_str
=
f
'
add_files -norecurse -force -copy_to
{
args
.
rtldir
}
"'
...
...
@@ -232,6 +244,10 @@ def incdir_compile(args, incdirs):
if
len
(
incdirs
)
>
0
:
for
directory
in
incdirs
:
temp_str
+=
"
EXTRA_ARGS += +incdir+
"
+
str
(
directory
)
+
"
\n
"
elif
args
.
vfiles
==
True
:
if
len
(
incdirs
)
>
0
:
for
directory
in
incdirs
:
temp_str
+=
"
+incdir+
"
+
str
(
directory
)
+
"
\n
"
return
temp_str
def
defines_compile
(
args
):
...
...
@@ -277,7 +293,8 @@ if __name__ == "__main__":
parser
.
add_argument
(
"
-s
"
,
"
--synthesis
"
,
action
=
'
store_true
'
,
help
=
"
Generate bash script for copying flist to synthesis
"
)
parser
.
add_argument
(
"
-m
"
,
"
--makefile
"
,
action
=
'
store_true
'
,
help
=
"
Generate a Makefile RTL Sources File
"
)
parser
.
add_argument
(
"
-a
"
,
"
--absolute
"
,
action
=
'
store_true
'
,
help
=
"
Substitute environment Variables with Absolute Path
"
)
parser
.
add_argument
(
"
-v
"
,
"
--vfiles
"
,
action
=
'
store_true
'
,
help
=
"
Generate a vc filelist
"
)
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
filelist_compile
(
args
)
This diff is collapsed.
Click to expand it.