ipCorePackager package

Ip_packager converts HDL objects to hdl code in form of IPcore package.

Submodules

ipCorePackager.busInterface module

class ipCorePackager.busInterface.BusInterface

Bases: object

asElem()
classmethod fromBiClass(intf, biClass, packager: IpCorePackager)
static generatePortMap(biType, intf, packager: IpCorePackager)

ipCorePackager.component module

class ipCorePackager.component.Component(packager: IpPackager)

Bases: object

Containers of informations about IP core

Attention

Xilinx IP-XACT is element position dependent

asignTopUnit(top, topName)

Set hwt unit as template for component

ip_xact()
quartus_tcl(quartus_version=None)
registerInterface(intf: Interface)
ipCorePackager.component.tcl_add_fileset_file(filename: str)
Parameters

filename – relative filename with .vhdl or .v

Returns

add_fileset_file command string

ipCorePackager.component.tcl_comment(s)
ipCorePackager.component.tcl_set_module_property(name: str, value, escapeStr=True)

ipCorePackager.constants module

class ipCorePackager.constants.DIRECTION(value)

Bases: Enum

Used to describe direction of signal.

IN = 0
INOUT = 2
OUT = 1
classmethod asIntfDirection(d)
classmethod opposite(d)
class ipCorePackager.constants.INTF_DIRECTION(value)

Bases: Enum

Interface direction, used in interface direction resolving process.

MASTER = 0
SLAVE = 1
TRISTATE = 2
UNKNOWN = 3
classmethod asDirection(val)
classmethod opposite(d)

ipCorePackager.helpers module

ipCorePackager.helpers.appendSpiArray(root, arrName, arr)
ipCorePackager.helpers.appendSpiAtribs(obj, elm, prefix='', reqPropNames=[], optPropNames=[])
ipCorePackager.helpers.appendSpiElem(root, elemName)
ipCorePackager.helpers.appendStrElements(root, obj, reqPropNames=[], optPropNames=[])
ipCorePackager.helpers.appendXiElem(root, elemName)
ipCorePackager.helpers.findS(elm, name)
ipCorePackager.helpers.mkSpiElm(elemName)
ipCorePackager.helpers.mkXiElm(elemName)
ipCorePackager.helpers.prettify(elm)
ipCorePackager.helpers.whereEndsWithExt(files, extension)
ipCorePackager.helpers.whereEndsWithExts(files, extensions)

ipCorePackager.intfIpMeta module

class ipCorePackager.intfIpMeta.IntfIpMeta

Bases: Type

addSimpleParam(interfaceLogicalName: str, paramName: str, value: str, resolve='immediate')
addWidthParam(thisIntfName, name, value, packager: IpCorePackager)
asQuartusTcl(buff: List[str], version: str, component: Component, packager: IpPackager, thisIf: Interface)

Add interface to Quartus tcl

Parameters
  • buff – line buffer for output

  • version – Quartus version

  • intfName – name of top interface

  • component – component object from ipcore generator

  • packager – instance of IpPackager which is packagin current design

  • allInterfaces – list of all interfaces of top unit

  • thisIf – interface to add into Quartus TCL

get_quartus_map()
get_quartus_name()
library
name
postProcess(component, packager, thisIf)
quartus_add_interface_port(buff: List[str], intfName: str, signal, logicName: str, packager: IpCorePackager)

Add subinterface to Quartus interface

Parameters
  • buff – line buffer for output

  • intfName – name of top interface

  • signal – subinterface to create port for

  • logicName – name of port in Quartus

quartus_prop(buff: List[str], intfName: str, name: str, value, escapeStr=True)

Set property on interface in Quartus TCL

Parameters
  • buff – line buffer for output

  • intfName – name of interface to set property on

  • name – property name

  • value – property value

  • escapeStr – flag, if True put string properties to extra “”

quartus_tcl_add_interface(buff, thisIntf, packager)

Create interface in Quartus TCL

Returns

add_interface command string

vendor
version
exception ipCorePackager.intfIpMeta.IntfIpMetaNotSpecified

Bases: Exception

This error means that you need to implement this function to use this functionality

e.g. you have to implement Simulation agent for interface if you create new one and you can not use existing

class ipCorePackager.intfIpMeta.VALUE_RESOLVE

Bases: object

IMMEDIATE = 'immediate'
NONE = None
USER = 'user'

ipCorePackager.model module

class ipCorePackager.model.FileSetRef

Bases: object

asElem()
classmethod fromElem(elm)
class ipCorePackager.model.Model(packager: IpPackager, any_syn_fileSetName, any_sim_fileSetName, tcl_fileSetName)

Bases: object

addDefaultViews(name: str, parameters: List[Param])
asElem()
class ipCorePackager.model.ModelParameter(name: str, displayName: str, datatype: str, value: Value)

Bases: object

