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
cabc3421
Commit
cabc3421
authored
Oct 31, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makefilevsim.py: abstract _get_stamp_file()
parent
01dda1ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
makefilevsim.py
hdlmake/tools/makefilevsim.py
+9
-18
No files found.
hdlmake/tools/makefilevsim.py
View file @
cabc3421
...
@@ -81,6 +81,10 @@ class MakefileVsim(MakefileSim):
...
@@ -81,6 +81,10 @@ class MakefileVsim(MakefileSim):
self
.
writeln
(
"VLOG_FLAGS :=
%
s"
%
vlog_flags
)
self
.
writeln
(
"VLOG_FLAGS :=
%
s"
%
vlog_flags
)
self
.
writeln
(
"VMAP_FLAGS :=
%
s"
%
vmap_flags
)
self
.
writeln
(
"VMAP_FLAGS :=
%
s"
%
vmap_flags
)
def
_get_stamp_file
(
self
,
dep_file
):
name
=
dep_file
.
purename
return
os
.
path
.
join
(
dep_file
.
library
,
name
,
".{}_{}"
.
format
(
name
,
dep_file
.
extension
()))
def
_makefile_sim_compilation
(
self
):
def
_makefile_sim_compilation
(
self
):
"""Write a properly formatted Makefile for the simulator.
"""Write a properly formatted Makefile for the simulator.
The Makefile format is shared, but flags, dependencies, clean rules,
The Makefile format is shared, but flags, dependencies, clean rules,
...
@@ -126,17 +130,11 @@ class MakefileVsim(MakefileSim):
...
@@ -126,17 +130,11 @@ class MakefileVsim(MakefileSim):
self
.
write
(
" || {} {}
\n\n
"
.
format
(
shell
.
del_command
(),
lib
))
self
.
write
(
" || {} {}
\n\n
"
.
format
(
shell
.
del_command
(),
lib
))
# rules for all _primary.dat files for sv
# rules for all _primary.dat files for sv
for
vlog
in
fileset
.
filter
(
VerilogFile
)
.
sort
():
for
vlog
in
fileset
.
filter
(
VerilogFile
)
.
sort
():
self
.
write
(
"
%
s:
%
s"
%
(
os
.
path
.
join
(
self
.
write
(
"
%
s:
%
s"
%
(
self
.
_get_stamp_file
(
vlog
),
vlog
.
rel_path
()))
vlog
.
library
,
vlog
.
purename
,
".
%
s_
%
s"
%
(
vlog
.
purename
,
vlog
.
extension
())),
vlog
.
rel_path
()))
# list dependencies, do not include the target file
# list dependencies, do not include the target file
for
dep_file
in
sorted
(
vlog
.
depends_on
,
key
=
(
lambda
x
:
x
.
path
)):
for
dep_file
in
sorted
(
vlog
.
depends_on
,
key
=
(
lambda
x
:
x
.
path
)):
if
dep_file
is
not
vlog
:
if
dep_file
is
not
vlog
:
name
=
dep_file
.
purename
self
.
write
(
"
\\\n
"
+
self
.
_get_stamp_file
(
dep_file
))
extension
=
dep_file
.
extension
()
self
.
write
(
"
\\\n
"
+
os
.
path
.
join
(
dep_file
.
library
,
name
,
".
%
s_
%
s"
%
(
name
,
extension
)))
for
dep_file
in
sorted
(
vlog
.
included_files
):
for
dep_file
in
sorted
(
vlog
.
included_files
):
self
.
write
(
"
\\\n
{}"
.
format
(
path_mod
.
relpath
(
dep_file
,
cwd
)))
self
.
write
(
"
\\\n
{}"
.
format
(
path_mod
.
relpath
(
dep_file
,
cwd
)))
self
.
writeln
()
self
.
writeln
()
...
@@ -152,25 +150,18 @@ class MakefileVsim(MakefileSim):
...
@@ -152,25 +150,18 @@ class MakefileVsim(MakefileSim):
self
.
writeln
()
self
.
writeln
()
# list rules for all _primary.dat files for vhdl
# list rules for all _primary.dat files for vhdl
for
vhdl
in
fileset
.
filter
(
VHDLFile
)
.
sort
():
for
vhdl
in
fileset
.
filter
(
VHDLFile
)
.
sort
():
lib
=
vhdl
.
library
purename
=
vhdl
.
purename
# each .dat depends on corresponding .vhd file
# each .dat depends on corresponding .vhd file
self
.
write
(
"
%
s:
%
s"
%
(
os
.
path
.
join
(
self
.
write
(
"
%
s:
%
s"
%
(
self
.
_get_stamp_file
(
vhdl
),
vhdl
.
rel_path
()))
lib
,
purename
,
"."
+
purename
+
"_"
+
vhdl
.
extension
()),
vhdl
.
rel_path
()))
# list dependencies, do not include the target file
# list dependencies, do not include the target file
for
dep_file
in
sorted
([
dfile
for
dfile
in
vhdl
.
depends_on
for
dep_file
in
sorted
([
dfile
for
dfile
in
vhdl
.
depends_on
if
dfile
is
not
vhdl
],
if
dfile
is
not
vhdl
],
key
=
(
lambda
x
:
x
.
path
)):
key
=
(
lambda
x
:
x
.
path
)):
if
dep_file
in
fileset
:
if
dep_file
in
fileset
:
name
=
dep_file
.
purename
self
.
write
(
"
\\\n
"
+
self
.
_get_stamp_file
(
dep_file
))
extension
=
dep_file
.
extension
()
self
.
write
(
"
\\\n
"
+
os
.
path
.
join
(
dep_file
.
library
,
name
,
".
%
s_
%
s"
%
(
name
,
extension
)))
else
:
else
:
self
.
write
(
"
\\\n
"
+
dep_file
.
rel_path
())
self
.
write
(
"
\\\n
"
+
dep_file
.
rel_path
())
self
.
writeln
()
self
.
writeln
()
self
.
writeln
(
' '
.
join
([
"
\t\t
vcom $(VCOM_FLAGS)"
,
self
.
writeln
(
' '
.
join
([
"
\t\t
vcom $(VCOM_FLAGS)"
,
"-work"
,
lib
,
"$< "
]))
"-work"
,
vhdl
.
library
,
"$< "
]))
self
.
writeln
(
"
\t\t
@"
+
shell
.
mkdir_command
()
+
self
.
writeln
(
"
\t\t
@"
+
shell
.
mkdir_command
()
+
" $(dir $@) && "
+
shell
.
touch_command
()
+
" $@
\n\n
"
)
" $(dir $@) && "
+
shell
.
touch_command
()
+
" $@
\n\n
"
)
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