Header menu logo issie

WaveSimHelpers Module

Miscellaneous helpers used tby waveform simulator

Types

Type Description

WaveSimButtonOptions

Functions and values

Function or value Description

allConnectedPorts fs sp

Full Usage: allConnectedPorts fs sp

Parameters:
Returns: SheetPort list

Given a list of ports, get all ports connected to any port in it. used by connsOfWave

fs : FastSimulation
sp : SheetPort list
Returns: SheetPort list

bitLimsString (a, b)

Full Usage: bitLimsString (a, b)

Parameters:
    a : int
    b : int

Returns: string

get string in the [x:x] format given the bit limits output representation of bus width

a : int
b : int
Returns: string

button options func label

Full Usage: button options func label

Parameters:
Returns: ReactElement

Helper function to create Bulma buttons

options : Option list
func : MouseEvent -> unit
label : ReactElement
Returns: ReactElement

camelCaseDottedWords text

Full Usage: camelCaseDottedWords text

Parameters:
    text : string

Returns: string

convert a string to CamelCase:

text : string
Returns: string

connectedIOs fs sp

Full Usage: connectedIOs fs sp

Parameters:
Returns: SheetPort list

given an IOlabel port, get all same-name IOLabels on the same sheet

fs : FastSimulation
sp : SheetPort
Returns: SheetPort list

connectedPorts fs sheetPort

Full Usage: connectedPorts fs sheetPort

Parameters:
Returns: SheetPort list

given a SheetPort, get all directly connected SheetPorts

fs : FastSimulation
sheetPort : SheetPort
Returns: SheetPort list

connsOfWave fs wave

Full Usage: connsOfWave fs wave

Parameters:
Returns: ConnectionId list

Get all the connections of a given wave signal

fs : FastSimulation
wave : Wave
Returns: ConnectionId list

endButtonAction canvasState model dispatch ev

Full Usage: endButtonAction canvasState model dispatch ev

Parameters:
    canvasState : 'a
    model : Model
    dispatch : Msg -> unit
    ev : 'b

end the current simulation

canvasState : 'a
model : Model
dispatch : Msg -> unit
ev : 'b

getCompGroup fs wave

Full Usage: getCompGroup fs wave

Parameters:
Returns: ComponentGroup

Which group (for selector classification) is a component in?

fs : FastSimulation
wave : Wave
Returns: ComponentGroup

getInputPortNumber ipn

Full Usage: getInputPortNumber ipn

Parameters:
Returns: int

get integer from OutputPortNumber

ipn : InputPortNumber
Returns: int

getOutputPortNumber opn

Full Usage: getOutputPortNumber opn

Parameters:
Returns: int

get integer from OutputPortNumber

opn : OutputPortNumber
Returns: int

getWaveSimButtonOptions (arg1, arg2) model ws dispatch

Full Usage: getWaveSimButtonOptions (arg1, arg2) model ws dispatch

Parameters:
Returns: WaveSimButtonOptions

Return info about current state of waveform simulator which is used to switch buttons on/off etc. Runs on every render of the wave sim panel, so nothing here works out anything about the design that the model has already been told.

arg0 : Component list
arg1 : Connection list
model : Model
ws : WaveSimModel
dispatch : Msg -> unit
Returns: WaveSimButtonOptions

groupHeading compGroup

Full Usage: groupHeading compGroup

Parameters:
Returns: ReactElement

The heading over a group of components within one sheet of the wave selector. Every case of ComponentGroup, so that adding one is a compile error rather than a row headed "What? Not used!" - which is what the wildcard this replaces would have given. Three of them, WireLabel, Viewers and Component, are not produced by getCompGroup: they are there for grouping components by type rather than by name, which the selector does not currently do.

compGroup : ComponentGroup
Returns: ReactElement

isRamSelected (arg1, arg2) wsModel

Full Usage: isRamSelected (arg1, arg2) wsModel

Parameters:
Returns: bool
arg0 : ComponentId
arg1 : ComponentId list
wsModel : WaveSimModel
Returns: bool

isWaveSelected index wsModel

Full Usage: isWaveSelected index wsModel

Parameters:
Returns: bool

convenience functions

index : WaveIndexT
wsModel : WaveSimModel
Returns: bool

portBits n

Full Usage: portBits n

Parameters:
    n : int

Returns: string
n : int
Returns: string

removeHighlights model dispatch

Full Usage: removeHighlights model dispatch

Parameters:

remove highlights on components generated by hovering on waveform labels

model : Model
dispatch : Msg -> unit

sheetOfWave fs wave

Full Usage: sheetOfWave fs wave

Parameters:
Returns: string option

The name of the sheet a wave's component sits on, which is how ComponentsById and ConnectionsByPort are both keyed. A component's access path names the custom component instances it sits inside, and the innermost of those is an instance of the sheet wanted. It is that instance's TYPE which names the sheet: its LABEL is chosen by whoever placed it, and only happens to be the sheet's name until someone renames the instance. Asking the label instead left every wave in a renamed subsheet - REGFILE for reg16x8, say - with no connections found, and so with no wires highlighted on hover.

fs : FastSimulation
wave : Wave
Returns: string option

waveInfoButton name dispatch

Full Usage: waveInfoButton name dispatch

Parameters:
    name : string
    dispatch : Msg -> Unit

Returns: ReactElement

button driving a popup with a page of info about waveform simulator

name : string
dispatch : Msg -> Unit
Returns: ReactElement

waveToSheetPort fs wave

Full Usage: waveToSheetPort fs wave

Parameters:
Returns: SheetPort list

Work out a SheetPort from a wave, if one exists SheetPorts may not exist in some corner cases when simulation is ending etc. Every step is best effort and gives nothing rather than throwing. The link between a wave and the schematic is only as good as the schematic still being the one that was simulated, and this runs from the mouse handlers on a waveform's name - where an exception is not caught by showWaveforms' error boundary, which has already returned by then.

fs : FastSimulation
wave : Wave
Returns: SheetPort list

wavesToIds waves

Full Usage: wavesToIds waves

Parameters:
Returns: WaveIndexT list

Convert Wave list to list of WaveIndexT

waves : Wave list
Returns: WaveIndexT list

Type something to start searching.