Commit 24de6c34 authored by Tristan Gingold's avatar Tristan Gingold

tools: use class attribute SIMULATOR_CONTROLS directly.

parent 6d5d5fc0
...@@ -53,7 +53,6 @@ class ToolGHDL(MakefileSim): ...@@ -53,7 +53,6 @@ class ToolGHDL(MakefileSim):
def __init__(self): def __init__(self):
super(ToolGHDL, self).__init__() super(ToolGHDL, self).__init__()
self._simulator_controls.update(ToolGHDL.SIMULATOR_CONTROLS)
def _makefile_sim_options(self): def _makefile_sim_options(self):
"""Print the GHDL options to the Makefile""" """Print the GHDL options to the Makefile"""
...@@ -67,6 +66,6 @@ class ToolGHDL(MakefileSim): ...@@ -67,6 +66,6 @@ class ToolGHDL(MakefileSim):
def _makefile_sim_compilation(self): def _makefile_sim_compilation(self):
"""Print the GDHL simulation compilation target""" """Print the GDHL simulation compilation target"""
self.writeln("simulation: $(VERILOG_OBJ) $(VHDL_OBJ)") self.writeln("simulation: $(VERILOG_OBJ) $(VHDL_OBJ)")
self.writeln("\t\t" + self._simulator_controls['compiler']) self.writeln("\t\t" + self.SIMULATOR_CONTROLS['compiler'])
self.writeln('\n') self.writeln('\n')
self._makefile_sim_dep_files() self._makefile_sim_dep_files()
...@@ -56,12 +56,11 @@ class ToolIVerilog(MakefileSim): ...@@ -56,12 +56,11 @@ class ToolIVerilog(MakefileSim):
def __init__(self): def __init__(self):
super(ToolIVerilog, self).__init__() super(ToolIVerilog, self).__init__()
self._simulator_controls.update(ToolIVerilog.SIMULATOR_CONTROLS)
def _makefile_sim_compilation(self): def _makefile_sim_compilation(self):
"""Generate compile simulation Makefile target for IVerilog""" """Generate compile simulation Makefile target for IVerilog"""
self.writeln("simulation: include_dirs $(VERILOG_OBJ) $(VHDL_OBJ)") self.writeln("simulation: include_dirs $(VERILOG_OBJ) $(VHDL_OBJ)")
self.writeln("\t\t" + self._simulator_controls['compiler']) self.writeln("\t\t" + self.SIMULATOR_CONTROLS['compiler'])
self.writeln() self.writeln()
self.writeln("include_dirs:") self.writeln("include_dirs:")
self.writeln("\t\techo \"# IVerilog command file," self.writeln("\t\techo \"# IVerilog command file,"
......
...@@ -20,10 +20,11 @@ class MakefileSim(ToolMakefile): ...@@ -20,10 +20,11 @@ class MakefileSim(ToolMakefile):
"""Class that provides the Makefile writing methods and status""" """Class that provides the Makefile writing methods and status"""
SIMULATOR_CONTROLS = {}
def __init__(self): def __init__(self):
super(MakefileSim, self).__init__() super(MakefileSim, self).__init__()
self._simulator_controls = {}
def write_makefile(self, config, fileset, filename=None): def write_makefile(self, config, fileset, filename=None):
"""Execute the simulation action""" """Execute the simulation action"""
_check_simulation_manifest(config) _check_simulation_manifest(config)
...@@ -126,7 +127,7 @@ TOP_MODULE := {top_module} ...@@ -126,7 +127,7 @@ TOP_MODULE := {top_module}
command_key = 'vlog' command_key = 'vlog'
if is_include: if is_include:
continue continue
self.writeln("\t\t" + self._simulator_controls[command_key]) self.writeln("\t\t" + self.SIMULATOR_CONTROLS[command_key])
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()
......
...@@ -54,11 +54,10 @@ class ToolVivadoSim(MakefileSim): ...@@ -54,11 +54,10 @@ class ToolVivadoSim(MakefileSim):
def __init__(self): def __init__(self):
super(ToolVivadoSim, self).__init__() super(ToolVivadoSim, self).__init__()
self._simulator_controls.update(ToolVivadoSim.SIMULATOR_CONTROLS)
def _makefile_sim_compilation(self): def _makefile_sim_compilation(self):
"""Generate compile simulation Makefile target for Vivado Simulator""" """Generate compile simulation Makefile target for Vivado Simulator"""
self.writeln("simulation: $(VERILOG_OBJ) $(VHDL_OBJ)") self.writeln("simulation: $(VERILOG_OBJ) $(VHDL_OBJ)")
self.writeln("\t\t" + ToolVivadoSim.SIMULATOR_CONTROLS['compiler']) self.writeln("\t\t" + self.SIMULATOR_CONTROLS['compiler'])
self.writeln() self.writeln()
self._makefile_sim_dep_files() self._makefile_sim_dep_files()
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