Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GWModule

The class which all gateware-ts hardware modules must extend. This class should never be instaniated.

Hierarchy

  • GWModule

Index

Constructors

constructor

Properties

moduleName

moduleName: string

The name of this module, used in code generation

simulation

simulation: Simulation

Contains and controls this modules simulation logic

Methods

addSubmodule

  • Add a submodule to this module

    Parameters

    • m: GWModule

      The module to add

    • submoduleName: string

      The internal name this module is given

    • signalMapping: SubmodulePortMappping

      A mapping for this modules inputs and outputs

    Returns void

addVendorModule

  • Add a vendor specific module (IP) to this module

    Parameters

    • m: VendorModule<any>

      The vendor module to add

    • submoduleName: string

      The name of the instance of this vendor module

    • signalMapping: SubmodulePortMappping

      A mapping for this modules inputs and outputs

    Returns void

combinationalLogic

  • Create a block of logic that is purely combinational

    Parameters

    Returns void

createInput

  • Create an input signal on this module with a given name

    Parameters

    • name: string

      The name for this signal

    • s: SignalT

      A signal definition

    Returns SignalT

createInternal

  • createInternal<T>(name: string, s: T): T
  • Create an internal signal on this module with a given name

    Type parameters

    Parameters

    • name: string

      The name for this signal

    • s: T

      A signal definition

    Returns T

createOutput

  • Create an output signal on this module with a given name

    Parameters

    • name: string

      The name for this signal

    • s: SignalT

      A signal definition

    Returns SignalT

Abstract describe

  • describe(): void
  • The describe method needs to contain all the synchronous, combinational, and simulation logic - as well as the inclusion of submodules. In short, it needs to "describe" your module.

    Returns void

input

internal

  • internal<T>(s: T): T

output

reset

  • reset(): this
  • Reset a module after it's been processed by a code generator. Very unlikely to be needed by an end-user

    Returns this

syncBlock

  • Create a block of logic that is synchronous to a signal edge

    Parameters

    • signal: SignalT

      The signal to synchronise to (usually a clock)

    • edge: Edge

      Either a positive or negative edge (can be hardware dependant)

    • block: BlockStatement[]

      A block of expressions

    Returns void

wire

  • wire(width?: number): WireT
  • Create a wire on this module.

    Parameters

    • Default value width: number = 1

      Bit width of this wire

    Returns WireT

Generated using TypeDoc