This should be legal. The requirement for packages is that they not have references outside of themselves. A $unit prefix to itself should be fine. If you would wrap a "package pkg; ... endpackage" around the non-module declarations and use the "pkg::" instead of $unit that would also be Ok. The resolution of names into $unit is still being worked on and there are many other clarifications to name resolution in the 2008 draft. Tools likely have bugs and/or inconsistencies at this point due to uncertainty in what to do with the ambiguities in the 2005 LRM. Gord. Surya Pratik Saha wrote: > Hi, > As per SV LRM, any reference of outside the package is error. But > consider the case: > > const int k = 258; > typedef enum int {FALSE=0, TRUE} mbool; > function int f(input int x ); > return (x ^ $unit::k); // <---- is it an error? > endfunction > > module top; > endmodule > > Where $unit is used inside the compilation unit (which is also a > package). Is it legal? Some tools fail the case. I don't think this is > invalid. > -- -------------------------------------------------------------------- Gordon Vreugdenhil 503-685-0808 Model Technology (Mentor Graphics) gordonv@model.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Dec 19 06:52:37 2007
This archive was generated by hypermail 2.1.8 : Wed Dec 19 2007 - 06:54:33 PST