asElem()
classmethod fromParam(p, packager)
class ipCorePackager.model.View

Bases: object

asElem()
classmethod fromElem(elm)

ipCorePackager.otherXmlObjs module

class ipCorePackager.otherXmlObjs.CoreExtensions

Bases: object

asElem(displayName, revision)
class ipCorePackager.otherXmlObjs.File

Bases: object

asElem()
classmethod fromFileName(fileName)
class ipCorePackager.otherXmlObjs.FileSet

Bases: object

asElem()
class ipCorePackager.otherXmlObjs.Parameter

Bases: object

asElem()
asQuartusTcl(buff, version)
displayName
name
order
value
class ipCorePackager.otherXmlObjs.Value

Bases: object

RESOLVE_GENERATED = 'generated'
RESOLVE_USER = 'user'
asElem()
bitStringLength
dependency
format
id
resolve
text
class ipCorePackager.otherXmlObjs.VendorExtensions

Bases: object

XILINX_VERSION = '2014.4.1'
asElem(displayName, revision)

ipCorePackager.packager module

class ipCorePackager.packager.IpCorePackager(topObj, name, extra_files: List[str] = [])

Bases: object

IP-core packager

Summary

Packs HDL, constraint and other files to IP-Core package for distribution and simple integration

createPackage(repoDir, vendor: str = 'hwt', library: str = 'mylib', description: Optional[str] = None)
Parameters
  • repoDir – directory where IP-Core should be stored

  • vendor – vendor name of IP-Core

  • library – library name of IP-Core

  • description – description of IP-Core

Summary

synthetise hdl if needed copy hdl files create gui file create component.xml, component_hw.tcl

getInterfaceDirection(thisIntf: Interface) INTF_DIRECTION
getInterfaceLogicalName(intf: Interface)
getInterfacePhysicalName(intf: Interface)
getInterfaceType(intf: Interface) HdlType
getObjDebugName(obj: Union[Interface, Unit, Param]) str

Get name of object for debugging purposes

getParamPhysicalName(p: Param)
getParamType(p: Param) HdlType
getTypeWidth(dtype: HdlType, do_eval=False) Tuple[int, str, bool]
Returns

tuple (current value of width, string of value (can be ID or int), Flag which specifies if width of signal is locked or can be changed by parameter)

getVectorFromType(dtype: HdlType) Union[bool, None, Tuple[int, int]]
Returns

None if type has not specific width, False if type is just single bit and not a vector [high, low] if type is vector

iterInterfaces(top: Unit)
iterParams(top: Unit)
mkAutoGui()
Summary

automatically generate simple gui in TCL

paramToIpValue(idPrefix: str, p: Param, resolve) Value
saveHdlFiles(srcDir)
Parameters

srcDir – dir name where dir with HDL files should be stored

serializeType(hdlType: HdlType) str
serialzeValueToTCL(val, do_eval=False) Tuple[str, str, bool]

Serialize value to TCL

Returns

tuple (serialized value, serialized evaluated value of value, value is constant flag)

toHdlConversion(top, topName: str, saveTo: str) List[str]
Parameters
  • top – object which is represenation of design

  • topName – name which should be used for ipcore

  • saveTo – path of directory where generated files should be stored

Returns

list of file namens in correct compile order

ipCorePackager.port module

class ipCorePackager.port.Port(packager: IpCorePackager)

Bases: object

asElem()
static fromParams(name: str, direction: DIRECTION, dtype: HdlType, packager: IpPackager)
class ipCorePackager.port.WireTypeDef

Bases: object

asElem()

ipCorePackager.tclGuiBuilder module

class ipCorePackager.tclGuiBuilder.GuiBuilder

Bases: object

asTcl()
page(name)
class ipCorePackager.tclGuiBuilder.GuiPage(name)

Bases: TclObj

name
param(name)
parent
class ipCorePackager.tclGuiBuilder.GuiParam(name, parent)

Bases: TclObj

class ipCorePackager.tclGuiBuilder.TclFn(name, params, body)

Bases: TclObj

class ipCorePackager.tclGuiBuilder.TclObj

Bases: object

ipCorePackager.tclGuiBuilder.paramManipulatorFns(paramName)
ipCorePackager.tclGuiBuilder.setParamOnModel(propName)

ipCorePackager.type module

class ipCorePackager.type.Type

Bases: object

asElem(elmName)
library
name
vendor
version

ipCorePackager.uniqList module

class ipCorePackager.uniqList.UniqList(initSeq=None)

Bases: list

List of unique items

append(item)

Append object to the end of the list.

clear()

Remove all items from list.

copy()

Return a shallow copy of the list.

discard(item)
extend(items)

Extend list by appending elements from the iterable.

insert(i, x)

Insert object before index.

intersection_set(other)
pop(*args, **kwargs)

Remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

remove(item)

Remove first occurrence of value.

Raises ValueError if the value is not present.