diff options
Diffstat (limited to 'test/c/large_bitvector.sail')
| -rw-r--r-- | test/c/large_bitvector.sail | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/c/large_bitvector.sail b/test/c/large_bitvector.sail new file mode 100644 index 00000000..78189d7d --- /dev/null +++ b/test/c/large_bitvector.sail @@ -0,0 +1,30 @@ +default Order dec + +$include <arith.sail> +$include <vector_dec.sail> + +val "zeros" : forall 'n. int('n) -> bits('n) + +val main : unit -> unit + +function main() = { + let x = [0x1FFFF0000FFFF0000 with 15 .. 0 = 0xFFFF]; + print_bits("x = ", x); + print_int("length(x) = ", length(x)); + let y = replicate_bits(x, 3); + print_bits("y = ", y); + print_int("length(y) = ", length(y)); + let z = [y with 63 .. (63 - 15) = 0xCAFE]; + print_bits("z = ", z); + print_int("length(z) = ", length(z)); + q = slice(z, 0, 64 * 3); + print_bits("q = ", q); + w = signed(q); + print_int("w = ", w); + print_int("length(q) = ", length(q)); + print_bits("", [0xFFFF with 14 .. 0 = zeros(15)]); + print_bits("0b1 @ zeros(64 * 3 - 1) = ", 0b1 @ zeros(64 * 3 - 1)); + q[64 * 3 - 2 .. 0] = zeros(64 * 3 - 1); + print_bits("q = ", q); + () +} |
