Header menu logo issie

WaveSimHelpers Module

Miscellaneous helpers used tby waveform simulator

Types

Type Description

PortIndex

convenience type for use when checking which drivers are connected

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

checkIfMemoryCompsOutOfDate p fs

Full Usage: checkIfMemoryCompsOutOfDate p fs

Parameters:
Returns: bool

returns true if any memory component in fs linked to a .ram file is outofdate because of the .ram file changing

p : Project
fs : FastSimulation
Returns: bool

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

extendSimulation timeOut ws

Full Usage: extendSimulation timeOut ws

Parameters:
Returns: float option

Run ws.FastSim if necessary to ensure simulation has number of steps needed to display all cycles on screen. TimeOut is an optional time out used to implement a progress bar.

timeOut : float option
ws : WaveSimModel
Returns: float option

getCompDetails fs wave

Full Usage: getCompDetails fs wave

Parameters:
Returns: string

determines how components are dispalyed in waveform selector

fs : FastSimulation
wave : Wave
Returns: string

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

getConnectedComponentPorts ws (arg2, arg3, arg4)

Full Usage: getConnectedComponentPorts ws (arg2, arg3, arg4)

Parameters:
Returns: PortIndex list

Some components have input and output connected - return both ports in that case

ws : WaveSimModel
arg1 : FastComponent
arg2 : int
arg3 : PortType
Returns: PortIndex list

getConnectedWaves ws wave

Full Usage: getConnectedWaves ws wave

Parameters:
Returns: Wave list

get all waves electrically connected to a given wave

ws : WaveSimModel
wave : Wave
Returns: Wave list

getFastSimualationLinkedPorts fs (arg2, arg3, arg4)

Full Usage: getFastSimualationLinkedPorts fs (arg2, arg3, arg4)

Parameters:
Returns: Map<FComponentId, (SimulationComponent * ComponentId list)>
fs : FastSimulation
arg1 : 'a
arg2 : 'b
arg3 : 'c
Returns: Map<FComponentId, (SimulationComponent * ComponentId list)>

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

Full Usage: getWaveSimButtonOptions (arg1, arg2) model ws

Parameters:
Returns: WaveSimButtonOptions

Return info about current state of waveform simulator which is used to switch buttons on/off etc.

arg0 : Component list
arg1 : Connection list
model : Model
ws : WaveSimModel
Returns: WaveSimButtonOptions

infoButton tooltipMessage style tooltipPosition

Full Usage: infoButton tooltipMessage style tooltipPosition

Parameters:
    tooltipMessage : string
    style : CSSProp list
    tooltipPosition : string

Returns: ReactElement

info button generation function

tooltipMessage : string
style : CSSProp list
tooltipPosition : string
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

nameOfSubsheet fs subSheet

Full Usage: nameOfSubsheet fs subSheet

Parameters:
Returns: string

Get the name of a subsheet from its subsheet (string) path list to root of simulation.

fs : FastSimulation
subSheet : List<string>
Returns: string

path2fId fastSim path

Full Usage: path2fId fastSim path

Parameters:
Returns: FComponentId option
fastSim : FastSimulation
path : ComponentId list
Returns: FComponentId option

portBits n

Full Usage: portBits n

Parameters:
    n : int

Returns: string
n : int
Returns: string

prefixOf pre whole

Full Usage: prefixOf pre whole

Parameters:
    pre : 'a list
    whole : 'a list

Returns: bool

Check if one list is an initial sublist of another

pre : 'a list
whole : 'a list
Returns: bool

printSPL tp fs spL

Full Usage: printSPL tp fs spL

Parameters:
Returns: SheetPort list

function to print a lits of SheetPort for debugging IOLabels

tp : string
fs : FastSimulation
spL : SheetPort list
Returns: SheetPort list

removeHighlights model dispatch

Full Usage: removeHighlights model dispatch

Parameters:

remove highlights on components generated by hovering on waveform labels

model : Model
dispatch : Msg -> unit

selectionInfoButton

Full Usage: selectionInfoButton

Returns: ReactElement

button used to give hover message about selection filter box.

Returns: ReactElement

sheetIdToName fastSim sheetId

Full Usage: sheetIdToName fastSim sheetId

Parameters:
Returns: string list
fastSim : FastSimulation
sheetId : ComponentId list
Returns: string list

sheetIdToSubsheets fastSim sheetId

Full Usage: sheetIdToSubsheets fastSim sheetId

Parameters:
Returns: string list
fastSim : FastSimulation
sheetId : ComponentId list
Returns: string list

subSheetsToNameReact subSheets

Full Usage: subSheetsToNameReact subSheets

Parameters:
    subSheets : string list

Returns: ReactElement

get react element to display a subsheet indication as a dotted string

subSheets : string list
Returns: ReactElement

summaryName ws cBox subSheet waves

Full Usage: summaryName ws cBox subSheet waves

Parameters:
Returns: ReactElement

Name for summary field in details element. NB: There are fields which are commented out: these can be added back in later on if we want to group those components together by type rather than separately by name.

ws : WaveSimModel
cBox : CheckBoxStyle
subSheet : string list
waves : Wave list
Returns: ReactElement

td1 react

Full Usage: td1 react

Parameters:
Returns: ReactElement
react : ReactElement
Returns: ReactElement

tr1 react

Full Usage: tr1 react

Parameters:
Returns: ReactElement
react : ReactElement
Returns: ReactElement

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.

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.