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
5e6d6130
Commit
5e6d6130
authored
Feb 26, 2020
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isim, makefilevsim: factorize code.
parent
bea57492
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
24 deletions
+29
-24
isim.py
hdlmake/tools/isim.py
+14
-13
makefilesim.py
hdlmake/tools/makefilesim.py
+4
-4
makefilevsim.py
hdlmake/tools/makefilevsim.py
+11
-7
No files found.
hdlmake/tools/isim.py
View file @
5e6d6130
...
...
@@ -133,6 +133,19 @@ class ToolISim(MakefileSim):
else
:
return
None
def
_makefile_sim_libraries
(
self
,
libs
):
# ISim does not have a vmap command to insert additional libraries in
#.ini file.
for
lib
in
libs
:
libfile
=
self
.
get_stamp_library
(
lib
)
self
.
writeln
(
"{}:"
.
format
(
libfile
))
self
.
write
(
"
\t
({mkdir} {lib} && {touch} {libfile}"
.
format
(
lib
=
lib
,
libfile
=
libfile
,
mkdir
=
shell
.
mkdir_command
(),
touch
=
shell
.
touch_command
()))
# Modify xilinxsim.ini file by including the extra local libraries
self
.
write
(
" && echo {lib}={lib} >> xilinxsim.ini) "
.
format
(
lib
=
lib
))
self
.
write
(
"|| {rm} {lib}
\n
"
.
format
(
lib
=
lib
,
rm
=
shell
.
del_command
()))
self
.
writeln
()
def
_makefile_sim_compilation
(
self
):
"""Print the compile simulation target for Xilinx ISim"""
libs
=
self
.
get_all_libs
()
...
...
@@ -151,17 +164,5 @@ fuse:
\t\t
fuse work.$(TOP_MODULE) -intstyle ise -incremental -o $(FUSE_OUTPUT)
"""
)
# ISim does not have a vmap command to insert additional libraries in
#.ini file.
for
lib
in
libs
:
libfile
=
lib
+
shell
.
makefile_slash_char
()
+
"."
+
lib
self
.
write
(
"{}:
\n
"
.
format
(
libfile
))
self
.
write
(
"
\t
({mkdir} {lib} && {touch} {libfile}"
.
format
(
lib
=
lib
,
libfile
=
libfile
,
mkdir
=
shell
.
mkdir_command
(),
touch
=
shell
.
touch_command
()))
self
.
write
(
" && echo {lib}={lib} >> xilinxsim.ini) "
.
format
(
lib
=
lib
))
self
.
write
(
"|| {rm} {lib}
\n
"
.
format
(
lib
=
lib
,
rm
=
shell
.
del_command
()))
self
.
write
(
'
\n
'
)
# Modify xilinxsim.ini file by including the extra local libraries
# self.write(' '.join(["\t(echo """, lib+"="+lib+"/."+lib, ">>",
# "${XILINX_INI_PATH}/xilinxsim.ini"]))
self
.
_makefile_sim_libraries
(
libs
)
self
.
_makefile_sim_dep_files
()
hdlmake/tools/makefilesim.py
View file @
5e6d6130
...
...
@@ -60,6 +60,9 @@ class MakefileSim(ToolMakefile):
name
=
dep_file
.
purename
return
os
.
path
.
join
(
dep_file
.
library
,
name
,
".{}_{}"
.
format
(
name
,
dep_file
.
extension
()))
def
get_stamp_library
(
self
,
lib
):
return
lib
+
shell
.
makefile_slash_char
()
+
"."
+
lib
def
_makefile_touch_stamp_file
(
self
):
self
.
write
(
"
\t\t
@"
+
shell
.
mkdir_command
()
+
" $(dir $@)"
)
self
.
writeln
(
" && "
+
shell
.
touch_command
()
+
" $@
\n
"
)
...
...
@@ -134,10 +137,7 @@ class MakefileSim(ToolMakefile):
def
_makefile_sim_libs_variables
(
self
,
libs
):
"""Create variables for libraries name"""
self
.
writeln
(
'LIBS := '
+
' '
.
join
(
libs
))
self
.
write
(
'LIB_IND := '
)
self
.
write
(
' '
.
join
([
lib
+
shell
.
makefile_slash_char
()
+
"."
+
lib
for
lib
in
libs
]))
self
.
write
(
'
\n
'
)
self
.
writeln
(
'LIB_IND := '
+
' '
.
join
([
self
.
get_stamp_library
(
lib
)
for
lib
in
libs
]))
self
.
writeln
()
def
_makefile_sim_command
(
self
):
...
...
hdlmake/tools/makefilevsim.py
View file @
5e6d6130
...
...
@@ -90,6 +90,16 @@ class MakefileVsim(MakefileSim):
else
:
return
None
def
_makefile_sim_libraries
(
self
,
libs
):
for
lib
in
libs
:
libfile
=
self
.
get_stamp_library
(
lib
)
self
.
writeln
(
"{}:"
.
format
(
libfile
))
self
.
writeln
(
"
\t
(vlib {lib} && vmap $(VMAP_FLAGS) {lib} "
"&& {touch} {libfile}) || {rm} {lib}"
.
format
(
lib
=
lib
,
touch
=
shell
.
touch_command
(),
libfile
=
libfile
,
rm
=
shell
.
del_command
()))
self
.
writeln
()
def
_makefile_sim_compilation
(
self
):
"""Write a properly formatted Makefile for the simulator.
The Makefile format is shared, but flags, dependencies, clean rules,
...
...
@@ -111,11 +121,5 @@ class MakefileVsim(MakefileSim):
for
filename
,
filesource
in
six
.
iteritems
(
self
.
copy_rules
):
self
.
writeln
(
"{}: {}"
.
format
(
filename
,
filesource
))
self
.
writeln
(
"
\t\t
{} $< . 2>&1"
.
format
(
shell
.
copy_command
()))
for
lib
in
libs
:
self
.
write
(
lib
+
shell
.
makefile_slash_char
()
+
"."
+
lib
+
":
\n
"
)
self
.
writeln
(
"
\t
(vlib {lib} && vmap $(VMAP_FLAGS) {lib} "
"&& {touch} {lib}{slash}.{lib}) || {rm} {lib}"
.
format
(
lib
=
lib
,
touch
=
shell
.
touch_command
(),
slash
=
shell
.
makefile_slash_char
(),
rm
=
shell
.
del_command
()))
self
.
writeln
()
self
.
_makefile_sim_libraries
(
libs
)
self
.
_makefile_sim_dep_files
()
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