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

ghdl: support library.

parent 568a579a
...@@ -48,7 +48,7 @@ class ToolGHDL(MakefileSim): ...@@ -48,7 +48,7 @@ class ToolGHDL(MakefileSim):
'mrproper': ["*.vcd"]} 'mrproper': ["*.vcd"]}
SIMULATOR_CONTROLS = {'vlog': None, SIMULATOR_CONTROLS = {'vlog': None,
'vhdl': '$(GHDL) -a $(GHDL_OPT) $<', 'vhdl': '$(GHDL) -a --work={work} $(GHDL_OPT) $<',
'compiler': '$(GHDL) -e $(GHDL_OPT) $(TOP_MODULE)'} 'compiler': '$(GHDL) -e $(GHDL_OPT) $(TOP_MODULE)'}
def __init__(self): def __init__(self):
...@@ -56,12 +56,9 @@ class ToolGHDL(MakefileSim): ...@@ -56,12 +56,9 @@ class ToolGHDL(MakefileSim):
def _makefile_sim_options(self): def _makefile_sim_options(self):
"""Print the GHDL options to the Makefile""" """Print the GHDL options to the Makefile"""
self.writeln("GHDL := ghdl")
ghdl_opt = self.manifest_dict.get("ghdl_opt", '') ghdl_opt = self.manifest_dict.get("ghdl_opt", '')
ghdl_string = string.Template( self.writeln("GHDL_OPT := {ghdl_opt}\n".format(ghdl_opt=ghdl_opt))
"GHDL := ghdl\n"
"GHDL_OPT := ${ghdl_opt}\n")
self.writeln(ghdl_string.substitute(
ghdl_opt=ghdl_opt))
def _makefile_sim_compilation(self): def _makefile_sim_compilation(self):
"""Print the GDHL simulation compilation target""" """Print the GDHL simulation compilation target"""
......
...@@ -113,7 +113,7 @@ TOP_MODULE := {top_module} ...@@ -113,7 +113,7 @@ TOP_MODULE := {top_module}
command_key = 'vhdl' command_key = 'vhdl'
elif isinstance(file_aux, VerilogFile): elif isinstance(file_aux, VerilogFile):
command_key = 'vlog' 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.write("\t\t@" + shell.mkdir_command() + " $(dir $@)")
self.writeln(" && " + shell.touch_command() + " $@ \n") self.writeln(" && " + shell.touch_command() + " $@ \n")
self.writeln() 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