Department of Physics
Modules¶
helper/arguments.py¶
LICENSE © 2018-2019 Science and Technology Facilities Council & contributors
arguments.py is a helper module provided to define and configure the argument passing and parsing for the
main modules.
-
class
arguments.Arguments[source]¶ Creates arguments for passing files and configuration data to the script.
A Class which configures and retrieves Arguments for use by a python script. Dictionaries retrieved from YAML files are added as attributes to this class with no sub-processing. Information including the filename of each YAML file parsed is also added as an attribute.
See Arguments
Attributes:
helper/bus_definitions.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
bus_definitions.py is a helper module provided to define bus definitions for generated AXI4-Lite
connections.
helper/customlogging.py¶
LICENSE © 2018-2019 Science and Technology Facilities Council & contributors
customlogging.py is a helper module provided to define and configure consistent logging. The logging
configuration is handled via ../logging.yml YAML file and uses colorlog for console output.
A rolling system is used for outputting to files.
-
class
customlogging.LogLevelsConsts[source]¶ Logger level equivalent strings as constants, used to pass log level to helper functions.
-
DEBUG¶ String matching DEBUG logger level.
Type: str
-
INFO¶ String matching INFO logger level.
Type: str
-
WARNING¶ String matching WARNING logger level.
Type: str
-
CRITICAL¶ String matching CRITICAL logger level.
Type: str
-
ERROR¶ String matching ERROR logger level.
Type: str
-
-
customlogging.config_logger(name, class_name=None)[source]¶ Allows a logger to be set up and/or configured in all modules/module classes
Parameters: - name (str) – Name of the logger.
- class_name (str, optional) – Name of the class to which the logger is associated. Default value: None
Returns: A configured logger object.
Return type: logging (obj)
-
customlogging.constant(f)[source]¶ setters and getters for constants used throughout
Prevents setting of existing objects. Raises a TypeError.
Returns: property Raises: TypeError– On setter.
-
customlogging.errorexit(logr)[source]¶ Inserts a exit on error message in the logger output and performs a
sys.exit(-1)Parameters: logr (obj) – A logger object to pass the exit on error message to. Returns: None
-
customlogging.mand_missing(obj, field)[source]¶ Inserts a mandatory field missing error message in the logger output and calls
errorexit()Parameters: - logr (obj) – A logger object to pass the error message to.
- field (str) – field to report in the error message.
Returns: None
-
customlogging.path_missing(obj, name, path)[source]¶ Inserts a path missing error message in the logger output and calls
errorexit()Parameters: - logr (obj) – A logger object to pass the error message to.
- name (str) – Name of processing element which caused the error message.
- path (str) – Missing Path which caused the error message.
Returns: None
-
customlogging.sect_break(logr, level=<property object>)[source]¶ Inserts a section break in the logger output.
Parameters: - logr (obj) – A logger object to pass the section break to.
- level (attr of LogLevelsConsts obj, optional) – Logger level of the section break. Default value: LogLevelsConsts.INFO
Returns: None
-
customlogging.setup_logging(logr_settings='../logging.yml', default_level=20)[source]¶ Setup logging configuration from a YAML file
Parameters: - logr_settings (str, optional) – Defines the relative location of the logging configuration file,
- the root module. Default value (from) –
logging.yml - default_level (logging attr, optional) – Sets the default logging level. Default value: logging.INFO
Returns: None
helper/help.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
help.py is a helper module provided to version and help information.
helper/reserved_words.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
reserved_words.py is a helper module providing a list of reserved VHDL keywords, which should not be
used as identifiers in XML files used to generate the VHDL.
setup.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
helper/slave.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
slave.py is a helper module providing methods and classes used to generate slave components from XML
-
class
slave.Slave(data_bus_size=32, size_indicate_bytes=0)[source]¶ Creates a AXI4-Lite Slave
-
check_address_requirement()[source]¶ OB check that the size of the slave is smaller than absolute offset
Returns: None
-
fill_absolute_offset()[source]¶ OB fill absolute offset field walking from current node to root and accumulating offset
Returns: None
-
fill_addressable()[source]¶ OB fill addressable field
An object is addressable if it is:
blockregister_with_bitfieldregister_without_bitfieldbitfield
Returns: None
-
get_object(object_type_list, include_ignored=True)[source]¶ Return a list of requested objects with specified type
Specific types are:
blockregister_without_bitfieldbitfield
Parameters: - object_type_list (list of str) –
- include_ignored (bool, optional) – Default value is
True
Returns: Sorted list of requested object types
Return type: (list)
-
get_range_from_mask(mask, split='0')[source]¶ Return range from mask
Parameters: - mask –
- split –
Returns: Return type: (???)
-
populate_dict(root_node)[source]¶ Populate the dictionary
Parameters: root_node – Returns: Return type: (???)
-
populate_node_dictionary(xml_node, xml_parent_node, hier_level)[source]¶ Populate the node dictionary
Parameters: - xml_node –
- xml_parent_node –
- hier_level –
Returns: Return type: (???)
-
helper/string_io.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
string_io.py is a helper module providing methods and classes for handling string IO consistently.
helper/version.py¶
BSD © 2018-2019 Science and Technology Facilities Council & contributors
version.py is a helper module provided to handle public version numbering which follows the
PEP440 guidelines.
Note
The __version__ uses the version.Version (defined in this module), therefore is used
towards the end of this module.
-
class
version.Version(major, minor, micro, prerelease='', svn_rev='', disable_svn_logging=False)[source]¶ Creates a Class with methods to construct and fetch PEP440 Public Version Numbering
Creates an initial PEP440 Public Version Identifier from the supplied parameters after validating the prerelease parameter,
Parameters: - major (int) – Representing the Major Version Number (changes affecting execution method)
- minor (int) – Representing the Minor Version Number (bugfixes)
- micro (int) – Representing the Micro Version Number (correction of typos/release notes)
- prerelease (int, optional) – Addition Pre-Release Indicator. Valid values:
a,b,rc, where:a= alpha;b= beta; andrc= release candidate - svn_rev (str, optional) –
SVNRevision Number - disable_svn_logging (bool) – Do not include
SVNoutput in logs. Default value:False
-
get_version()[source]¶ Method to get the string representation of the version number.
Returns: String of Version Number
-
set_version(major, minor, micro, pre)[source]¶ Method to set the string representation of a Version Number.
Parameters: - major – Integer Value Representing the Major Version Number (changes affecting execution method)
- minor – Integer Value Representing the Minor Version Number (bugfixes)
- micro – Integer Value Representing the Micro Version Number (correction of typos/release notes)
- pre – Optional Addition Pre-Release Indicator… a = alpha b = beta rc = release candidate
Returns: string
xml2htmltables.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
xml2htmltables.py is a module provided to automatically generate HTML tables from generated AXI4-Lite
Memory-Maps which can be embedded into documentation.
Todo
- error checking
- documentation
- regression test
xml2ic.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
xml2ic.py is a module provided to automatically generate AXI4-Lite Memory Mapped locations from
XML descriptions, and is responsible for generating inter-connect (IC) blocks.
Todo
- error checking
- documentation
- regression test
-
xml2ic.dec_check_bit(add_list, bit)[source]¶ Parameters: - add_list (list of ???) –
- bit –
Returns: position of not-equal bit among addresses in add_list, returns
-1if there are not different bitsReturn type: (int)
-
xml2ic.dec_route_add(tree_dict)[source]¶ Parameters: tree_dict (dict) – Returns: - tuple containing:
- int: 1 to indicate
donecomplete. - dict:
- int: 1 to indicate
Return type: tuple
-
xml2ic.get_absolute_id(node, excluded_levels=[])[source]¶ Parameters: - node (obj) –
- excluded_levels (list of ???) –
Returns: Return type: (???)
-
xml2ic.get_decoder_mask(address_list)[source]¶ Parameters: address_list (list of int) – Returns: Return type: (dict)
-
xml2ic.get_node_size(node)[source]¶ Return the node total size
Parameters: node (obj) – Returns: Return type: (int)
-
xml2ic.get_xml_file(link, path_list)[source]¶ Parameters: - link –
- path_list (list of str) –
Returns: Return type: (???)
xml2slave.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
xml2slave.py is a module provided to automatically generate AXI4-Lite Memory Mapped locations from
XML descriptions, and is responsible for generating slaves.
Todo
- reset record value
- error checking
- documentation
- regression test
helper/xml_gen.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
xml_gen.py is a helper module providing methods for generating XML output files.
helper/xml_utils.py¶
GNU General Public License v3 © 2015-2019 University of Oxford & contributors
xml_utils.py is a helper module providing methods and classes for handling XML files.
-
class
xml_utils.XmlMemoryMap(input_file_name, data_bus_size=32, size_indicate_bytes=0)[source]¶ -
check_wide_blocks()[source]¶ OB check for blocks that are wider than data bus and resize them
Returns: None
-
resolve_command_line_parameters(command_line_constant)[source]¶ Resolve command line parameters
Parameters: command_line_constant – Returns: None
-