CommonTypes Module
Types and nested modules
Functions and values
| Function or value | Description |
|
|
|
|
|
Which SHEETS of a design hold something clocked, at any depth. A fact about a sheet and not about any instance of it: a sheet's components are the same wherever it is placed, and parameters change widths rather than kinds. So it is worked out once for a design, and every symbol drawn on it is then a set lookup. Settled in one pass over sheets ordered so that each comes after everything inside it. Working it out per component instead re-walked the whole subtree for every custom component drawn - twice, since a symbol asks once for its colour and once for its own record - and that walk follows every ROUTE through the design rather than every sheet, so a design whose sheets instantiate one another costs paths rather than sheets.
|
|
|
|
A component I/O. Id (like any other Id) is a string generated with 32 random hex charactes, so it is (practically) globally unique. These Ids are used to uniquely refer to ports and components. They are generated via uuid(). PortNumber is used to identify which port is which on a component, contiguous from 0 separately for inputs and outputs. See comments above type definition for details HostId is the unique Id of the component where the port is. For example, all three ports on the same And component will have the same HostId.
|
|
|
Full Usage:
convertFromJSONComponent mapCompId mapPortId comp
Parameters:
string -> ComponentId
mapPortId : string -> PortId
comp : Component
Returns: Component
|
|
Full Usage:
convertFromJSONConnection mapConnId mapCompId mapPortId conn
Parameters:
string -> ConnectionId
mapCompId : string -> ComponentId
mapPortId : string -> PortId
conn : Connection
Returns: Connection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
getSTransformWithDefault infoOpt
Parameters:
SymbolInfo option
Returns: STransform
|
|
|
|
|
|
Full Usage:
isClocked _visitedSheets ldcs comp
Parameters:
string list
ldcs : LoadedComponent list
comp : Component
Returns: bool
|
|
|
|
|
Whether a component is clocked in itself - without looking inside a custom component, which is a question about the sheet it names rather than about the component. The same set as `SynchronousUtils.couldBeSynchronousComponent` minus `Custom`, which that one has to assume is clocked and this one answers properly. They are two lists because this is in CommonTypes, which the simulator is compiled after; `Properties.fs` holds them to agreeing. AsyncROM1 is absent deliberately: an asynchronous ROM presents its data in the same cycle as its address, so it is combinational. The three legacy memory types are absent because they never occur - every loaded design has the `1` forms, and the evaluators raise on the others - which is what this used to match, so a sheet whose only clocked component was a memory was reported combinational and drawn as if it were.
|
Full Usage:
isGeneratedSheetName sheetName
Parameters:
string
Returns: bool
|
Is this the name of a sheet the EXPANSION made, rather than one somebody drew? A sheet name is a file name, so a path separator can never be typed into one - which is what ArrayElaborate builds its generated names out of, and what makes this test exact rather than a guess about naming. What it is asked for: such a sheet and the instances of it were made together in one pass, so the checks that catch an instance drifting from a sheet somebody edited have nothing to say about them.
|
Full Usage:
isNegated gateType
Parameters:
GateComponentType
Returns: bool
Modifiers: inline |
|
|
|
|
A sheet's parameter data as though it were always there: a sheet that declares none reads as empty declarations and no slots, and writing to it creates the record. A LENS, where lcParameterSlots_ above is a prism, and that is the whole point. Composing a prism onto a prism gives an optic whose SETTER does nothing when the outer get returns None (Optics.fs), so `Optic.set` through lcParameterSlots_ silently dropped every write to a sheet that had no parameter data yet - which is exactly the sheet a first declaration is being written to. That hole is why ParameterView grew a second, hand-written path for the None case.
|
|
|
Full Usage:
legacyTypesConvert (lComps, lConns)
Parameters:
LegacyComponent list
lConns : LegacyConnection list
Returns: Component list * Connection list
|
|
|
|
Full Usage:
loadedComponentOf_ name
Parameters:
string
Returns: Lens<Project, LoadedComponent>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
sheetInfoOfJson mapCompId si
Parameters:
string -> ComponentId
si : SheetInfo
Returns: SheetInfo
|
|
|
|
Full Usage:
shifterWidthFor busWidth
Parameters:
int
Returns: int
|
Number of bits needed on a shifter's SHIFT input to express every shift amount 0 .. busWidth-1. Must be recomputed whenever the bus width changes. This is ceil(log2 busWidth), clamped to 1 so that a one-bit bus still has a shift input. It used to count the bits of busWidth-1 itself; ParameterTypes.clog2 is the same count, exported because `clog2` in a parameter expression must mean exactly what the SHIFT input does. The one difference is at busWidth <= 0, where counting the bits of -1 shifted for ever.
|
|
|
|
|
|
|
Full Usage:
unreduced arg1
Parameters:
ReducedCanvasState
Returns: Component list * Connection list
|
|
Full Usage:
waveInfoOfJson mapCompId wi
Parameters:
string -> ComponentId
wi : SavedWaveInfo
Returns: SavedWaveInfo
|
|
|
|
Full Usage:
waveSimMaxArrayMargin
Returns: int
|
|
Full Usage:
waveSimMultipliers
Returns: int list
|
The zoom multipliers the waveform viewer can sample at. Zooming out samples every Nth cycle, so the step arrays carry a margin past WSConfig.LastClock of up to the largest multiplier, plus a few overflow steps - ModelHelpers.waveSimRequiredArraySize computes the exact size a configuration implies. These live here, beside WSConfig, because the simulator's memory check (FastCreate) and the configuration dialog sit on opposite sides of the UI boundary and must agree about what a configuration costs: each once had its own idea of the margin, so a last clock the dialog allowed could be refused the moment the simulation was built.
|
Full Usage:
waveSimStepsOverflow
Returns: int
|
|
|
Active patterns
| Active pattern | Description |
Full Usage:
(|IsBinaryGate|NotBinaryGate|) cType
Parameters:
ComponentType
Returns: Choice<unit, unit>
|
|
|
|
Full Usage:
(|MemoryAndType|_|) typ
Parameters:
ComponentType
Returns: ((Memory1 -> ComponentType) * Memory1) option
|
|
|
|