Short-circuit bitwise-AND and bitwise-OR (Verilog only) #578
Labels
resolution: no fix needed
Closed; no fix required (not a bug)
type: feature-IEEE
Request to add new feature, described in IEEE 1800
Author Name: Jeremy Bennett (@jeremybennett)
Original Redmine Issue: 578 from https://www.veripool.org
Original Date: 2012-11-13
Original Assignee: Jeremy Bennett (@jeremybennett)
The earlier patch for Issue 413 (http://www.veripool.org/issues/413-Verilator-generate-conditional-with-short-circuited-local-expression) implemented short-circuiting in line with the SystemVerilog IEEE 1800-2005 standard, which permits this only for logical OR, logical AND and the conditional operator. Verilog is more permissive, allowing short-circuiting of other operators, notably bitwise-AND and bitwise-OR (the former being used in the Verilog 2001 standard as an example).
This patch implements Verilog short-circuiting for bitwise-AND and bitwise-OR for source files, whose language type is Verilog 1995, Verilog 2001 or Verilog 2005. This can be set using @--language@/@--default-language@ or by the various file extension options, such as @+verilog2001ext+@. This patch builds on the changes in the patch to fix Issue 532 (http://www.veripool.org/issues/532).
Note. I don't have a copy of the Verilog 2005 standard, to check that this still permits such short-circuiting. It is trivial to change the function @isVerilog()@ in @V3Const.cpp@ to restrict to just Verilog 1995 and Verilog 2001 if necessary.
All existing regression tests still pass. Please pull the patch from the verilog-short-circuit branch at https://github.com/jeremybennett/verilator. Note this must be applied after the patch to Issue 532.
The text was updated successfully, but these errors were encountered: