Subject: BNF question
From: Tom Fitzpatrick (fitz@co-design.com)
Date: Wed Apr 17 2002 - 08:01:23 PDT
Hi Gang,
Is this legal?
module top;
integer foo;
bit a;
task mytask(input logic[99:0] mya);
...
endtask
initial
mytask( {foo{a}} ); // multiple concat with non-constant replication
endmodule
According to both the 1364-2001 bnf and Stefen's new bnf, the argument to a
task can be an "expression", which includes a "primary." The "primary"
includes a "multiple_concatenation," but that only allows for a
"constant_expression" as the replication specifier.
The "{foo{a}}" expression in my example falls under the definition of
"variable_concatenation" in both BNFs. The only place I can find this used
is as a subterm of "variable_lvalue_item" which is restricted to being on
the LHS of an assignment, the target of a force(/etc.), or an
increment/decrement expression. Therefore, I conclude that my above example
should be illegal.
Unfortunately, a customer has run this on XL and NC, and they both allow it.
Can someone with access to these simulators verify this (and maybe check VCS
too)? Should it be an error? If not, then I fear that Stefen has more work
to do 8-).
Thanks,
-Tom
------------------------------------------------------
Tom Fitzpatrick
Director of Technical Marketing
Co-Design Automation, Inc.
------------------------------------------------------
Email: fitz@co-design.com Mobile: (978)337-7641
Tel: (978)448-8797 Fax: (561)594-3946
Web: www.co-design.com
www.superlog.org
------------------------------------------------------
SUPERLOG = Faster, Smarter Verilog
------------------------------------------------------
This archive was generated by hypermail 2b28 : Wed Apr 17 2002 - 08:02:20 PDT