array
Modules
Repeat #(T, int SIZE)
module Repeat #(T, int SIZE) {
interface Repeat : T v'0 -> T[SIZE] result'0
}Returns an array of SIZE copies of v.
Should not consume any hardware.
Runtime version of RepeatGen.
Reverse #(T, int SIZE)
module Reverse #(T, int SIZE) {
interface Reverse : T[SIZE] v'0 -> T[SIZE] result'0
}Concat #(T, int SIZE_A, int SIZE_B)
module Concat #(T, int SIZE_A, int SIZE_B) {
interface Concat : T[SIZE_A] a'0, T[SIZE_B] b'0 -> T[SIZE_A + SIZE_B] result'0
}Concatenate two arrays, such that the elements of b come after the elements of a.
Should not consume any hardware.
Runtime version of ConcatGen.
RotateLeft #(T, int ARRAY_LEN)
module RotateLeft #(T, int ARRAY_LEN) {
interface RotateLeft : T[ARRAY_LEN] data'0, int#(FROM: 0, TO: ARRAY_LEN) offset'0 -> T[ARRAY_LEN] rotated_data'0
}Rotates towards lower indexes by the provided offset. Implemented as a Barrel Shifter.
Example: RotateLeft([1, 2, 3, 4], 1) == [2, 3, 4, 1]
RotateRight #(T, int ARRAY_LEN)
module RotateRight #(T, int ARRAY_LEN) {
interface RotateRight : T[ARRAY_LEN] data'0, int#(FROM: 0, TO: ARRAY_LEN) offset'0 -> T[ARRAY_LEN] rotated_data'0
}Rotates towards higher indexes by the provided offset. Implemented as a Barrel Shifter.
Example:
sus RotateRight([1, 2, 3, 4], 1) == [4, 1, 2, 3]
Compile-Time Functions
RepeatGen #(T, int SIZE, T V)
const T[SIZE] RepeatGen #(T, int SIZE, T V)Generative version of Repeat
ReverseGen #(T, int SIZE, T[SIZE] V)
const T[SIZE] ReverseGen #(T, int SIZE, T[SIZE] V)Generative version of Reverse
ConcatGen #(T, int SIZE_A, int SIZE_B, T[SIZE_A] V_A, T[SIZE_B] V_B)
const T[SIZE_A + SIZE_B] ConcatGen #(T, int SIZE_A, int SIZE_B, T[SIZE_A] V_A, T[SIZE_B] V_B)Generative version of Concat