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
0c404d13
Commit
0c404d13
authored
Feb 26, 2020
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isim: factorize code.
parent
5e104de0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
44 deletions
+40
-44
isim.py
hdlmake/tools/isim.py
+16
-22
makefilesim.py
hdlmake/tools/makefilesim.py
+2
-2
Makefile.ref
testsuite/010isim/Makefile.ref
+7
-6
Makefile.ref
testsuite/060isim_windows/Makefile.ref
+7
-6
Makefile.ref
testsuite/061err_nobin/Makefile.ref
+7
-6
Makefile.ref
testsuite/097sys_package/Makefile.ref
+1
-2
No files found.
hdlmake/tools/isim.py
View file @
0c404d13
...
...
@@ -118,9 +118,23 @@ class ToolISim(MakefileSim):
self
.
write
(
"{}: {} "
.
format
(
self
.
get_stamp_file
(
file_aux
),
file_aux
.
rel_path
()))
self
.
writeln
(
' '
.
join
([
fname
.
rel_path
()
for
fname
in
file_aux
.
depends_on
]))
def
_makefile_sim_compile_file
(
self
,
srcfile
):
if
isinstance
(
srcfile
,
VerilogFile
):
res
=
"vlogcomp -work {lib}=.{slash}{lib} $(VLOGCOMP_FLAGS) "
.
format
(
lib
=
srcfile
.
library
,
slash
=
shell
.
makefile_slash_char
())
if
srcfile
.
include_dirs
:
res
+=
' -i '
res
+=
' '
.
join
(
srcfile
.
include_dirs
)
res
+=
" $<"
return
res
elif
isinstance
(
srcfile
,
VHDLFile
):
return
"vhpcomp $(VHPCOMP_FLAGS) -work {lib}=.{slash}{lib} $< "
.
format
(
lib
=
srcfile
.
library
,
slash
=
shell
.
makefile_slash_char
())
else
:
return
None
def
_makefile_sim_compilation
(
self
):
"""Print the compile simulation target for Xilinx ISim"""
fileset
=
self
.
fileset
libs
=
set
(
f
.
library
for
f
in
self
.
fileset
)
self
.
writeln
(
'LIBS := '
+
' '
.
join
(
libs
))
# tell how to make libraries
...
...
@@ -155,24 +169,4 @@ fuse:
# Modify xilinxsim.ini file by including the extra local libraries
# self.write(' '.join(["\t(echo """, lib+"="+lib+"/."+lib, ">>",
# "${XILINX_INI_PATH}/xilinxsim.ini"]))
# rules for all _primary.dat files for sv
# incdir = ""
for
vl_file
in
fileset
.
filter
(
VerilogFile
)
.
sort
():
self
.
_makefile_syn_file_rule
(
vl_file
)
self
.
write
(
"
\t\t
vlogcomp -work {lib}=.{slash}{lib}"
.
format
(
lib
=
vl_file
.
library
,
slash
=
shell
.
makefile_slash_char
()))
self
.
write
(
" $(VLOGCOMP_FLAGS) "
)
if
vl_file
.
include_dirs
:
self
.
write
(
' -i '
)
self
.
write
(
' '
.
join
(
vl_file
.
include_dirs
))
self
.
writeln
(
" $<"
)
self
.
_makefile_touch_stamp_file
()
self
.
writeln
()
self
.
write
(
"
\n
"
)
# list rules for all _primary.dat files for vhdl
for
vhdl_file
in
fileset
.
filter
(
VHDLFile
)
.
sort
():
self
.
_makefile_syn_file_rule
(
vhdl_file
)
self
.
writeln
(
"
\t\t
vhpcomp $(VHPCOMP_FLAGS) -work {lib}=.{slash}{lib} $< "
.
format
(
lib
=
vhdl_file
.
library
,
slash
=
shell
.
makefile_slash_char
()))
self
.
_makefile_touch_stamp_file
()
self
.
writeln
()
self
.
_makefile_sim_dep_files
()
hdlmake/tools/makefilesim.py
View file @
0c404d13
...
...
@@ -115,7 +115,7 @@ class MakefileSim(ToolMakefile):
cmd
=
self
.
SIMULATOR_CONTROLS
.
get
(
key
)
if
cmd
is
None
:
return
None
return
"
\t\t
"
+
cmd
.
format
(
work
=
srcfile
.
library
)
return
cmd
.
format
(
work
=
srcfile
.
library
)
def
_makefile_sim_dep_files
(
self
):
"""Print dummy targets to handle file dependencies"""
...
...
@@ -123,7 +123,7 @@ class MakefileSim(ToolMakefile):
cmd
=
self
.
_makefile_sim_compile_file
(
file_aux
)
if
cmd
is
not
None
:
self
.
_makefile_sim_file_rule
(
file_aux
)
self
.
writeln
(
cmd
)
self
.
writeln
(
"
\t\t
"
+
cmd
)
self
.
_makefile_touch_stamp_file
()
self
.
writeln
()
...
...
testsuite/010isim/Makefile.ref
View file @
0c404d13
...
...
@@ -39,19 +39,20 @@ fuse:
work/.work
:
(
mkdir
-p
work
&&
touch
work/.work
&&
echo
work
=
work
>>
xilinxsim.ini
)
||
rm
-rf
work
work/gate
3_tb/.gate3_tb_v
:
../files/gate3_tb.v ../files/gate3.vhd
v
logcomp
-work
work
=
./work
$(VLOGCOMP_FLAGS)
-i
../files
$<
work/gate
/.gate_vhdl
:
../files/gate.vhdl
v
hpcomp
$(VHPCOMP_FLAGS)
-work
work
=
./work
$<
@
mkdir
-p
$
(
dir
$@
)
&&
touch
$@
work/gate/.gate_vhdl
:
../files/gate.vhdl
work/gate3/.gate3_vhd
:
../files/gate3.vhd
\
work/gate/.gate_vhdl
vhpcomp
$(VHPCOMP_FLAGS)
-work
work
=
./work
$<
@
mkdir
-p
$
(
dir
$@
)
&&
touch
$@
work/gate3/.gate3_vhd
:
../files/gate3.vhd ../files/gate.vhdl
vhpcomp
$(VHPCOMP_FLAGS)
-work
work
=
./work
$<
work/gate3_tb/.gate3_tb_v
:
../files/gate3_tb.v
\
work/gate3/.gate3_vhd
vlogcomp
-work
work
=
./work
$(VLOGCOMP_FLAGS)
-i
../files
$<
@
mkdir
-p
$
(
dir
$@
)
&&
touch
$@
...
...
testsuite/060isim_windows/Makefile.ref
View file @
0c404d13
...
...
@@ -39,19 +39,20 @@ fuse:
work\.work
:
(
mkdir
work
&&
type
nul
>>
work
\.
work
&&
echo
work
=
work
>>
xilinxsim.ini
)
||
del /s /q /f work
work/gate
3_tb/.gate3_tb_v
:
../files/gate3_tb.v ../files/gate3.vhd
v
logcomp
-work
work
=
.
\w
ork
$(VLOGCOMP_FLAGS)
-i
../files
$<
work/gate
/.gate_vhdl
:
../files/gate.vhdl
v
hpcomp
$(VHPCOMP_FLAGS)
-work
work
=
.
\w
ork
$<
@
mkdir
$
(
dir
$@
)
&&
type
nul
>>
$@
work/gate/.gate_vhdl
:
../files/gate.vhdl
work/gate3/.gate3_vhd
:
../files/gate3.vhd
\
work/gate/.gate_vhdl
vhpcomp
$(VHPCOMP_FLAGS)
-work
work
=
.
\w
ork
$<
@
mkdir
$
(
dir
$@
)
&&
type
nul
>>
$@
work/gate3/.gate3_vhd
:
../files/gate3.vhd ../files/gate.vhdl
vhpcomp
$(VHPCOMP_FLAGS)
-work
work
=
.
\w
ork
$<
work/gate3_tb/.gate3_tb_v
:
../files/gate3_tb.v
\
work/gate3/.gate3_vhd
vlogcomp
-work
work
=
.
\w
ork
$(VLOGCOMP_FLAGS)
-i
../files
$<
@
mkdir
$
(
dir
$@
)
&&
type
nul
>>
$@
...
...
testsuite/061err_nobin/Makefile.ref
View file @
0c404d13
...
...
@@ -39,19 +39,20 @@ fuse:
work/.work
:
(
mkdir
-p
work
&&
touch
work/.work
&&
echo
work
=
work
>>
xilinxsim.ini
)
||
rm
-rf
work
work/gate
3_tb/.gate3_tb_v
:
../files/gate3_tb.v ../files/gate3.vhd
v
logcomp
-work
work
=
./work
$(VLOGCOMP_FLAGS)
-i
../files
$<
work/gate
/.gate_vhdl
:
../files/gate.vhdl
v
hpcomp
$(VHPCOMP_FLAGS)
-work
work
=
./work
$<
@
mkdir
-p
$
(
dir
$@
)
&&
touch
$@
work/gate/.gate_vhdl
:
../files/gate.vhdl
work/gate3/.gate3_vhd
:
../files/gate3.vhd
\
work/gate/.gate_vhdl
vhpcomp
$(VHPCOMP_FLAGS)
-work
work
=
./work
$<
@
mkdir
-p
$
(
dir
$@
)
&&
touch
$@
work/gate3/.gate3_vhd
:
../files/gate3.vhd ../files/gate.vhdl
vhpcomp
$(VHPCOMP_FLAGS)
-work
work
=
./work
$<
work/gate3_tb/.gate3_tb_v
:
../files/gate3_tb.v
\
work/gate3/.gate3_vhd
vlogcomp
-work
work
=
./work
$(VLOGCOMP_FLAGS)
-i
../files
$<
@
mkdir
-p
$
(
dir
$@
)
&&
touch
$@
...
...
testsuite/097sys_package/Makefile.ref
View file @
0c404d13
...
...
@@ -35,8 +35,7 @@ fuse:
work/.work
:
(
mkdir
-p
work
&&
touch
work/.work
&&
echo
work
=
work
>>
xilinxsim.ini
)
||
rm
-rf
work
work/gate/.gate_vhdl
:
gate.vhdl
work/gate/.gate_vhdl
:
gate.vhdl
vhpcomp
$(VHPCOMP_FLAGS)
-work
work
=
./work
$<
@
mkdir
-p
$
(
dir
$@
)
&&
touch
$@
...
...
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