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
fbbc1c2b
Commit
fbbc1c2b
authored
1 year ago
by
Daniel Newbrook
Browse files
Options
Downloads
Patches
Plain Diff
Add ASIC Flow for filelist compile
parent
039acb1d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/filelist_compile.py
+56
-18
56 additions, 18 deletions
bin/filelist_compile.py
bin/htmlgen/makefile
+1
-1
1 addition, 1 deletion
bin/htmlgen/makefile
with
57 additions
and
19 deletions
bin/filelist_compile.py
+
56
−
18
View file @
fbbc1c2b
...
...
@@ -79,12 +79,24 @@ def read_list(filelist, first, incdirs, args):
# Append to filelist
if
args
.
absolute
==
True
:
if
args
.
tcl
==
True
:
compiled_filelist
.
append
(
"
read_verilog
"
+
str
(
env_var_substitute
(
line_list
[
1
],
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
))
if
args
.
genus
==
True
:
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
))
else
:
compiled_filelist
.
append
(
"
read_verilog
"
+
str
(
env_var_substitute
(
line_list
[
1
],
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
/
"
+
str
(
file
))
else
:
compiled_filelist
.
append
(
env_var_substitute
(
line_list
[
1
])
+
"
/
"
+
str
(
file
))
else
:
if
args
.
tcl
==
True
:
compiled_filelist
.
append
(
"
read_verilog
"
+
str
(
line_list
[
1
])
+
"
/
"
+
str
(
file
).
replace
(
"
$
"
,
"
$env
"
))
if
args
.
genus
==
True
:
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
))
else
:
compiled_filelist
.
append
(
"
read_verilog
"
+
str
(
line_list
[
1
])
+
"
/
"
+
str
(
file
).
replace
(
"
$
"
,
"
$env
"
))
else
:
compiled_filelist
.
append
(
line_list
[
1
]
+
"
/
"
+
str
(
file
))
...
...
@@ -97,16 +109,28 @@ def read_list(filelist, first, incdirs, args):
if
args
.
tcl
==
True
:
if
args
.
absolute
==
True
:
if
first
==
True
:
compiled_filelist
.
append
(
"
set search_path
"
+
str
(
env_var_substitute
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
),
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
))
if
args
.
genus
==
True
:
compiled_filelist
.
append
(
"
set_db init_hdl_search_path
"
+
str
(
env_var_substitute
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
),
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
))
else
:
compiled_filelist
.
append
(
"
set search_path
"
+
str
(
env_var_substitute
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
),
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
))
first
=
False
else
:
compiled_filelist
.
append
(
"
set search_path [ concat $search_path
"
+
str
(
env_var_substitute
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
),
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
]
"
)
if
args
.
genus
==
True
:
compiled_filelist
.
append
(
"
set_db init_hdl_search_path
"
+
str
(
env_var_substitute
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
),
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
))
else
:
compiled_filelist
.
append
(
"
set search_path [ concat $search_path
"
+
str
(
env_var_substitute
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
),
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
]
"
)
else
:
if
first
==
True
:
compiled_filelist
.
append
(
"
set search_path
"
+
str
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
)).
replace
(
"
$
"
,
"
$env
"
))
if
args
.
genus
==
True
:
compiled_filelist
.
append
(
"
set_db init_hdl_search_path
"
+
str
(
env_var_substitute
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
),
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
))
else
:
compiled_filelist
.
append
(
"
set search_path
"
+
str
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
)).
replace
(
"
$
"
,
"
$env
"
))
first
=
False
else
:
compiled_filelist
.
append
(
"
set search_path [ concat $search_path
"
+
str
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
]
"
)
if
args
.
genus
==
True
:
compiled_filelist
.
append
(
"
set_db init_hdl_search_path
"
+
str
(
env_var_substitute
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
),
tcl
=
True
)).
replace
(
"
$
"
,
"
$env
"
))
else
:
compiled_filelist
.
append
(
"
set search_path [ concat $search_path
"
+
str
(
line_list
[
0
].
lstrip
(
"
+incdir+
"
)).
replace
(
"
$
"
,
"
$env
"
)
+
"
]
"
)
# elif args.makefile == True:
# if args.absolute == True:
# if first == True:
...
...
@@ -149,22 +173,34 @@ def read_list(filelist, first, incdirs, args):
compiled_filelist
.
append
(
line_list
[
0
])
if
len
(
hdl_files
)
>
0
:
# temp_str = 'add_files -norecurse -scan_for_includes "'
temp_str
=
f
'
add_files -norecurse -force -copy_to
{
args
.
rtldir
}
"'
for
file
in
hdl_files
:
temp_str
+=
file
+
"
"
temp_str
+=
'"'
compiled_filelist
.
append
(
temp_str
)
if
args
.
genus
==
False
:
temp_str
=
f
'
add_files -norecurse -force -copy_to
{
args
.
rtldir
}
"'
for
file
in
hdl_files
:
temp_str
+=
file
+
"
"
temp_str
+=
'"'
compiled_filelist
.
append
(
temp_str
)
else
:
if
hdl_files
[
0
].
endswith
(
"
.sv
"
):
temp_str
=
f
'
read_hdl -language sv
'
else
:
temp_str
=
f
'
read_hdl
'
for
file
in
hdl_files
:
temp_str
+=
file
+
"
"
compiled_filelist
.
append
(
temp_str
)
return
compiled_filelist
,
first
,
incdirs
def
incdir_compile
(
args
,
incdirs
):
temp_str
=
""
if
args
.
tcl
==
True
:
if
len
(
incdirs
)
>
0
:
temp_str
=
'
set_property include_dirs
"'
for
directory
in
incdirs
:
temp_dir
=
str
(
directory
).
replace
(
"
$
"
,
"
$env
"
)
temp_str
+=
"
"
+
temp_dir
temp_str
+=
'"
[current_fileset]
'
if
args
.
genus
==
False
:
if
len
(
incdirs
)
>
0
:
temp_str
=
'
set_property include_dirs
"'
for
directory
in
incdirs
:
temp_dir
=
str
(
directory
).
replace
(
"
$
"
,
"
$env
"
)
temp_str
+=
"
"
+
temp_dir
temp_str
+=
'"
[current_fileset]
'
elif
args
.
makefile
==
True
:
if
len
(
incdirs
)
>
0
:
for
directory
in
incdirs
:
...
...
@@ -190,8 +226,9 @@ def filelist_compile(args):
# Create string of all paths to write out
filelist_str
=
filelist_header
if
(
args
.
tcl
==
False
and
args
.
makefile
==
False
)
else
filelist_header
.
replace
(
"
//
"
,
"
#
"
)
if
args
.
tcl
==
True
:
if
args
.
genus
==
False
:
# filelist_str += incdir_compile(args, incdirs) + "\n"
filelist_str
+=
defines_compile
(
args
)
filelist_str
+=
defines_compile
(
args
)
for
path
in
filelist
:
filelist_str
+=
path
filelist_str
+=
incdir_compile
(
args
,
incdirs
)
+
"
\n
"
# filelist_str += defines_compile(args)
...
...
@@ -207,6 +244,7 @@ if __name__ == "__main__":
parser
.
add_argument
(
"
-o
"
,
"
--output
"
,
type
=
str
,
help
=
"
Output Filelist location
"
)
parser
.
add_argument
(
"
-e
"
,
"
--exclude
"
,
action
=
'
store_true
'
,
help
=
"
Exclude filists including these strings
"
)
parser
.
add_argument
(
"
-t
"
,
"
--tcl
"
,
action
=
'
store_true
'
,
help
=
"
Generate a TCL Script
"
)
parser
.
add_argument
(
"
-g
"
,
"
--genus
"
,
action
=
'
store_true
'
,
help
=
"
Generate TCL script for genus
"
)
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
(
"
-r
"
,
"
--rtldir
"
,
type
=
str
,
help
=
"
Directory where RTL Source will be copied to in TCL mode
"
)
...
...
This diff is collapsed.
Click to expand it.
bin/htmlgen/makefile
+
1
−
1
View file @
fbbc1c2b
...
...
@@ -26,7 +26,7 @@ gen_html:
@
mkdir
-p
$(
OUT_DIR
)
/build
@
echo
Output Directory is
$(
OUT_DIR
)
/build
@
echo
Filelist is
$(
FILELIST
)
$(
MAKE
)
-C
$(
SOCLABS_NANOSOC_TECH_DIR
)
defs
_gen
$(
MAKE
)
-C
$(
SOCLABS_NANOSOC_TECH_DIR
)
gen_
defs
@
(
cd
$(
OUT_DIR
)
/build
;
\
rm
*
.html
;
rm
*
.gif
;
\
$(
SOCLABS_SOCTOOLS_FLOW_DIR
)
/bin/filelist_compile.py
-ea
-f
$(
FILELIST
)
-o
$(
OUTPUT_FILELIST
)
;
\
...
...
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