The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design Languages >> Verilog-AMS >> detecting discrete events in analog contents https://designers-guide.org/forum/YaBB.pl?num=1172505827 Message started by Pavel on Feb 26th, 2007, 8:03am |
Title: detecting discrete events in analog contents Post by Pavel on Feb 26th, 2007, 8:03am Hello Is there a simple way to detect in analog block every change of bus discrete signal. There is event-insensitive code Code:
When I try transform it in event-sensitive Code:
elaborator generates an error message. Error: analog event control statements require event arguments Regards. Pavel. |
Title: Re: detecting discrete events in analog contents Post by Geoffrey_Coram on Feb 26th, 2007, 9:35am You could try the "cross" function: @(cross(en -vdd/2) or cross(Itrim[0] - vdd/2) or cross(Itrim[1] - vdd/2)) |
Title: Re: detecting discrete events in analog contents Post by Ken Kundert on Feb 26th, 2007, 11:46am Pavel, @cross cannot be applied to logic signals. My experience with AMS Designer is that for some reason it does not support "@(en or Itrim)". Instead you should try "@(posedge en or negedge en or posedge Itrim or negedge Itrim)". -Ken |
Title: Re: detecting discrete events in analog contents Post by Andrew Beckett on Feb 26th, 2007, 3:12pm Ken, That's very surprising. I just tried this: Code:
and it worked perfectly. Admittedly it's a pure digital example, but I'd be rather surprised if it made a difference. Regards, Andrew. |
Title: Re: detecting discrete events in analog contents Post by Ken Kundert on Feb 26th, 2007, 3:33pm Oh yeah, it works fine in Verilog. Try putting the @ statement in an analog block. That is where I would expect you to experience the problem. -Ken |
Title: Re: detecting discrete events in analog contents Post by Pavel on Feb 27th, 2007, 12:18am Geoffrey, Ken, Andrew, Thank you for your responses. But situation still isn't clear. Quote:
en and Itrim are digital signals, but cross is analog function (applied to analog signals) Quote:
Itrim is 4-bit digital bus. Is posedge and negedge work for buses also? Or you mean that one should use posedge or negedge for every bit. But if bus width is 32 or more... In Verilog-AMS LRM on page 157 (ch. 8.3.4) they give types of event expression that could be used in event detection statement in analog block. Among these types they mention digital expression. What does this term mean. I tought that it's just statement that copmpliant with standard Verilog. In standard Verilog statement @(en or Itrim) is valable. Regards. Pavel. |
Title: Re: detecting discrete events in analog contents Post by Geoffrey_Coram on Feb 27th, 2007, 5:03am Pavel wrote on Feb 27th, 2007, 12:18am:
Indeed, I missed that point, and Ken pointed that out. |
Title: Re: detecting discrete events in analog contents Post by Andrew Beckett on Feb 28th, 2007, 6:52am Ken, You're quite right (of course). I've even hit this in the past, so my memory is failing me here... If I do: Code:
Then I get an error during elaboration. If I comment out the @(fred or harry) and uncomment the line after, it all works OK. This is actually mentioned in the Verilog-AMS Reference manual, in the appendix (F) which covers unsupported language features. There's a PCR (351651) asking for this to be implemented. Regards, Andrew. |
Title: Re: detecting discrete events in analog contents Post by Pavel on Mar 2nd, 2007, 3:59am I found approach how to detect bus activity in analog process. It's sufficient to create additional clock that senses whole necessary digital activity, and then employ this clock in analog process. Code:
But simulation results shows something strange (please, see the picture). 1. It seems that i0 isn't taken into account. 2. i_total behavior doesn't correspond to formula in analog process. I commited some mistake in my code or this is a simulator bug? Regards, Pavel. |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |