Introduction
This page is intented to serve as an entry point map to those interested in working and collaborating in the development of the HDLMake tool. In order to do so, we have generated some diagrams for the Python source code by using the Pyreverse tool included in the Pylint package.
Note: The diagrams and source code links in this page are extracted from HDLMake 3.2 version.
Global overview
Full class diagram
Full package diagram
The module pool
The main information structure in HDLMake is the module_pool class, acting as the container for the HDLMake modules that are progressively being added to the design hierarchy.
In order to process and work with the modules it contains, the module_pool class inherits the classes that are in charge of executing the requested commands and actions for the tool:
- ActionCore includes the main methods for the most important command line actions for HDLMake, such as:
- ActionTree contain the functionality to create directed graphs depicting the module pool structure at both module and file levels.
-
Action is the base class that contains the internal methods used to execute the requested actions, e.g.:
- new_module adds a new module to the pool.
- build_complete_file_set creates a fileset with all of the files listed by all of the modules in the pool.
- solve_file_set builds a fileset with only those files required by the top entity.
Module Class Diagram
Module Package Diagram
The source files
In the HDLMake tool, we have two big families of supported files:
- Those HDL files that can be parsed and scanned for dependencies between them.
- Those supported files that cannot be parsed, so that we cannot generate dependencies.
All of the file types supported ultimately belongs to the File class, being the base class for all of them.
In order to support dependencies, the HDL Files inherit from the DepFile class, that makes use of the DepRelation class to create a instance for each of the relations found by the specific HDL parsers. Note that they do not inherit directly, but making use of the intermediate SourceFile class, allowing them to host extra information about its content. These HDL file types are:
- VHDL file, that makes use of the VHDLParser.
- Verilog file, that makes use of the VerilogParser and its associated VerilogPreprocessor
- SystemVerilog/SV file, that inherits from Verilog file class.
If we want to add new supported file type to HDLMake, one that is not parseable, we need to add a new file class to one the following sections (note that smaller sections and tool-independent formats could be find/added too):
Then, we need to modify the create_source_file function accordingly so that HDLMake understand will be able to understand the file type by its extension. After doing this, the different tools will be able to include the new filetype if required.
Source File class Diagram
Source File Dackage Diagram
The tool hierarchy
The tools hierarchy in HDLMake has been designed to support a huge number of simulation and synthesis programs and, at the same time, to be able of expanding the available tools with minimal modifications.
The base class for all of the tools is ToolMakefile, which includes the common methods and variables for writing Makefiles targeted to both synthesis and simulation tools.
The synthesis tools inherit the ToolSyn class, that includes the sequence of methods that will be executed to write a synthesis Makefile.
The simulation tools inherit the ToolSim class, that includes the sequence of methods that will be executed to write a simulation Makefile.
When a tool inherits its corresponding synthesis or simulation classes, what it's actually doing is:
- Fill and expand the variables in the base ToolMakefile class, so that this will be used by the common methods to write the Makefile.
- Override those methods in the hierarchy that don't fit the tool with its own tool-specific methods.
When some of the tools share methods or variables between them but not with the other tools, we can add an extra intermediate layer containing the common stuff, e.g.:
- Simulation: ToolModelsim and ToolRiviera get their shared content from VsimMakefileWriter
- Synthesis: ToolVivado and ToolPlanAhead get their shared content from ToolXilinx.