pymint package

Subpackages

Submodules

pymint.mintErrorListener module

class pymint.mintErrorListener.MINTErrorListener(output: StringIO)

Bases: ErrorListener

Error listener that will fire all error messages

Listens to the errors and formats the output in a user readable manner

property symbol

Symbol associated with the current error

Returns:

Error symbol

Return type:

[String]

syntaxError(recognizer, offendingSymbol, line, column, msg, e)

Writes the syntax error to the listener output

Parameters:
  • recognizer ([type]) – ANTLR internal

  • offendingSymbol ([type]) – Symbol which caused the error

  • line ([type]) – Line number

  • column ([type]) – Column number

  • msg ([type]) – Message generated by ANTLR

  • e ([type]) – ANTLR internal

pymint.mintcompiler module

class pymint.mintcompiler.MINTCompiler

Bases: mintListener

Primary ANTLR listener class for the compiler

enterBoolParam(ctx: BoolParamContext)
enterControlBlock(ctx: ControlBlockContext)
enterControlStat(ctx: ControlStatContext)
enterEntity(ctx: EntityContext)
enterFlowBlock(ctx: FlowBlockContext)
enterFlowStat(ctx: FlowStatContext)
enterHeader(ctx: HeaderContext)
enterIntParam(ctx: IntParamContext)
enterIntegrationBlock(ctx: IntegrationBlockContext)
enterLengthParam(ctx: LengthParamContext)
enterNetlist(ctx: NetlistContext)
enterParamsStat(ctx: ParamsStatContext)
enterSpacingParam(ctx: SpacingParamContext)
enterTerminalStat(ctx: TerminalStatContext)
enterViaStat(ctx: ViaStatContext)
enterWidthParam(ctx: WidthParamContext)
exitBankDeclStat(ctx: BankDeclStatContext)
exitBankGenStat(ctx: BankGenStatContext)
exitChannelStat(ctx: ChannelStatContext)
exitGridDeclStat(ctx: GridDeclStatContext)
exitLayerBlock(ctx: LayerBlockContext)
exitNetStat(ctx: NetStatContext)
exitNetlist(ctx: NetlistContext)
exitNodeStat(ctx: NodeStatContext)
exitPrimitiveStat(ctx: PrimitiveStatContext)
exitSpanStat(ctx: SpanStatContext)
exitValveStat(ctx: ValveStatContext)

pymint.mintcomponent module

pymint.mintconnection module

pymint.mintdevice module

class pymint.mintdevice.MINTDevice(name: str, device_ref: Device | None = None)

Bases: MINTProtocol

Device class abstracting parchmint Device object adding additional methods for generating MINT

add_constraint(constraint: LayoutConstraint) None

Adds a layout constriant to the device

Parameters:

constraint (LayoutConstraint) – new constraint we want to add

add_terminal(name: str, pin_number: int, layer_id: str) MINTTerminal

Creates and adds a terminal to the device with an associated pin number

Parameters:
  • name (str) – name of the pin

  • pin_number (int) – pin number of the terminal

  • layer (str) – layerid associated with the terminal

Returns:

The newly created terminal

Return type:

MINTTerminal

add_via(name: str, layers: List[Layer]) MINTVia

Creates and adds a via to the device

Parameters:
  • name (str) – name of the via

  • width (int) – width of the via

  • layers (List[Layer]) – layers associated with the via

Returns:

The newly created via

Return type:

MINTVia

create_mint_component(name: str, technology: str, params: Dict, layer_ids: List[str]) Component

Creates a new component and adds it to the device

Parameters:
  • name (str) – name

  • technology (str) – MINT string

  • params (Dict) – params dictionary

  • layer_ids (List[str]) – list of layer ids

Returns:

the newly created component

Return type:

Component

create_mint_connection(name: str, technology: str, params: Dict, source: Target, sinks: List[Target], layer_id: str) Connection

Creates a new MINT connection and adds it to the device

Parameters:
  • name (str) – name of the connection

  • technology (str) – MINT string

  • params (Dict) – dictionary of the paraeters

  • source (Target) – object defining where the connection starts

  • sinks (List[Target]) – list of objects defining where the connection ends

  • layer_id (str) – layer id of the connection

Raises:

Exception – Throws an exception if layer with the given id is not found

Returns:

Returns the newly created connection

Return type:

Connection

create_mint_layer(ID: str, name_postfix: str, group, layer_type: MINTLayerType) Layer

[summary]

Parameters:
  • id (str) – id of the mint layer

  • name_postfix (str) – postfix to add to the layer name

  • group ([type]) – group the layer belongs to

  • layer_type (MINTLayerType) – layer type of the layer

Returns:

[description]

Return type:

Layer

create_valve(name: str, technology: str, params: Dict, layer_ids: List[str], connection: Connection, valve_type: ValveType = ValveType.NORMALLY_OPEN) Component

Creates a new valve and adds it to the device

Parameters:
  • name (str) – name of the valve

  • technology (str) – MINT string

  • params (Dict) – dictionary of the paraeters

  • layer_ids (List[str]) – list of layer ids

  • connection (Connection) – connection to attach the valve to

  • valve_type (ValveType, optional) – valve type of the valve .

  • ValveType.NORMALLY_OPEN. (Defaults to) –

Raises:

Exception – [description]

Returns:

[description]

Return type:

Component

property device: Device

Returns the underlying parchmint device

Returns:

underlying parchmint device

Return type:

Device

static from_mint_file(filepath: str, skip_constraints: bool = False) MINTDevice

Compiles the MINT file at the given path

Parameters:
  • filepath (str) – absolute filepath of the mint file

  • skip_constraints (bool, optional) – flag to accept / skip constraint parsing.

  • False. (Defaults to) –

Returns:

The parsed device from the MINT file

Return type:

MINTDevice

get_constraints() List[LayoutConstraint]

Returns the layout constraints of the device. Currently does not support the constraints

Returns:

List of layout constriants objects

Return type:

List[LayoutConstraint]

to_MINT() str

Returns the MINT string of the device

Returns:

MINT string

Return type:

str

to_parchmint()

Returns the Parchmint string of the device

Returns:

Parchmint string

Return type:

str

pymint.mintlayer module

class pymint.mintlayer.MINTLayerType(value)

Bases: Enum

Enum that represents all the differnt types of layers

CONTROL = 2
FLOW = 1
INTEGRATION = 3

pymint.mintnode module

class pymint.mintnode.MINTNode(name: str, layer: Layer)

Bases: object

NODE object that is considered a waypoint in the design however this is modelled as a component in Parchmint v1.

simplifies the creation process and generate all of the required MINT.

property component: Component

Returns the component object

Returns:

component object

Return type:

Component

pymint.mintparams module

pymint.minttarget module

pymint.mintterminal module

class pymint.mintterminal.MINTTerminal(name: str, port_number: int, layer: Layer)

Bases: object

Class for representing the MINT terminal, its modelled as a Parchmint Component while giving helpful methods to model the design

property component: Component

Returns the component object

Returns:

component object

Return type:

Component

property port_number: int

Returns the port number of the terminal (at a device level)

Returns:

port value

Return type:

int

pymint.mintvia module

class pymint.mintvia.MINTVia(name: str, layers: List[Layer], width: float = 0)

Bases: object

Class to represent MINT Vias that are modelled as a Parchmint component. The class has helpful methods for adding and modifying the vias

property component: Component

Returns the component object

Returns:

component object

Return type:

Component

property width: float

Returns the width of the via

Returns:

width of the via

Return type:

float

Module contents