Header menu logo issie

CanvasStateAnalyser Module

Types

Type Description

CustomComponentError

MapData

Return all the Ids of all input ports across all components. Return also the ComponentId which may be used in error messages.

Functions and values

Function or value Description

analyseState (arg1, arg2) ldComps

Full Usage: analyseState (arg1, arg2) ldComps

Parameters:
Returns: SimulationError option * ConnectionsWidth option

Analyse a CanvasState and return any error (or None).

arg0 : Component list
arg1 : Connection list
ldComps : LoadedComponent list
Returns: SimulationError option * ConnectionsWidth option

checkAdderUnnecessaryNC (arg1, arg2)

Full Usage: checkAdderUnnecessaryNC (arg1, arg2)

Parameters:
Returns: SimulationError option

Check whether Adders have a NotConnected component connected to their COUT this is unnecessary since it can be disabled via its options

arg0 : Component list
arg1 : Connection list
Returns: SimulationError option

checkComponentNamesAreOk (arg1, arg2)

Full Usage: checkComponentNamesAreOk (arg1, arg2)

Parameters:
Returns: SimulationError option

check component labels are all unique and do not include protected values (CLK)

arg0 : Component list
arg1 : Connection list
Returns: SimulationError option

checkCustomComponentForOkIOs c args sheets

Full Usage: checkCustomComponentForOkIOs c args sheets

Parameters:
    c : Component - The custom component instance to check
    args : CustomComponentType - The custom component type containing parameter bindings and expected I/O labels
    sheets : LoadedComponent list - List of loaded component sheets to check against

Returns: Result<unit, (Component * CustomComponentError)> Ok() if the component's I/Os match the sheet definition Error with details if there's a mismatch or missing sheet

Check a single custom component for correct I/Os, resolving parameters if necessary.

The signature an instance ought to have is CanvasExtractor.signatureOfInstance: the sheet inside it, resolved at the bindings the instance gives. That is the same calculation the catalogue makes when placing an instance, the properties pane makes when a binding is edited, and CustomCompPorts makes when bringing instances back into step - one function, so those four cannot disagree about what an instance's ports are, as the copies they used to hold did. The instance's bindings are read here on their own, with no parent sheet to evaluate them in, because a canvas is checked without reference to whatever contains it. A binding that is an expression in the parent's parameters therefore cannot be worked out, and the signature comes back inexact: only the port NAMES are then compared, and the widths are left to simulation elaboration, which has the parent's bindings and is exact. Comparing widths anyway would fail a design that is perfectly correct.

c : Component

The custom component instance to check

args : CustomComponentType

The custom component type containing parameter bindings and expected I/O labels

sheets : LoadedComponent list

List of loaded component sheets to check against

Returns: Result<unit, (Component * CustomComponentError)>

Ok() if the component's I/Os match the sheet definition Error with details if there's a mismatch or missing sheet

checkCustomComponentsOk (arg1, arg2) sheets

Full Usage: checkCustomComponentsOk (arg1, arg2) sheets

Parameters:
Returns: SimulationError option

Custom components have I/Os which are the same (names) as the I/Os in the corresponding sheet This can change if a sheet made into a custom component is edited We do this check whenever a new sheet is opened

arg0 : Component list
arg1 : Connection list
sheets : LoadedComponent list
Returns: SimulationError option

getOutErrType count port rmInfo

Full Usage: getOutErrType count port rmInfo

Parameters:
Returns: SimulationErrorType
count : int
port : Port
rmInfo : PortRmInfo
Returns: SimulationErrorType

getPortName comp port

Full Usage: getPortName comp port

Parameters:
Returns: string
comp : Component
port : Port
Returns: string

getPortNum pList port

Full Usage: getPortNum pList port

Parameters:
Returns: int option
pList : Port list
port : Port
Returns: int option

getRmInfoData m port

Full Usage: getRmInfoData m port

Parameters:
Returns: Component * string
m : MapData
port : Port
Returns: Component * string

portNames componentType

Full Usage: portNames componentType

Parameters:
Returns: string list * string list

Input and Output names of the ports depending on their ComponentType

componentType : ComponentType
Returns: string list * string list

Type something to start searching.