Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
0248c826
Commit
0248c826
authored
May 05, 2016
by
Will
Committed by
Will Kamp
May 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add simulation file update.
List files in compile order. Tidy up.
parent
75878a66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
qsys_hw_tcl_update.py
hdlmake/action/qsys_hw_tcl_update.py
+17
-9
No files found.
hdlmake/action/qsys_hw_tcl_update.py
View file @
0248c826
...
...
@@ -32,32 +32,40 @@ class QsysHwTclUpdate(Action):
file_list
=
dep_solver
.
make_dependency_sorted_list
(
file_set
)
files_str
=
[
os
.
path
.
relpath
(
f
.
path
)
for
f
in
file_list
]
tl
=
" TOP_LEVEL_FILE"
file_tcl
=
[]
for
fs
in
reversed
(
files_str
)
:
for
fs
in
files_str
:
path
,
fname
=
os
.
path
.
split
(
fs
)
file_tcl
.
append
(
"add_fileset_file
%
s VHDL PATH
%
s
%
s
\n
"
%
(
fname
,
fs
,
tl
))
tl
=
""
file_tcl
.
append
(
"add_fileset_file
%
s VHDL PATH
%
s"
%
(
fname
,
fs
))
# mark the last file as the top level file.
file_tcl
[
-
1
]
+=
" TOP_LEVEL_FILE"
file_tcl
.
append
(
"
\n
"
)
hw_tcl_filename
=
self
.
modules_pool
.
get_top_module
()
.
hw_tcl_filename
;
hw_tcl_filename_backup
=
hw_tcl_filename
+
".bak"
shutil
.
copy2
(
hw_tcl_filename
,
hw_tcl_filename_backup
)
infile
=
open
(
hw_tcl_filename
,
"r"
)
inserted
=
Fals
e
inserted
=
Tru
e
out_lines
=
[]
for
line
in
infile
.
readlines
():
if
line
.
startswith
(
"add_fileset QUARTUS_SYNTH"
):
inserted
=
False
if
line
.
startswith
(
"add_fileset SIM_VHDL"
):
inserted
=
False
if
line
.
startswith
(
"add_fileset_file"
):
if
not
inserted
:
out_lines
.
extend
(
file_tcl
)
out_lines
.
append
(
"
\n
"
.
join
(
file_tcl
)
)
inserted
=
True
else
:
out_lines
.
append
(
line
)
infile
.
close
()
logging
.
info
(
"Updating the file list in
%
s"
,
hw_tcl_filename
)
hw_tcl_filename_backup
=
hw_tcl_filename
+
".bak"
shutil
.
copy2
(
hw_tcl_filename
,
hw_tcl_filename_backup
)
logging
.
info
(
"Old hw.tcl file backed up to
%
s"
,
hw_tcl_filename_backup
)
logging
.
info
(
"Updating the file list in
%
s"
,
hw_tcl_filename
)
outfile
=
open
(
hw_tcl_filename
,
"w"
)
outfile
.
writelines
(
out_lines
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment