Commit 19a0d8a1 authored by Tristan Gingold's avatar Tristan Gingold

ghdl: support library.

parent 568a579a
......@@ -48,7 +48,7 @@ class ToolGHDL(MakefileSim):
'mrproper': ["*.vcd"]}
SIMULATOR_CONTROLS = {'vlog': None,
'vhdl': '$(GHDL) -a $(GHDL_OPT) $<',
'vhdl': '$(GHDL) -a --work={work} $(GHDL_OPT) $<',
'compiler': '$(GHDL) -e $(GHDL_OPT) $(TOP_MODULE)'}
def __init__(self):
......@@ -56,12 +56,9 @@ class ToolGHDL(MakefileSim):
def _makefile_sim_options(self):
"""Print the GHDL options to the Makefile"""
self.writeln("GHDL := ghdl")
ghdl_opt = self.manifest_dict.get("ghdl_opt", '')
ghdl_string = string.Template(
"GHDL := ghdl\n"
"GHDL_OPT := ${ghdl_opt}\n")
self.writeln(ghdl_string.substitute(
ghdl_opt=ghdl_opt))
self.writeln("GHDL_OPT := {ghdl_opt}\n".format(ghdl_opt=ghdl_opt))
def _makefile_sim_compilation(self):
"""Print the GDHL simulation compilation target"""
......
......@@ -113,7 +113,7 @@ TOP_MODULE := {top_module}
command_key = 'vhdl'
elif isinstance(file_aux, VerilogFile):
command_key = 'vlog'
self.writeln("\t\t" + self.SIMULATOR_CONTROLS[command_key])
self.writeln("\t\t" + self.SIMULATOR_CONTROLS[command_key].format(work=file_aux.library))
self.write("\t\t@" + shell.mkdir_command() + " $(dir $@)")
self.writeln(" && " + shell.touch_command() + " $@ \n")
self.writeln()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment