Issie logo Issie

FastExtract Module

Functions and values

Function or value Description

changeInput cid input step fastSim

Full Usage: changeInput cid input step fastSim

Parameters:

Change an input and make simulation correct. N.B. step must be the latest time-step since future steps are not rerun (TODO: perhaps they should be!)

cid : ComponentId
input : FSInterface
step : int
fastSim : FastSimulation

changeInputBatch step fastSim changes

Full Usage: changeInputBatch step fastSim changes

Parameters:

Change multiple inputs in one batch before re-running the simulation NOTE - Only used in TruthTable

step : int
fastSim : FastSimulation
changes : (ComponentId * FSInterface) list

changeInputFData cid input step fastSim

Full Usage: changeInputFData cid input step fastSim

Parameters:
cid : ComponentId
input : FSInterface
step : int
fastSim : FastSimulation

compareLoadedStates fs (arg2, arg3) p

Full Usage: compareLoadedStates fs (arg2, arg3) p

Parameters:
Returns: bool

Check if the components and connections of a fast simulation and a canvas are the same. Is the design the simulation was built from still what the project holds? False puts the Refresh button up. Asked of DesignAsDrawn and not of the SIMULATED sheets, because the two differ for a design holding an array component: there the simulation is of a wrapper and a body, and the project has neither - so every such simulation reported itself edited the moment it started.

fs : FastSimulation
arg1 : Component list
arg2 : Connection list
p : Project option
Returns: bool

driverArraysOf

Full Usage: driverArraysOf

Returns: FastSimulation -> IOArray option array

Every step array of a build, dense by its own index - what turns a driver HANDLE back into the array it names, in one indexed load. A driver index is what the port slice hands the renderer (PortView.sheetSliceOf) and what a read quotes back, so the simulator answering reads must be able to look one up without the wave tables a lean build does not have. Slots nothing owns - a clocked component's state array, allocated an index but not an IOArray - stay None, and a read naming one is an error. Memoised on the simulation: one array per build, the length of NumStepArrays, filled by one walk of the components. On the renderer this is never built - the renderer reads no arrays by handle - so the memo costs nothing there.

Returns: FastSimulation -> IOArray option array

extractFastSimulationIOs simIOs simulationData

Full Usage: extractFastSimulationIOs simIOs simulationData

Parameters:
Returns: (SimulationIO * FSInterface) list

Extract top-level inputs or outputs with names and wire widths. Used by legacy code.

simIOs : SimulationIO list
simulationData : SimulationData
Returns: (SimulationIO * FSInterface) list

extractFastSimulationIOsFData simIOs simulationData

Full Usage: extractFastSimulationIOsFData simIOs simulationData

Parameters:
Returns: (SimulationIO * FSInterface) list

As extractFastSimulationIOs but for FData - used by truth table logic.

simIOs : SimulationIO list
simulationData : SimulationData
Returns: (SimulationIO * FSInterface) list

extractFastSimulationOutput fs step (arg3, arg4) opn

Full Usage: extractFastSimulationOutput fs step (arg3, arg4) opn

Parameters:
Returns: FSInterface

return output port data from simulation as a Bit list Each element in list is one bit

fs : FastSimulation
step : int
arg2 : ComponentId
arg3 : ComponentId list
opn : OutputPortNumber
Returns: FSInterface

extractFastSimulationOutputFData fs step (arg3, arg4) opn

Full Usage: extractFastSimulationOutputFData fs step (arg3, arg4) opn

Parameters:
Returns: FSInterface
fs : FastSimulation
step : int
arg2 : ComponentId
arg3 : ComponentId list
opn : OutputPortNumber
Returns: FSInterface

extractFastSimulationState fs step (arg3, arg4)

Full Usage: extractFastSimulationState fs step (arg3, arg4)

Parameters:
Returns: SimulationComponentState

return state data from simulation

fs : FastSimulation
step : int
arg2 : ComponentId
arg3 : ComponentId list
Returns: SimulationComponentState

extractFastSimulationWidth fs (arg2, arg3) opn

Full Usage: extractFastSimulationWidth fs (arg2, arg3) opn

Parameters:
Returns: int

Extract the width of a component's output port.

fs : FastSimulation
arg1 : ComponentId
arg2 : ComponentId list
opn : OutputPortNumber
Returns: int

extractStatefulComponents step fastSim

Full Usage: extractStatefulComponents step fastSim

Parameters:
Returns: (FastComponent * SimulationComponentState) array
step : int
fastSim : FastSimulation
Returns: (FastComponent * SimulationComponentState) array

extractViewers simulationData

Full Usage: extractViewers simulationData

Parameters:
Returns: ((string * string) * int * FSInterface) list

Extract all Viewer components with names and wire widths.

simulationData : SimulationData
Returns: ((string * string) * int * FSInterface) list

extractViewersFData simulationData

Full Usage: extractViewersFData simulationData

Parameters:
Returns: ((string * string) * int * FSInterface) list

As extractViewers but for FData - used by truth table logic.

simulationData : SimulationData
Returns: ((string * string) * int * FSInterface) list

getArrayOfOutputs fc outputNum ticks

Full Usage: getArrayOfOutputs fc outputNum ticks

Parameters:
Returns: bigint array

Return array of simulation output values for a given output port. Values are returned from steos 0 to (tick - 1). Used by testParsser. Only works if tick < maxArraySize.

fc : FastComponent
outputNum : int
ticks : int
Returns: bigint array

getFLabel fs (arg2, arg3)

Full Usage: getFLabel fs (arg2, arg3)

Parameters:
Returns: string * string

Extract a component's label and its full name which includes all of its path to root of simulation.

fs : FastSimulation
arg1 : ComponentId
arg2 : ComponentId list
Returns: string * string

getFastComponentInput fc inputNum step

Full Usage: getFastComponentInput fc inputNum step

Parameters:
Returns: bigint
Modifiers: inline

Get the input value of a fast component as a bigint. fc: the fast component to get the input from. inputNum: which input as numbered in the inputs array. step: which time step to get the value from. used by waveSimSVGs, maybe this function could be moved there and optimised as code there at cost of modularity.

fc : FastComponent
inputNum : int
step : int
Returns: bigint

getFastComponentOutput fc outputNum step

Full Usage: getFastComponentOutput fc outputNum step

Parameters:
Returns: bigint
Modifiers: inline

Get the output value of a fast component as a bigint. fc: the fast component to get the output from. outputNum: which output as numbered in the outputs array. step: which time step to get the value from. used by waveSimSVGs, maybe this function could be moved there and optimised as code there at cost of modularity.

fc : FastComponent
outputNum : int
step : int
Returns: bigint

outputsAreTheSameAsDefault fs fc tick currdefault

Full Usage: outputsAreTheSameAsDefault fs fc tick currdefault

Parameters:
Returns: bool

Check if a fastComponent output is the same as the default value for all time steps. Used by simulationView. The current implementation seems not quite right when tick > MaxArraySize. ToDo - make this work for all time steps

fs : FastSimulation
fc : FastComponent
tick : int
currdefault : bigint
Returns: bool

sampleOfArray fs io cycle

Full Usage: sampleOfArray fs io cycle

Parameters:
Returns: bigint option

One sample of a resolved array, as a bigint whatever the width. The modulo is not optional. A step array is a REGION of a shared slab, so a step past the end of the region reads the next port's data with nothing to catch it - see IOArray.

fs : FastSimulation
io : IOArray
cycle : int
Returns: bigint option

tryFindOutputArray fs (arg2, arg3) opn

Full Usage: tryFindOutputArray fs (arg2, arg3) opn

Parameters:
Returns: Result<IOArray, string>

The step array an output port's data lives in, resolved ONCE. Everything `extractFastSimulationOutput` does per read except the read itself: the map lookup on (component, access path) - a structural comparison on a list - and the hop through FCustomOutputCompLookup that answers a custom component's output with the array of the Output component inside the subsheet. What comes back is the array and its width, from which a value at a cycle is an indexed load. For anything reading MANY samples of the same signal. Reading a whole window per sample cost that lookup, a FastData and an FSInterface allocation, and a conversion to bigint, per sample - for a wave that is often one bit wide. A Result, not an exception: the caller may be a server answering a request it did not compose, where a bad signal name is an answer rather than a crash.

fs : FastSimulation
arg1 : ComponentId
arg2 : ComponentId list
opn : OutputPortNumber
Returns: Result<IOArray, string>

Type something to start searching.