Header menu logo issie

SheetDescription Module

Types and nested modules

Type/Module Description

Operators

NOT opened by `open SheetDescription` - it has to be asked for. `==>` is already Fable.Core.JsInterop's object-literal operator (used in FilesIO, MainView and TruthTableView) and FsCheck's implication operator. Opening this module alongside either of those shadows one with the other, silently, by order of the open statements. So open it only in a file that uses neither - which is all of the test files. `connect` above is the same function and carries no such hazard.

CompSpec

A component to place. `Name` identifies it within the description and, unless `Label` says otherwise, is also the label drawn on the sheet.

ConnSpec

A connection from an output port to an input port. Which end is which is decided by position: From is always the driver.

ParamSpec

A parameter the sheet declares: a name, the value it takes when nothing binds it, and what it means. The description is compulsory here as it is everywhere else - it is what an instance of this sheet shows the user when asking them for a value.

PortRef

One port of one component, written "COMP/PORT". PORT is matched against the port names Issie gives that component type, ignoring case and surrounding space, and falls back to being read as a port index. The fallback is not a convenience: many component types - gates, inputs, outputs, wire labels, constants, bus selects, splitters - have no port names at all, so an index is the only way to refer to them. PORT may be left off entirely ("A" rather than "A/0") when the component has exactly one port in the direction wanted, which covers Inputs, Outputs and most single-output components.

SheetDescription

A whole sheet, before it has any geometry.

SlotSpec

One integer of one component driven by a parameter expression. The expression is written as text and read by the same parser the properties pane uses, so "W", "W*2" and "W-1" all mean here exactly what they mean when typed into a properties box.

Functions and values

Function or value Description

comp name compType

Full Usage: comp name compType

Parameters:
Returns: CompSpec

A component whose label is its name.

name : string
compType : ComponentType
Returns: CompSpec

compLabelled name label compType

Full Usage: compLabelled name label compType

Parameters:
Returns: CompSpec

A component labelled differently from the name used to refer to it here.

name : string
label : string
compType : ComponentType
Returns: CompSpec

connect fromPort toPort

Full Usage: connect fromPort toPort

Parameters:
    fromPort : string
    toPort : string

Returns: ConnSpec

A connection, driver first. The same as the ==> operator below, and always safe to use.

fromPort : string
toPort : string
Returns: ConnSpec

describeSheet name comps conns

Full Usage: describeSheet name comps conns

Parameters:
Returns: SheetDescription

The order components are given in fixes the order of the sheet's own inputs and outputs, so declare Input and Output components in the order the sheet's ports should appear.

name : string
comps : CompSpec list
conns : ConnSpec list
Returns: SheetDescription

parsePortRef reference

Full Usage: parsePortRef reference

Parameters:
    reference : string

Returns: PortRef

Read "COMP/PORT", or "COMP" for the only port in whichever direction it is used. A port name may itself contain a '/', so only the FIRST separator counts.

reference : string
Returns: PortRef

withParam name defaultValue description sheet

Full Usage: withParam name defaultValue description sheet

Parameters:
    name : string
    defaultValue : int
    description : string
    sheet : SheetDescription

Returns: SheetDescription
 Declare a parameter on the sheet. Pipeline style:
     describeSheet "adder" comps conns
     |> withParam "W" 4 "width of the data bus in bits"
     |> withSlot "ADD" Buswidth "W"
name : string
defaultValue : int
description : string
sheet : SheetDescription
Returns: SheetDescription

withSlot compName slot expression sheet

Full Usage: withSlot compName slot expression sheet

Parameters:
Returns: SheetDescription

Drive one integer of one component from a parameter expression, written as it would be typed into the properties pane.

compName : string
slot : CompSlotName
expression : string
sheet : SheetDescription
Returns: SheetDescription

Type something to start searching.