Hi all, I agree that the LRM section 8.2.2 is not clear, but I would say that from BNF/language point of view, any declaration happening inside named scope of either digital or analog blocks should belong to that domain, which means that this should be assigned in the same domain. So in the example below x would be an analog variable and the assignment in the digital block would (should) be illegal. This needs to be added to that section of scoping rules etc. To deviate a bit further from the particular issue at hand: In terms of scope, the only confusion (from a language point of view, due to lack/incorrect specification), is when a variable is declared at a module scope and not assinged at all. This variable can be assigned through an inout of an function etc... This will also happen with the current version of LRM 2.2, where assignments are part of the declaration itself. Module blackbox; Real x = 10; ... Endmodule In the above case, the assignment is not in either context, and can be accessed in both the context. However, in this regard, I agree with Kevin, in the sense it shouldnt matter whether its analog or digital - the variable just holds a state which can be accessed from either blocks. We need to better clarify these situations also in the LRM, because currently 8.2.2 is bit misleading. Another aside from a hierarchical usage point of view (in my opinion): From a software/language point of view, I don't think local variables declared in a different scope should be allowed to be assigned outside that scope (using hierarchical identifiers as an lvalue). Infact hierarchical on the left-hand-side, in my opinion, should not be allowed (however I realize the 1364-2005 allows this). V(blackbox.a1.br1) <+ 10 (or) blackbox.a1.x = 10; Cheers, Sri -----Original Message----- From: Bakalar, Kenneth [mailto:kenneth_bakalar@mentorg.com] Sent: Friday, 18 February 2005 3:40 AM To: Geoffrey.Coram; Chandrasekaran Srikanth-A12788; VerilogAMS Reflector Subject: RE: analog vs digital domains of variables Sri, Is it legal to declare a variable in one analog block, and then to assign to it in another analog block in another module (using an hierarchical name)? I hope not, but I don't see where in the LRM it is forbidden. Ken -----Original Message----- From: owner-verilog-ams@eda.org [mailto:owner-verilog-ams@eda.org] On Behalf Of Geoffrey.Coram Sent: Thursday, February 17, 2005 11:10 AM To: Chandrasekaran Srikanth-A12788; VerilogAMS Reflector Subject: analog vs digital domains of variables Hi, Sri - A certain commercial simulator started complaining about variables in my Verilog-A module that were declared but not assigned a value. The simulator took the view that if the variable is not assigned a value in the analog block (the analog context), then it is a digital variable. However, in this case, the variable was *declared* in a named block in the analog block. Is it not clear in this case that the variable belongs in the analog domain? Is it legal to declare a variable in the analog block and then assign a value to it in a digital context? If not, then should section 8.2.2 explictly say the domain is determined by where the variable is declared, or if declared at module scope, by where it is assigned. module am_i_legal(a); inout a; electrical a; analog begin : the_analog_block real x; V(a) <+ x; end initial begin the_analog_block.x=1; end endmodule -GeoffreyReceived on Fri, 18 Feb 2005 10:15:17 +1030
This archive was generated by hypermail 2.1.8 : Thu Feb 17 2005 - 15:46:54 PST