Surya. The LRM states that generate regions are processed after parsing and during elaboration. My interpretation of "parsing" means that the code must at least comply with the BNF, in which both cases do not since 'x' is not a constant_expression. But I don't know if any implementation actually uses the published BNF as is to build their parsers. Dave ________________________________ From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On Behalf Of Surya Pratik Saha Sent: Wednesday, February 21, 2007 8:44 PM To: sv-bc@server.eda-stds.org; sv-ec@server.eda.org Subject: [sv-bc] Semantic check inside generate Hi, Recently I have come across some designs where some invalid semantically wrong verilog code is written in dead/unreachable portion of generate region. LRM is not clear enough which semantic check should be done at elaboration time and which in parsing time. And also different tools are behaving differently in different scenario. I think there should be clear guideline in the LRM to eliminate the whole confusion. Case 1: module top; integer x; generate if (0) begin:b if (x) begin:c end end endgenerate endmodule Here 'x' has to be constant expression but placed in unreachable portion of generate. Synopsys VCS is passing it, but MTI-Vlog is failing. Consider another similar case: module top; integer x; generate if (0) begin:b if (x) begin:c reg[x:0] r; end end endgenerate endmodule For the reg declaration, the 'x' has to be again constant but placed in unreachable portion of generate. But here VCS and Vlog both are failing here. So VCS is not consistent enough to skip all types of semantic checks in generate region. That makes a lot of confusion in parser writing as well as design writing. LRM has to have some words for that. Regards Surya. -- This message has been scanned for viruses and dangerous content by MailScanner <http://www.mailscanner.info/> , and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Thu Feb 22 01:22:50 2007
This archive was generated by hypermail 2.1.8 : Thu Feb 22 2007 - 01:26:01 PST