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
1d05138a
Commit
1d05138a
authored
Nov 01, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makefilesim.py: factorize code.
parent
98943d10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
makefilesim.py
hdlmake/tools/makefilesim.py
+5
-2
makefilevsim.py
hdlmake/tools/makefilevsim.py
+6
-11
No files found.
hdlmake/tools/makefilesim.py
View file @
1d05138a
...
...
@@ -104,6 +104,10 @@ TOP_MODULE := {top_module}
self
.
write
(
"
\\\n
{}"
.
format
(
path_mod
.
relpath
(
dep_file
,
cwd
)))
self
.
writeln
()
def
_makefile_sim_file_touch_stamp
(
self
):
self
.
write
(
"
\t\t
@"
+
shell
.
mkdir_command
()
+
" $(dir $@)"
)
self
.
writeln
(
" && "
+
shell
.
touch_command
()
+
" $@
\n
"
)
def
_makefile_sim_dep_files
(
self
):
"""Print dummy targets to handle file dependencies"""
for
file_aux
in
self
.
fileset
.
sort
():
...
...
@@ -115,8 +119,7 @@ TOP_MODULE := {top_module}
elif
isinstance
(
file_aux
,
VerilogFile
):
command_key
=
'vlog'
self
.
writeln
(
"
\t\t
"
+
self
.
SIMULATOR_CONTROLS
[
command_key
]
.
format
(
work
=
file_aux
.
library
))
self
.
write
(
"
\t\t
@"
+
shell
.
mkdir_command
()
+
" $(dir $@)"
)
self
.
writeln
(
" && "
+
shell
.
touch_command
()
+
" $@
\n
"
)
self
.
_makefile_sim_file_touch_stamp
()
self
.
writeln
()
def
_makefile_sim_command
(
self
):
...
...
hdlmake/tools/makefilevsim.py
View file @
1d05138a
...
...
@@ -119,19 +119,14 @@ class MakefileVsim(MakefileSim):
# rules for all _primary.dat files for sv
for
vlog
in
fileset
.
filter
(
VerilogFile
)
.
sort
():
self
.
_makefile_sim_file_rule
(
vlog
)
compile_template
=
string
.
Template
(
"
\t\t
vlog -work ${library} $$(VLOG_FLAGS) "
"${sv_option} $${INCLUDE_DIRS} $$<"
)
compile_line
=
compile_template
.
substitute
(
library
=
vlog
.
library
,
sv_option
=
"-sv"
if
isinstance
(
vlog
,
SVFile
)
else
""
)
self
.
writeln
(
compile_line
)
self
.
write
(
"
\t\t
@"
+
shell
.
mkdir_command
()
+
" $(dir $@)"
)
self
.
writeln
(
" && "
+
shell
.
touch_command
()
+
" $@
\n\n
"
)
self
.
writeln
(
"
\t\t
vlog -work {library} $(VLOG_FLAGS) {sv_option} ${{INCLUDE_DIRS}} $<"
.
format
(
library
=
vlog
.
library
,
sv_option
=
"-sv"
if
isinstance
(
vlog
,
SVFile
)
else
""
))
self
.
_makefile_sim_file_touch_stamp
()
self
.
writeln
()
self
.
writeln
()
# list rules for all _primary.dat files for vhdl
for
vhdl
in
fileset
.
filter
(
VHDLFile
)
.
sort
():
self
.
_makefile_sim_file_rule
(
vhdl
)
self
.
writeln
(
"
\t\t
vcom $(VCOM_FLAGS) -work {} $< "
.
format
(
vhdl
.
library
))
self
.
writeln
(
"
\t\t
@"
+
shell
.
mkdir_command
()
+
" $(dir $@) && "
+
shell
.
touch_command
()
+
" $@
\n\n
"
)
self
.
_makefile_sim_file_touch_stamp
()
self
.
writeln
(
)
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