Hello Geoffrey,
if (V(enable) <= 0) begin @(cross(V(clk), +1)) begin // do something end end
Graham - I can't find where the LRM prevents one from putting an event inside a conditional. It's not mentioned in 6.7 Events. Events are analog statements, so it seems that they should be allowed inside constant-expression conditionals. I think one could disable a cross by shifting the threshold: if (V(enable) > 0) thresh = 1e100; else thresh = 0; @(cross(V(clk) + thresh, +1)) begin // do something end One might need to set thresh to +/- 1e100 based on the current state of the clock if one wants to disable the detection for both positive and negative crossings. It's not as clean and tidy as using a value other than +1/-1/0 to mean "disable detection." -Geoffrey Graham Helwig wrote:Hello Arpad, This is not allowed in the LRM. However, if conditional event control statements were allowed in analog block then it would provide a common mechanism to enable/disable any event function (include digital event functions) within the analog block.Then the big question with conditional event control statements is what to do about the event function's internal state when it is enabled part way through a simulation? Here are my thoughts on the matter. Looking at constant event control statements, they are effectively enabled at time zero along with the rest of the simulation. As a result the first time point (time zero) behavior is different to subsequent time point's behavior because the event functions internal state information is being initialized. For conditional event control statements, the first time point after being disabled can be treated as a initialization time point (like at time zero), the event function are initialized using the current values of from the simulation. Regards Graham Muranyi, Arpad wrote:Can events be disabled by putting them into an IF statement? Or is that not allowed? Thanks, Arpad
-- ========================================================== Graham Helwig AMS Verification Australian Semiconductor Technology Company (ASTC) Pty Ltd Location: 76 Waymouth St, Adelaide, SA, 5000, Australia Phone +61-8-82312782 Moblie: +61-4-03395909 Email: graham.helwig@astc-design.com Web: www.astc-design.com ==========================================================Received on Mon Jun 19 17:51:20 2006
This archive was generated by hypermail 2.1.8 : Mon Jun 19 2006 - 17:51:25 PDT