core

Types

bool

__builtin__ struct bool

Boolean values. Can take on true or false.

Synthesizes to logic. Takes on the values 1'b1 for true, and 1'b0 for false

int #(int FROM, int TO)

__builtin__ struct int #(int FROM, int TO)

Integers are bounded. From an inclusive FROM value, to an exclusive TO value. For more information, see Bounded Integers

Synthesizes to logic[sizeof#(T: type int#(FROM, TO)) - 1:0]. Encoded as unsigned 2s complement for FROM >= 0, and as signed 2s complement for FROM < 0.

Generative integers are unbounded of arbitrary size.

float

__builtin__ struct float

Single precision IEEE 32-bit float. Operators are provided by external libraries, but it’s defined here for convenience.

Synthesizes to logic[31:0]

double

__builtin__ struct double

Single precision IEEE 64-bit double-precision float. Operators are provided by external libraries, but it’s defined here for convenience.

Synthesizes to logic[63:0]

string

__builtin__ struct string

Gen-only type for strings. Only used to pass strings to Verilog submodules - like data files for ROMs.

Modules

LatencyOffset #(T, int OFFSET)

module LatencyOffset #(T, int OFFSET) {
    interface LatencyOffset : T din'0 -> T dout'OFFSET
}
LatencyOffset default clock clk -OFFSET din dout

Unsafe builtin to circumvent the Latency Counting System. Connects dout to din without adding the requisite latency Or: used for negative latencies, for instance to implement Almost-Full FIFOs, stateful for loops, etc.

CrossDomain #(T)

module CrossDomain #(T) {
  clock in_clk
   domain in_clk
    input T din'0
  clock out_clk
   domain out_clk
    output T dout'0
}
CrossDomain in_clk clock in_clk out_clk clock out_clk din dout

Unsafe builtin to connect wires from different clock domains. Important: This is a plain connection from a wire in one clock domain to a wire in another. This performs no synchronization or other data integrity measures!

LatencyOffsetAction #(T, int OFFSET, int DATA_DELAY)

module LatencyOffsetAction #(T, int OFFSET, int DATA_DELAY) {
    action din'0 : T data_i'DATA_DELAY
    trigger dout'OFFSET : T data_o'OFFSET+DATA_DELAY
}
LatencyOffsetAction default clock clk -OFFSET -OFFSET din data_i dout data_o

LatencyOffsetActionNoData #(int OFFSET)

module LatencyOffsetActionNoData #(int OFFSET) {
    action din'0
    trigger dout'OFFSET
}
LatencyOffsetActionNoData default clock clk -OFFSET din dout

Compile-Time Functions

__crash_compiler

const bool __crash_compiler

For intentionally triggering an ICE for debugging. It is a constant that crashes the compiler when it is evaluated

true

const bool true

True, as in ‘1’

false

const bool false

False, as in ‘0’

assert #(bool C)

const bool assert #(bool C)

Throws an execution error if C == false

sizeof #(T)

const int sizeof #(T)

Returns the size of the given type, in bits.

Examples:

sizeof #(T: type bool) = 1
sizeof #(T: type bool[50]) = 50
sizeof #(T: type int[10][10]) = 3200

noinfer #(int V)

const int noinfer #(int V)

Result == V, but this prevents this from being included in the inference parameters.