core
Types
bool
__builtin__ struct boolBoolean 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 floatSingle 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 doubleSingle 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 stringGen-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
}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
}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
}LatencyOffsetActionNoData #(int OFFSET)
module LatencyOffsetActionNoData #(int OFFSET) {
action din'0
trigger dout'OFFSET
}Compile-Time Functions
__crash_compiler
const bool __crash_compilerFor intentionally triggering an ICE for debugging. It is a constant that crashes the compiler when it is evaluated
true
const bool trueTrue, as in ‘1’
false
const bool falseFalse, 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.