chiptools.common.filetypes module
- class chiptools.common.filetypes.Constraints(**kwargs)[source]
Bases:
object
The constraints object provides a container for constraints files
- class chiptools.common.filetypes.File(library, **kwargs)[source]
Bases:
object
The File object contains properties of a design source file that has been loaded from the project XML file.
- class chiptools.common.filetypes.FileType(value)
Bases:
enum.Enum
An enumeration.
- NGCNetlist = 5
- Python = 9
- SDC = 8
- SystemVerilog = 4
- TCL = 6
- UCF = 7
- Unknown = 1
- VHDL = 2
- Verilog = 3
- VivadoIp = 10
- VivadoXDC = 11
- class chiptools.common.filetypes.ProjectAttributes[source]
Bases:
object
- ATTRIBUTE_FLOW = 'flow'
- ATTRIBUTE_LIBRARY = 'library'
- ATTRIBUTE_NAME = 'name'
- ATTRIBUTE_PATH = 'path'
- ATTRIBUTE_PREPROCESSOR = 'preprocessor'
- ATTRIBUTE_REPORTER = 'reporter'
- ATTRIBUTE_SIM_DIR = 'simulation_directory'
- ATTRIBUTE_SIM_TOOL = 'simulator'
- ATTRIBUTE_SYNTHESIS = 'synthesise'
- ATTRIBUTE_SYNTH_DIR = 'synthesis_directory'
- ATTRIBUTE_SYNTH_PART = 'part'
- ATTRIBUTE_SYNTH_TOOL = 'synthesiser'
- CONSTRAINTS_NODE_DEFAULTS = {'flow': None, 'path': None}
- FILE_NODE_DEFAULTS = {'path': None, 'preprocessor': None, 'synthesise': None}
- LIBRARY_NODE_DEFAULTS = {'name': None, 'synthesise': None}
- NODE_PROCESSOR = {'library': <function ProjectAttributes.string_tolower>, 'part': <function ProjectAttributes.<lambda>>, 'path': <function relative_path_to_abs>, 'preprocessor': <function relative_path_to_abs>, 'reporter': <function relative_path_to_abs>, 'simulation_directory': <function relative_path_to_abs>, 'simulator': <function ProjectAttributes.<lambda>>, 'synthesis_directory': <function relative_path_to_abs>, 'synthesise': <function ProjectAttributes.bool_processor>, 'synthesiser': <function ProjectAttributes.<lambda>>}
- PROJECT_NODE_DEFAULTS = {'path': None, 'synthesise': None}
- UNITTEST_NODE_DEFAULTS = {'path': None}
- XML_ADDITIONAL_TOOL_ARGS_RE = re.compile('args_([A-Z,a-z]+)_([A-Z,a-z]+)')
- XML_NODE_COMMENT = '#comment'
- XML_NODE_CONFIG = 'config'
- XML_NODE_CONSTRAINTS = 'constraints'
- XML_NODE_FILE = 'file'
- XML_NODE_GENERIC = 'generic'
- XML_NODE_LIBRARY = 'library'
- XML_NODE_PROJECT = 'project'
- XML_NODE_TEXT = '#text'
- XML_NODE_UNITTEST = 'unittest'
- static cast_attributes_to_dict(attributes)[source]
Ensure that attributes is a dictionary. Casts None to an empty dict and casts an xml.dom.minidom.NamedNodeMap to a dict.
- static get_processed_attribute(attribute, root, name)[source]
Process the given attribute according to the functions in the NODE_PROCESSOR dictionary using the name as a key and the root as the project root. The original attribute is returned if no NODE_PROCESSOR function can be found that matches the name.
- static process_attributes(attributes, root, defaults={})[source]
Process each of the attributes in the supplied dictionary or xml.dom.minidom.NamedNodeMap using the associated functions in the NODE_PROCESSOR dictionary and return an updated dictionary of the attribute name, value pairs.
If the defaults dictionary is supplied, the returned dictionary will contain at least the keys and associated values present in the defaults dictionary.
The root argument is passed to the NODE_PROCESSOR functions and it should be a string path pointing to the project root directory, this ensures any file paths can be cast to absolute paths correctly.