Grab standard libs from the selected tool and use them in the solve process

parent 4a0efc02
"""This file is the entry point for the complete HDLMake package"""
...@@ -205,9 +205,6 @@ def _get_parser(): ...@@ -205,9 +205,6 @@ def _get_parser():
dest="reverse", dest="reverse",
default=False, default=False,
action="store_true") action="store_true")
synthesis_proj = subparsers.add_parser(
"project",
help="create/update a project for the appropriated tool")
tree = subparsers.add_parser( tree = subparsers.add_parser(
"tree", "tree",
help="generate a module hierarchy tree") help="generate a module hierarchy tree")
......
...@@ -116,12 +116,12 @@ class Action(list): ...@@ -116,12 +116,12 @@ class Action(list):
logging.debug("End build complete file set") logging.debug("End build complete file set")
return all_manifested_files return all_manifested_files
def build_file_set(self, top_entity=None): def build_file_set(self, top_entity=None, standard_libs=None):
"""Build file set with only those files required by the top entity""" """Build file set with only those files required by the top entity"""
logging.debug("Begin build file set for %s", top_entity) logging.debug("Begin build file set for %s", top_entity)
all_files = self.build_complete_file_set() all_files = self.build_complete_file_set()
if not self._deps_solved: if not self._deps_solved:
dep_solver.solve(all_files) dep_solver.solve(all_files, standard_libs=standard_libs)
self._deps_solved = True self._deps_solved = True
from hdlmake.srcfile import SourceFileSet from hdlmake.srcfile import SourceFileSet
source_files = SourceFileSet() source_files = SourceFileSet()
......
...@@ -79,7 +79,8 @@ class ActionSimulation(Action): ...@@ -79,7 +79,8 @@ class ActionSimulation(Action):
sys.exit("Exiting") sys.exit("Exiting")
logging.info("Generating " + name + " makefile for simulation.") logging.info("Generating " + name + " makefile for simulation.")
top_module = self.get_top_module() top_module = self.get_top_module()
fset = self.build_file_set(top_module.manifest_dict["sim_top"]) fset = self.build_file_set(top_module.manifest_dict["sim_top"],
standard_libs=tool_object.STANDARD_LIBS)
dep_files = fset.filter(DepFile) dep_files = fset.filter(DepFile)
# dep_solver.solve(dep_files) # dep_solver.solve(dep_files)
# tool_object.generate_simulation_makefile(dep_files, top_module) # tool_object.generate_simulation_makefile(dep_files, top_module)
......
...@@ -93,7 +93,8 @@ class ActionSynthesis(Action): ...@@ -93,7 +93,8 @@ class ActionSynthesis(Action):
else: else:
tool_path = "" tool_path = ""
top_mod = self.get_top_module() top_mod = self.get_top_module()
fileset = self.build_file_set(top_mod.manifest_dict["syn_top"]) fileset = self.build_file_set(top_mod.manifest_dict["syn_top"],
standard_libs=tool_object.STANDARD_LIBS)
sup_files = self.build_complete_file_set() sup_files = self.build_complete_file_set()
privative_files = [] privative_files = []
for file_aux in sup_files: for file_aux in sup_files:
......
...@@ -40,7 +40,7 @@ class DepParser(object): ...@@ -40,7 +40,7 @@ class DepParser(object):
"""Base dummy interface method for the HDL parse execution""" """Base dummy interface method for the HDL parse execution"""
raise raise
def solve(fileset): def solve(fileset, standard_libs=None):
"""Function that Parses and Solves the provided HDL fileset. Note """Function that Parses and Solves the provided HDL fileset. Note
that it doesn't return a new fileset, but modifies the original one""" that it doesn't return a new fileset, but modifies the original one"""
from .srcfile import SourceFileSet from .srcfile import SourceFileSet
...@@ -79,10 +79,20 @@ def solve(fileset): ...@@ -79,10 +79,20 @@ def solve(fileset):
'\n'.join([file_aux.path for '\n'.join([file_aux.path for
file_aux in list(satisfied_by)])) file_aux in list(satisfied_by)]))
elif len(satisfied_by) == 0: elif len(satisfied_by) == 0:
logging.warning( # if relation is a USE PACKAGE, check against provided standard dlibs
"Relation %s in %s not satisfied by any source file", required_lib = rel.obj_name.split('.')[0]
str(rel), investigated_file.name) if (not standard_libs is None and
not_satisfied += 1 required_lib in standard_libs and
rel.direction is DepRelation.USE and
rel.rel_type is DepRelation.PACKAGE):
logging.debug("Not satisfied relation %s in %s will be covered "
"by the target compiler standard libs.",
str(rel), investigated_file.name )
else:
logging.warning(
"Relation %s in %s not satisfied by any source file",
str(rel), investigated_file.name)
not_satisfied += 1
logging.debug("SOLVE END") logging.debug("SOLVE END")
if not_satisfied != 0: if not_satisfied != 0:
logging.warning( logging.warning(
...@@ -90,7 +100,7 @@ def solve(fileset): ...@@ -90,7 +100,7 @@ def solve(fileset):
not_satisfied) not_satisfied)
else: else:
logging.info( logging.info(
"Dependencies solved, all of the relations weres satisfied!") "Dependencies solved, all of the relations were satisfied!")
def make_dependency_sorted_list(fileset, reverse=False): def make_dependency_sorted_list(fileset, reverse=False):
......
...@@ -37,6 +37,8 @@ class ToolActiveHDL(ToolSim): ...@@ -37,6 +37,8 @@ class ToolActiveHDL(ToolSim):
'windows_bin': 'vsimsa', 'windows_bin': 'vsimsa',
'linux_bin': None} 'linux_bin': None}
STANDARD_LIBS = ['ieee', 'std']
HDL_FILES = [VHDLFile, VerilogFile, SVFile] HDL_FILES = [VHDLFile, VerilogFile, SVFile]
CLEAN_TARGETS = {'clean': ["run.command", "library.cfg", "work"], CLEAN_TARGETS = {'clean': ["run.command", "library.cfg", "work"],
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
from .make_syn import ToolSyn from .make_syn import ToolSyn
from hdlmake.srcfile import EDFFile, LPFFile, VHDLFile, VerilogFile from hdlmake.srcfile import EDFFile, LPFFile, VHDLFile, VerilogFile
DIAMOND_STANDARD_LIBS = ['ieee', 'std']
class ToolDiamond(ToolSyn): class ToolDiamond(ToolSyn):
...@@ -43,6 +41,8 @@ class ToolDiamond(ToolSyn): ...@@ -43,6 +41,8 @@ class ToolDiamond(ToolSyn):
SUPPORTED_FILES = [EDFFile, LPFFile] SUPPORTED_FILES = [EDFFile, LPFFile]
STANDARD_LIBS = ['ieee', 'std']
HDL_FILES = [VHDLFile, VerilogFile] HDL_FILES = [VHDLFile, VerilogFile]
CLEAN_TARGETS = {'clean': ["*.sty", "$(PROJECT)", "run.tcl"], CLEAN_TARGETS = {'clean': ["*.sty", "$(PROJECT)", "run.tcl"],
......
...@@ -28,8 +28,6 @@ import string ...@@ -28,8 +28,6 @@ import string
from .make_sim import ToolSim from .make_sim import ToolSim
from hdlmake.srcfile import VHDLFile from hdlmake.srcfile import VHDLFile
GHDL_STANDARD_LIBS = ['ieee', 'std']
class ToolGHDL(ToolSim): class ToolGHDL(ToolSim):
...@@ -41,6 +39,8 @@ class ToolGHDL(ToolSim): ...@@ -41,6 +39,8 @@ class ToolGHDL(ToolSim):
'windows_bin': 'ghdl', 'windows_bin': 'ghdl',
'linux_bin': 'ghdl'} 'linux_bin': 'ghdl'}
STANDARD_LIBS = ['ieee', 'std']
HDL_FILES = [VHDLFile] HDL_FILES = [VHDLFile]
CLEAN_TARGETS = {'clean': ["*.cf", "*.o", "$(TOP_MODULE)"], CLEAN_TARGETS = {'clean': ["*.cf", "*.o", "$(TOP_MODULE)"],
......
...@@ -57,6 +57,10 @@ class ToolISE(ToolSyn): ...@@ -57,6 +57,10 @@ class ToolISE(ToolSyn):
'linux_bin': 'xtclsh ', 'linux_bin': 'xtclsh ',
'project_ext': 'xise'} 'project_ext': 'xise'}
STANDARD_LIBS = ['ieee', 'ieee_proposed', 'iSE', 'simprims', 'std',
'synopsys', 'unimacro', 'unisim', 'XilinxCoreLib']
SUPPORTED_FILES = [UCFFile, CDCFile, NGCFile] SUPPORTED_FILES = [UCFFile, CDCFile, NGCFile]
HDL_FILES = [VHDLFile, VerilogFile, SVFile] HDL_FILES = [VHDLFile, VerilogFile, SVFile]
......
...@@ -35,13 +35,6 @@ from hdlmake.util import path as path_mod ...@@ -35,13 +35,6 @@ from hdlmake.util import path as path_mod
from hdlmake.srcfile import VerilogFile, VHDLFile from hdlmake.srcfile import VerilogFile, VHDLFile
ISIM_STANDARD_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
'simprim', 'unisim', 'unimacro', 'aim', 'cpld',
'pls', 'xilinxcorelib', 'aim_ver', 'cpld_ver',
'simprims_ver', 'unisims_ver', 'uni9000_ver',
'unimacro_ver', 'xilinxcorelib_ver', 'secureip']
class ToolISim(ToolSim): class ToolISim(ToolSim):
"""Class providing the interface for Xilinx ISim simulator""" """Class providing the interface for Xilinx ISim simulator"""
...@@ -52,6 +45,12 @@ class ToolISim(ToolSim): ...@@ -52,6 +45,12 @@ class ToolISim(ToolSim):
'windows_bin': 'isimgui', 'windows_bin': 'isimgui',
'linux_bin': 'isimgui'} 'linux_bin': 'isimgui'}
STANDARD_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
'simprim', 'unisim', 'unimacro', 'aim', 'cpld',
'pls', 'xilinxcorelib', 'aim_ver', 'cpld_ver',
'simprims_ver', 'unisims_ver', 'uni9000_ver',
'unimacro_ver', 'xilinxcorelib_ver', 'secureip']
HDL_FILES = [VerilogFile, VHDLFile] HDL_FILES = [VerilogFile, VHDLFile]
CLEAN_TARGETS = {'clean': ["./xilinxsim.ini $(LIBS)", "fuse.xmsgs", CLEAN_TARGETS = {'clean': ["./xilinxsim.ini $(LIBS)", "fuse.xmsgs",
......
...@@ -29,13 +29,6 @@ from .make_sim import ToolSim ...@@ -29,13 +29,6 @@ from .make_sim import ToolSim
from hdlmake.srcfile import VerilogFile, VHDLFile, SVFile from hdlmake.srcfile import VerilogFile, VHDLFile, SVFile
IVERILOG_STANDARD_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
'simprim', 'unisim', 'unimacro', 'aim', 'cpld',
'pls', 'xilinxcorelib', 'aim_ver', 'cpld_ver',
'simprims_ver', 'unisims_ver', 'uni9000_ver',
'unimacro_ver', 'xilinxcorelib_ver', 'secureip']
class ToolIVerilog(ToolSim): class ToolIVerilog(ToolSim):
"""Class providing the interface for Icarus Verilog simulator""" """Class providing the interface for Icarus Verilog simulator"""
...@@ -46,6 +39,12 @@ class ToolIVerilog(ToolSim): ...@@ -46,6 +39,12 @@ class ToolIVerilog(ToolSim):
'windows_bin': 'iverilog', 'windows_bin': 'iverilog',
'linux_bin': 'iverilog'} 'linux_bin': 'iverilog'}
STANDARD_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
'simprim', 'unisim', 'unimacro', 'aim', 'cpld',
'pls', 'xilinxcorelib', 'aim_ver', 'cpld_ver',
'simprims_ver', 'unisims_ver', 'uni9000_ver',
'unimacro_ver', 'xilinxcorelib_ver', 'secureip']
HDL_FILES = [VerilogFile, VHDLFile, SVFile] HDL_FILES = [VerilogFile, VHDLFile, SVFile]
CLEAN_TARGETS = {'clean': ["run.command", "ivl_vhdl_work"], CLEAN_TARGETS = {'clean': ["run.command", "ivl_vhdl_work"],
......
...@@ -28,9 +28,6 @@ from .make_syn import ToolSyn ...@@ -28,9 +28,6 @@ from .make_syn import ToolSyn
from hdlmake.srcfile import VHDLFile, VerilogFile, SDCFile, PDCFile from hdlmake.srcfile import VHDLFile, VerilogFile, SDCFile, PDCFile
LIBERO_STANDARD_LIBS = ['ieee', 'std']
class ToolLibero(ToolSyn): class ToolLibero(ToolSyn):
"""Class providing the interface for Microsemi Libero IDE synthesis""" """Class providing the interface for Microsemi Libero IDE synthesis"""
...@@ -42,6 +39,8 @@ class ToolLibero(ToolSyn): ...@@ -42,6 +39,8 @@ class ToolLibero(ToolSyn):
'linux_bin': 'libero SCRIPT:', 'linux_bin': 'libero SCRIPT:',
'project_ext': 'prjx'} 'project_ext': 'prjx'}
STANDARD_LIBS = ['ieee', 'std']
SUPPORTED_FILES = [SDCFile, PDCFile] SUPPORTED_FILES = [SDCFile, PDCFile]
HDL_FILES = [VHDLFile, VerilogFile] HDL_FILES = [VHDLFile, VerilogFile]
......
...@@ -29,9 +29,6 @@ import os ...@@ -29,9 +29,6 @@ import os
from .sim_makefile_support import VsimMakefileWriter from .sim_makefile_support import VsimMakefileWriter
MODELSIM_STANDARD_LIBS = ['ieee', 'std', 'altera_mf']
class ToolModelsim(VsimMakefileWriter): class ToolModelsim(VsimMakefileWriter):
"""Class providing the interface for Mentor Modelsim simulator""" """Class providing the interface for Mentor Modelsim simulator"""
...@@ -41,6 +38,8 @@ class ToolModelsim(VsimMakefileWriter): ...@@ -41,6 +38,8 @@ class ToolModelsim(VsimMakefileWriter):
'windows_bin': 'vsim', 'windows_bin': 'vsim',
'linux_bin': 'vsim'} 'linux_bin': 'vsim'}
STANDARD_LIBS = ['ieee', 'std', 'altera_mf']
CLEAN_TARGETS = {'clean': ["./modelsim.ini", "transcript"], CLEAN_TARGETS = {'clean': ["./modelsim.ini", "transcript"],
'mrproper': ["*.vcd", "*.wlf"]} 'mrproper': ["*.vcd", "*.wlf"]}
......
...@@ -27,9 +27,6 @@ from .xilinx import ToolXilinx ...@@ -27,9 +27,6 @@ from .xilinx import ToolXilinx
from hdlmake.srcfile import (UCFFile, NGCFile, XMPFile, XCOFile) from hdlmake.srcfile import (UCFFile, NGCFile, XMPFile, XCOFile)
PLANAHEAD_STANDARD_LIBS = ['ieee', 'std']
class ToolPlanAhead(ToolXilinx): class ToolPlanAhead(ToolXilinx):
"""Class providing the interface for Xilinx PlanAhead synthesis""" """Class providing the interface for Xilinx PlanAhead synthesis"""
...@@ -41,6 +38,9 @@ class ToolPlanAhead(ToolXilinx): ...@@ -41,6 +38,9 @@ class ToolPlanAhead(ToolXilinx):
'linux_bin': 'planAhead -mode tcl -source ', 'linux_bin': 'planAhead -mode tcl -source ',
'project_ext': 'ppr'} 'project_ext': 'ppr'}
STANDARD_LIBS = ['ieee', 'ieee_proposed', 'simprims', 'std',
'synopsys', 'unimacro', 'unisim', 'XilinxCoreLib']
SUPPORTED_FILES = [UCFFile, NGCFile, XMPFile, XCOFile] SUPPORTED_FILES = [UCFFile, NGCFile, XMPFile, XCOFile]
CLEAN_TARGETS = {'clean': ["planAhead_*", "planAhead.*", "run.tcl", CLEAN_TARGETS = {'clean': ["planAhead_*", "planAhead.*", "run.tcl",
......
...@@ -34,9 +34,6 @@ from hdlmake.srcfile import (VHDLFile, VerilogFile, SVFile, ...@@ -34,9 +34,6 @@ from hdlmake.srcfile import (VHDLFile, VerilogFile, SVFile,
QSFFile, BSFFile, BDFFile, TDFFile, GDFFile) QSFFile, BSFFile, BDFFile, TDFFile, GDFFile)
QUARTUS_STANDARD_LIBS = ['altera', 'altera_mf', 'lpm', 'ieee', 'std']
class ToolQuartus(ToolSyn): class ToolQuartus(ToolSyn):
"""Class providing the interface for Altera Quartus synthesis""" """Class providing the interface for Altera Quartus synthesis"""
...@@ -48,6 +45,8 @@ class ToolQuartus(ToolSyn): ...@@ -48,6 +45,8 @@ class ToolQuartus(ToolSyn):
'linux_bin': 'quartus -t ', 'linux_bin': 'quartus -t ',
'project_ext': 'qsf'} 'project_ext': 'qsf'}
STANDARD_LIBS = ['altera', 'altera_mf', 'lpm', 'ieee', 'std']
SUPPORTED_FILES = [SignalTapFile, SDCFile, QIPFile, QSYSFile, DPFFile, SUPPORTED_FILES = [SignalTapFile, SDCFile, QIPFile, QSYSFile, DPFFile,
QSFFile, BSFFile, BDFFile, TDFFile, GDFFile] QSFFile, BSFFile, BDFFile, TDFFile, GDFFile]
......
...@@ -72,6 +72,8 @@ class ToolRiviera(VsimMakefileWriter): ...@@ -72,6 +72,8 @@ class ToolRiviera(VsimMakefileWriter):
'windows_bin': 'vsim', 'windows_bin': 'vsim',
'linux_bin': 'vsim'} 'linux_bin': 'vsim'}
STANDARD_LIBS = RIVIERA_STANDARD_LIBS
CLEAN_TARGETS = {'clean': ["*.asdb"], CLEAN_TARGETS = {'clean': ["*.asdb"],
'mrproper': ["*.vcd"]} 'mrproper': ["*.vcd"]}
......
...@@ -29,9 +29,6 @@ from hdlmake.srcfile import (UCFFile, NGCFile, XMPFile, ...@@ -29,9 +29,6 @@ from hdlmake.srcfile import (UCFFile, NGCFile, XMPFile,
XCOFile, BDFile, TCLFile) XCOFile, BDFile, TCLFile)
VIVADO_STANDARD_LIBS = ['ieee', 'std']
class ToolVivado(ToolXilinx): class ToolVivado(ToolXilinx):
"""Class providing the interface for Xilinx Vivado synthesis""" """Class providing the interface for Xilinx Vivado synthesis"""
...@@ -44,6 +41,8 @@ class ToolVivado(ToolXilinx): ...@@ -44,6 +41,8 @@ class ToolVivado(ToolXilinx):
'project_ext': 'xpr' 'project_ext': 'xpr'
} }
STANDARD_LIBS = ['ieee', 'std']
SUPPORTED_FILES = [UCFFile, NGCFile, XMPFile, SUPPORTED_FILES = [UCFFile, NGCFile, XMPFile,
XCOFile, BDFile, TCLFile] XCOFile, BDFile, TCLFile]
......
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