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
0f094cc6
Commit
0f094cc6
authored
Jan 16, 2024
by
Augusto Fraga Giachero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support to NVC simulator
parent
f41e6a57
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
0 deletions
+133
-0
load_tool.py
hdlmake/tools/load_tool.py
+2
-0
nvc.py
hdlmake/tools/nvc.py
+70
-0
Makefile.ref
testsuite/128nvc/Makefile.ref
+53
-0
Manifest.py
testsuite/128nvc/Manifest.py
+8
-0
No files found.
hdlmake/tools/load_tool.py
View file @
0f094cc6
...
...
@@ -41,6 +41,7 @@ def load_sim_tool(tool_name):
from
.active_hdl
import
ToolActiveHDL
from
.riviera
import
ToolRiviera
from
.ghdl
import
ToolGHDL
from
.nvc
import
ToolNVC
from
.vivado_sim
import
ToolVivadoSim
available_tools
=
{
'iverilog'
:
ToolIVerilog
,
'isim'
:
ToolISim
,
...
...
@@ -48,6 +49,7 @@ def load_sim_tool(tool_name):
'active_hdl'
:
ToolActiveHDL
,
'riviera'
:
ToolRiviera
,
'ghdl'
:
ToolGHDL
,
'nvc'
:
ToolNVC
,
'vivado_sim'
:
ToolVivadoSim
}
if
tool_name
in
available_tools
:
logging
.
debug
(
"Simulation tool to be used found:
%
s"
,
tool_name
)
...
...
hdlmake/tools/nvc.py
0 → 100644
View file @
0f094cc6
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 - 2015 CERN, 2023 CNPEM
# Authors: Pawel Szostek (pawel.szostek@cern.ch), Augusto Fraga Giachero (augusto.fraga@lnls.br)
# Multi-tool support by Javier D. Garcia-Lasheras (javier@garcialasheras.com)
#
# This file is part of Hdlmake.
#
# Hdlmake is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Hdlmake is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Hdlmake. If not, see <http://www.gnu.org/licenses/>.
#
"""Module providing support for NVC simulator"""
from
__future__
import
absolute_import
import
string
from
.makefilesim
import
MakefileSim
from
..sourcefiles.srcfile
import
VHDLFile
class
ToolNVC
(
MakefileSim
):
"""Class providing the interface for NVC simulator"""
TOOL_INFO
=
{
'name'
:
'NVC'
,
'id'
:
'nvc'
,
'windows_bin'
:
'nvc'
,
'linux_bin'
:
'nvc'
}
STANDARD_LIBS
=
[
'ieee'
,
'std'
]
HDL_FILES
=
{
VHDLFile
:
''
}
CLEAN_TARGETS
=
{
'clean'
:
[
"*.cf"
,
"*.o"
,
"$(TOP_MODULE)"
,
"work"
],
'mrproper'
:
[
"*.vcd"
]}
SIMULATOR_CONTROLS
=
{
'vlog'
:
None
,
'vhdl'
:
'$(NVC) --work={work} $(NVC_OPT) -a $<'
,
'compiler'
:
'$(NVC) $(NVC_OPT) -e $(TOP_MODULE)'
}
def
__init__
(
self
):
super
(
ToolNVC
,
self
)
.
__init__
()
def
_makefile_sim_options
(
self
):
"""Print the NVC options to the Makefile"""
self
.
writeln
(
"NVC := nvc"
)
nvc_opt
=
self
.
manifest_dict
.
get
(
"nvc_opt"
,
''
)
self
.
writeln
(
"NVC_OPT := {nvc_opt}
\n
"
.
format
(
nvc_opt
=
nvc_opt
))
def
_makefile_sim_compilation
(
self
):
"""Print the NVC simulation compilation target"""
libs
=
self
.
get_all_libs
()
self
.
_makefile_sim_libs_variables
(
libs
)
self
.
writeln
(
"simulation: $(VERILOG_OBJ) $(VHDL_OBJ)"
)
self
.
writeln
(
"
\t\t
"
+
self
.
SIMULATOR_CONTROLS
[
'compiler'
])
self
.
writeln
(
'
\n
'
)
self
.
_makefile_sim_dep_files
()
testsuite/128nvc/Makefile.ref
0 → 100644
View file @
0f094cc6
########################################
# This file was generated by hdlmake #
# http://ohwr.org/projects/hdl-make/ #
########################################
TOP_MODULE
:=
gate3
NVC
:=
nvc
NVC_OPT
:=
--std
=
2008
#target for performing local simulation
local
:
sim_pre_cmd simulation sim_post_cmd
VERILOG_SRC
:=
VERILOG_OBJ
:=
VHDL_SRC
:=
../files/gate.vhdl
\
../files/gate3.vhd
\
VHDL_OBJ
:=
work/gate/.gate_vhdl
\
work/gate3/.gate3_vhd
\
LIBS
:=
work
LIB_IND
:=
work/.work
simulation
:
$(VERILOG_OBJ) $(VHDL_OBJ)
$(NVC)
$(NVC_OPT)
-e
$(TOP_MODULE)
work/gate/.gate_vhdl
:
../files/gate.vhdl
$(NVC)
--work
=
work
$(NVC_OPT)
-a
$<
@
mkdir
-p
$
(
dir
$@
)
&&
touch
$@
work/gate3/.gate3_vhd
:
../files/gate3.vhd
\
work/gate/.gate_vhdl
$(NVC)
--work
=
work
$(NVC_OPT)
-a
$<
@
mkdir
-p
$
(
dir
$@
)
&&
touch
$@
# USER SIM COMMANDS
sim_pre_cmd
:
sim_post_cmd
:
CLEAN_TARGETS
:=
$(LIBS)
*
.cf
*
.o
$(TOP_MODULE)
work
clean
:
rm
-rf
$(CLEAN_TARGETS)
mrproper
:
clean
rm
-rf
*
.vcd
.PHONY
:
mrproper clean sim_pre_cmd sim_post_cmd simulation
testsuite/128nvc/Manifest.py
0 → 100644
View file @
0f094cc6
action
=
"simulation"
sim_tool
=
"nvc"
nvc_opt
=
"--std=2008"
top_module
=
"gate3"
files
=
[
"../files/gate3.vhd"
,
"../files/gate.vhdl"
]
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