Closed NAtre closed 2 years ago
Looks good to me.
Isn’t it better to throw a NotImplementedError
when it doesn’t recognize the operator? I think it’s probably better to have the program crash than just assume +
and move on.
Oops, yes I agree it should throw a NotImplementedError
. I'll change it.
Adding support for the power () operator to Fluid. Currently, using in the RHS of a VTL expression doesn't translate to the right operand in the resulting SystemVerilog code. For instance, compiling
HEAP_NUM_PRIORITIES = Param(HEAP_BITMAP_WIDTH ** 2)
yieldsparameter HEAP_NUM_PRIORITIES = (HEAP_BITMAP_WIDTH + 2);
. After this change:parameter HEAP_NUM_PRIORITIES = (HEAP_BITMAP_WIDTH ** 2);
.Testing:
./run_pigasus.sh
without any changes to pigasus.py; as expected, struct_s.sv remains unchanged./run_pigasus.sh
after adding a dummy parameter that uses **, which produces the expected resultPS: Looks like the compiler doesn't currently complain about unrecognized binary operands, but simply defaults to
+
. This might make it hard to distinguish actual RTL bugs from unimplemented compiler functionality (leading to, e.g., incorrect params). Perhaps we should just error out with a "File a bug" message instead?