Package: designformat
DesignFormatDesignFormat is a file format for storing fully expanded, hiearchical design data. It is uses JSON as a storage format as many languages offer native and relatively performant JSON parsers - making it easy to share data between different environments. DesignFormat is intended to be used as the interchange format between different tools, eliminating the need for multiple tools to parse the source data - which can introduce inconsistencies and errors.TypesDFBase: Base class, provides every other object with an ID, a description, and a map of arbitrary attributes (for passing options).DFDefine: Defines a named constant value related to the design.DFBlob: Can carry an arbitrary number of DesignFormat nodes of different types.DFProject: The root node exported to file. Provides interconnect and constant definitions, and holds the root blocks defined in the project.DFInterconnect & DFInterconnectComponent: Represents a connection type, comprised of components which can either be complex (other DFInterconnect instances) or simple (wire connections with a specified width and direction).DFBlock: Represents a block in the design hierarchy with ports, connections, and child blocks. It can also hold a register interface definition.DFPort: Represents a port on a block, with a specified direction (input or output) and a type (referencing a DFInterconnect type).DFConstantTie: A point that can be connected to an input port to hold it at a constant value.DFConnection: Defines a connection between two points (either two ports, or a contant tie and a port).DFRegister: Represents a register with an address, access modes, and a set of fields.DFRegisterField: Represents a single field within the register with a name, a width and a reset value.Using the Javascript libraryLoading a DFProjectconstdf_models=require('./javascript/df_models.js');constfs=require('fs');letdata=JSON.parse(fs.readFileSync('./my_file.df_project').toString());letproject=(newdf_models.DFProject()).loadObject(data);Loading a DFBlobconstdf_models=require('./javascript/df_models.js');constfs=require('fs');letdata=JSON.parse(fs.readFileSync('./my_file.df_blob').toString());letproject=(newdf_models.DFBlob()).loadObject(data);Using the Python libraryLoading a DFProjectfromdf_modelsimportDFProjectimportjsonproject=Nonewithopen('./my_file.df_project','r')asfh:project=DFProject().loadObject(json.load(fh))Loading a DFBlobfromdf_modelsimportDFBlobimportjsonproject=Nonewithopen('./my_file.df_blob','r')asfh:project=DFBlob().loadObject(json.load(fh))Generating DocumentationSystem RequirementsThe following dependencies are not mandatory, but are required for building the documentation:Sphinx- Powerful documentation generation toolRecommonmark- Markdown convertor for SphinxSphinx Markdown Tables- Markdown table convertor for SphinxSphinx RTD Theme- Read The Docs theme for Sphinx HTMLSphinx JS- Integrates JSDoc output into SphinxJSDoc- Javascript documentation generator$>pipinstallsphinxrecommonmarksphinx-markdown-tablessphinx-rtd-themesphinx-js
$>npminstall-gjsdocBuilding the DocumentationTo build the documentation, open this directory in a terminal and execute:$>makebuildHTML documentation will be generated underdocumentation/build/html.