Casting
The as Keyword
Section titled “The as Keyword”vctx is a strongly typed language. To convert between types (for example, from a register value to a boolean, or between integer widths), you use the as keyword.
Syntax
Section titled “Syntax”expression as type
Examples
Section titled “Examples”// Converting a u1 register to a boolean outputreg state: u1 = 0led := state as bool
// Resizing logic (example generic usage)wire foo: u16 = concat(0 as u4, val[11..0])Need an offline copy? Download Full Manual (.md)