Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions edalize/modelsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ def _write_build_rtl_tcl_file(self, tcl_main):
args = ["-93"]
if f.file_type.endswith("-2008"):
args = ["-2008"]
if f.file_type.endswith("-2019"):
args = ["-2019"]
else:
args = []

Expand Down
10 changes: 9 additions & 1 deletion edalize/quartus.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,15 @@ def configure_main(self):
self.jinja_env.filters["src_file_filter"] = self.src_file_filter
self.jinja_env.filters["qsys_file_filter"] = self.qsys_file_filter

#Check VHDL version
has_vhdl2008 = "vhdlSource-2008" in [x.file_type for x in src_files]
has_vhdl2019 = "vhdlSource-2019" in [x.file_type for x in src_files]
#Use latest version
if has_vhdl2019:
template_update = {'has_vhdl2019': has_vhdl2019}
else:
template_update = {'has_vhdl2008': has_vhdl2008}

has_qsys = "QSYS" in [x.file_type for x in src_files]

escaped_name = self.name.replace(".", "_")
Expand All @@ -155,8 +163,8 @@ def configure_main(self):
"vlogparam": self.vlogparam,
"vlogdefine": self.vlogdefine,
"generic": self.generic,
"has_vhdl2008": has_vhdl2008,
}
template_vars.update(template_update)

# Render Makefile based on detected version
self.render_template(
Expand Down
6 changes: 4 additions & 2 deletions edalize/rivierapro.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ def _write_build_rtl_tcl_file(self, tcl_main):
cmd = "vcom"
if f.file_type.endswith("-87"):
args = ["-87"]
if f.file_type.endswith("-93"):
elif f.file_type.endswith("-93"):
args = ["-93"]
if f.file_type.endswith("-2008"):
elif f.file_type.endswith("-2008"):
args = ["-2008"]
elif f.file_type.endswith("-2019"):
args = ["-2019"]
else:
args = []
elif f.file_type == "tclSource":
Expand Down
4 changes: 4 additions & 0 deletions edalize/templates/vivado/vivado-project.tcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ set_property board_part {{ tool_options.board_part }} [current_project]
set_param project.enableVHDL2008 1
{%- endif %}

{% if has_vhdl2019 -%}
set_param project.enableVHDL2019 1
{%- endif %}

{% if vlogparam -%}
set_property generic {
{%- for k, v in vlogparam.items() %}{{ k }}={{ v|param_value_str }} {% endfor -%}
Expand Down
5 changes: 5 additions & 0 deletions edalize/tools/templates/vivado/vivado-project.tcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ set_property board_part {{ tool_options.board_part }} [current_project]
set_param project.enableVHDL2008 1
{%- endif %}

{% if has_vhdl2019 -%}
#Default since Vivado 2016.1
set_param project.enableVHDL2019 1
{%- endif %}

{% if vlogparam -%}
set_property generic {
{%- for k, v in vlogparam.items() %}{{ k }}={{ v|param_value_str }} {% endfor -%}
Expand Down
10 changes: 9 additions & 1 deletion edalize/tools/vivado.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def setup(self, edam):
incdirs = []
edif_files = []
has_vhdl2008 = False
has_vhdl2019 = False
has_xci = False
unused_files = []
bd_files = []
Expand All @@ -127,6 +128,9 @@ def setup(self, edam):
if file_type == "vhdlSource-2008":
has_vhdl2008 = True
cmd += " -vhdl2008"
if file_type == "vhdlSource-2019":
has_vhdl2019 = True
cmd += " -vhdl2019"
if f.get("logical_name"):
cmd += " -library " + f["logical_name"]
elif file_type == "xci":
Expand Down Expand Up @@ -170,6 +174,10 @@ def setup(self, edam):
}
)

if has_vhdl2019:
template_update = {'has_vhdl2019': has_vhdl2019}
else:
template_update = {'has_vhdl2008': has_vhdl2008}
self.template_vars = {
"name": self.name,
"src_files": "\n".join(src_files + sim_files),
Expand All @@ -180,10 +188,10 @@ def setup(self, edam):
"vlogdefine": self.vlogdefine,
"generic": self.generic,
"netlist_flow": netlist_flow,
"has_vhdl2008": has_vhdl2008,
"has_xci": has_xci,
"bd_files": bd_files,
}
self.template_vars.update(template_update)
jobs = self.tool_options.get("jobs", None)

self.run_template_vars = {
Expand Down
1 change: 1 addition & 0 deletions tests/edalize_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def _setup_backend(
{"name": "vhdl_file.vhd", "file_type": "vhdlSource"},
{"name": "vhdl_lfile", "file_type": "vhdlSource", "logical_name": "libx"},
{"name": "vhdl2008_file", "file_type": "vhdlSource-2008"},
{"name": "vhdl2019_file", "file_type": "vhdlSource-2019"},
{"name": "xci_file.xci", "file_type": "xci"},
{"name": "xdc_file.xdc", "file_type": "xdc"},
{"name": "bootrom.mem", "file_type": "mem"},
Expand Down
1 change: 1 addition & 0 deletions tests/test_rivierapro/edalize_build_rtl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ vcom -quiet -work work vhdl_file.vhd
vlib libx
vcom -quiet -work libx vhdl_lfile
vcom -2008 -quiet -work work vhdl2008_file
vcom -2019 -quiet -work work vhdl2019_file
vlog some vlog_options -sv +define+vlogdefine_bool=1 +define+vlogdefine_int=42 +define+vlogdefine_str=hello +incdir+. -quiet -work work another_sv_file.sv