Static Random Access Memory (SRAM) module supports FPGA inference with generated behavioral model SRAM library ASIC macro library can be swapped in for ASIC synthesis/implemenation

Hierarchy (view full)

Constructors

Properties

name: string

name contains the resulting SystemVerilog module name

signals: Signals
submodules: Record<string, {
    module: Module;
    bindings: Record<string, string | bigint | Sig>;
}>

Type declaration

  • module: Module
  • bindings: Record<string, string | bigint | Sig>
interfaces: Interfaces
bindingRules: {
    input: string[];
    output: string[];
    inout: string[];
} = ...

Type declaration

  • input: string[]
  • output: string[]
  • inout: string[]
body: string
registerBlocks: Record<string, Record<string, Record<string, Record<string, {
    d: string;
    resetVal?: bigint;
}>>>> = {}
printedInterfaces: Record<string, boolean> = {}
verilogParams: Record<string, boolean>

Methods

  • adds an interface signal bundle

    Parameters

    • instanceName: string

      the name for this instance of the signal bundle

    • _interface: Interface

      the type of interface to add

    Returns Interface

    the resulting interface for connecting to modules and add* primitives

  • instantiate another module a a submodule

    Parameters

    • instanceName: string

      sets the instance mane

    • submodule: Module

      the module to instantiate

    • bindings: Record<string, string | bigint | Sig>

      define the connections of the submodule

    • autoBind: boolean = true

      find signals in parent with matching name for signals that are not explicitly bound

    • createMissing: boolean = false
    • autoWidthExtension: boolean = false

    Returns Module

    returns the resulting submodule instance

  • Parameters

    • sig: string | bigint | Sig
    • throwOnFalse: boolean = false
    • caller: null | string | ((...args) => any) = null
    • Optional throwOnArray: boolean

    Returns IOSignal | Signal

  • add a signal to the SystemVerilog module

    Parameters

    • name: string

      name of the signal

    • signal: Signal

      parameters of the signal

    Returns Sig

    signal that can be passed to other add* functions to make connections

  • add a DFF register(can be multi-bit) to the d input

    Parameters

    • io: {
          d: string | Sig | Expr;
          clk: string | Sig;
          reset?: string | Sig;
          resetVal?: bigint;
          en?: string | Sig | Expr;
          q?: string | Sig;
      }

      the input/output of the register

      • d: string | Sig | Expr
      • clk: string | Sig
      • Optional reset?: string | Sig
      • Optional resetVal?: bigint
      • Optional en?: string | Sig | Expr
      • Optional q?: string | Sig

    Returns Sig

    return the q output signal

  • get the number of bits need to represent an integer value

    Parameters

    • a: number | bigint

      the value to determine the bit width of

    • isSigned: boolean = false

      whether the value should be treated as a signed number

    Returns number

    the minimum bit width needed to represent the value

  • add a rounding operation to scale down and reduce the bit width of a signal

    Parameters

    • io: {
          in: string | Sig;
          out: string | Sig;
          rShift: string | number | Sig;
      }

      the input/output signals of the round operation the rShift signal determines the number of LSBs to round away. The rShift signal can be either a liternal constant or a variable shift. When using a variable shift, care should be taken to minimize the number of bits to minimize the impact on the timing path of the resulting logic.

      • in: string | Sig
      • out: string | Sig
      • rShift: string | number | Sig
    • roundMode: "rp" | "rm" | "rz" | "rn" | "rna" = 'rp'

      determines the type of rounding to apply

    Returns Sig

    the signal of the rounded result

  • add a Saturate operation to limit the bit width of a signal without overflow

    Parameters

    • io: {
          in: string | Sig;
          out: string | Sig;
      }

      the input and output signals of the saturation operation

      • in: string | Sig
      • out: string | Sig
    • satMode: "balanced" | "none" | "simple" = 'simple'

      determines the behavior of the saturation

    Returns Sig

    signal of the result of the saturation

  • adds an arithmetic adder to the generated SystemVerilog module

    Parameters

    • io: OperationIO

      the input/output interface of the adder

    Returns Sig

    the sum result

  • adds an arithemetic subtractor to the generated SystemVerilog module

    Parameters

    • io: OperationIO

      the input/output interface of the subtractor

    Returns Sig

    the difference result

  • add a constant literal signal to the generated SystemVerilog module

    Parameters

    • name: undefined | string

      signal name

    • value: bigint

      signal literal value

    • isSigned: boolean = false

      whether the signal is signed or not

    • width: undefined | number = undefined

      bit width of the resulting signal

    Returns Sig

  • add an array of constant literal signals to the generated SystemVerilog module

    Parameters

    • name: string

      signal name

    • values: bigint[]

      the literal values of the array

    • isSigned: boolean = false

      whether the signals are signed or not

    • width: undefined | number = undefined

      bit width of the resulting signals

    Returns Sig[]

    The array of signals

  • add a SystemVerilog continuous assign statement

    Parameters

    • io: {
          in: Expr;
          out: string | Sig;
      }

      expression that is the right hand side of the assigment

    Returns Sig

    signal that is the left hand side of the assignment

  • add a multiplexer to the TSSV module

    Parameters

    • io: {
          in: (string | Sig | Expr)[];
          sel: string | Sig | Expr;
          out: string | Sig;
          default?: string | Sig | Expr;
      }

      The input/output signals connected to the multiplexer

    Returns Sig

    signal of the multiplexer output

Generated using TypeDoc