leonardt / fault

A Python package for testing hardware (part of the magma ecosystem)
BSD 3-Clause "New" or "Revised" License
41 stars 13 forks source link

Nested compile guards #269

Closed leonardt closed 4 years ago

leonardt commented 4 years ago

Allows the user to provide a list of compile guards (useful if some properties should require two defines). We can't use && inside ifdef so we have to generate nested ifdef statements.

rsetaluri commented 4 years ago

actually we can do

#if defined(COND1) && defined(COND2)
...
#endif 

same for ||, !. #ifdef is just shorthand.

See https://www.cs.auckland.ac.nz/references/unix/digital/AQTLTBTE/DOCU_078.HTM for full spec.

leonardt commented 4 years ago

that looks like documentation for C code, is verilog the same?

rsetaluri commented 4 years ago

oops, for some reason I thought this was C/C++ code for verilator. yeah came to the same conclusion as you for verilog.