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
b94cc58d
Commit
b94cc58d
authored
Oct 07, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makefilesim: abstract get_stamp_file.
parent
7b04df5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
23 deletions
+14
-23
makefilesim.py
hdlmake/tools/makefilesim.py
+14
-23
No files found.
hdlmake/tools/makefilesim.py
View file @
b94cc58d
...
...
@@ -62,13 +62,21 @@ TOP_MODULE := {top_module}
self
.
writeln
(
"#target for performing local simulation
\n
"
"local: sim_pre_cmd simulation sim_post_cmd
\n
"
)
def
get_stamp_file
(
self
,
file
):
"""Stamp file for source file :param file:"""
return
os
.
path
.
join
(
file
.
library
,
file
.
purename
,
".{}_{}"
.
format
(
file
.
purename
,
file
.
extension
()))
def
_makefile_sim_sources
(
self
):
"""Generic method to write the simulation Makefile HDL sources"""
fileset
=
self
.
fileset
self
.
write
(
"VERILOG_SRC := "
)
for
vlog
in
fileset
.
filter
(
VerilogFile
)
.
sort
():
if
not
vlog
.
is_include
:
self
.
writeln
(
vlog
.
rel_path
()
+
"
\\
"
)
if
vlog
.
is_include
:
continue
self
.
writeln
(
vlog
.
rel_path
()
+
"
\\
"
)
self
.
writeln
()
self
.
write
(
"VERILOG_OBJ := "
)
for
vlog
in
fileset
.
filter
(
VerilogFile
)
.
sort
():
...
...
@@ -78,12 +86,7 @@ TOP_MODULE := {top_module}
# if the compilation process fails) and add an ending according
# to file's extension (.sv and .vhd files may have the same
# corename and this causes a mess
self
.
writeln
(
os
.
path
.
join
(
vlog
.
library
,
vlog
.
purename
,
".{}_{}"
.
format
(
vlog
.
purename
,
vlog
.
extension
()))
+
"
\\
"
)
self
.
writeln
(
self
.
get_stamp_file
(
vlog
)
+
"
\\
"
)
self
.
writeln
()
self
.
write
(
"VHDL_SRC := "
)
for
vhdl
in
fileset
.
filter
(
VHDLFile
)
.
sort
():
...
...
@@ -93,12 +96,7 @@ TOP_MODULE := {top_module}
self
.
write
(
"VHDL_OBJ := "
)
for
vhdl
in
fileset
.
filter
(
VHDLFile
)
.
sort
():
# file compilation indicator (important: add _vhd ending)
self
.
writeln
(
os
.
path
.
join
(
vhdl
.
library
,
vhdl
.
purename
,
".{}_{}"
.
format
(
vhdl
.
purename
,
vhdl
.
extension
()))
+
"
\\
"
)
self
.
writeln
(
self
.
get_stamp_file
(
vhdl
)
+
"
\\
"
)
self
.
writeln
()
def
_makefile_sim_dep_files
(
self
):
...
...
@@ -107,20 +105,13 @@ TOP_MODULE := {top_module}
for
file_aux
in
fileset
:
if
any
(
isinstance
(
file_aux
,
file_type
)
for
file_type
in
self
.
_hdl_files
):
self
.
write
(
"
%
s:
%
s"
%
(
os
.
path
.
join
(
file_aux
.
library
,
file_aux
.
purename
,
".
%
s_
%
s"
%
(
file_aux
.
purename
,
file_aux
.
extension
())),
file_aux
.
rel_path
()))
self
.
write
(
"
%
s:
%
s"
%
(
self
.
get_stamp_file
(
file_aux
),
file_aux
.
rel_path
()))
# list dependencies, do not include the target file
for
dep_file
in
sorted
([
dfile
for
dfile
in
file_aux
.
depends_on
if
dfile
is
not
file_aux
],
key
=
(
lambda
x
:
x
.
file_path
)):
if
dep_file
in
fileset
:
name
=
dep_file
.
purename
extension
=
dep_file
.
extension
()
self
.
write
(
"
\\\n
"
+
os
.
path
.
join
(
dep_file
.
library
,
name
,
".
%
s_
%
s"
%
(
name
,
extension
)))
self
.
write
(
"
\\\n
"
+
self
.
get_stamp_file
(
dep_file
))
else
:
# the file is included -> we depend directly on it
self
.
write
(
"
\\\n
"
+
dep_file
.
rel_path
())
...
...
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