The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 4:33pm
Pages: 1
Send Topic Print
how to monitor analog signal using verilog-ams (Read 2964 times)
xuedashun
Junior Member
**
Offline



Posts: 18

how to monitor analog signal using verilog-ams
Dec 02nd, 2011, 8:22am
 
If I have 3 analog blocks: AAA BBB CCC, AAA is toplevel block, BBB is inside AAA and CCC is inside BBB block, if these is an analog signal called as xxx in CCC, now I want to monitor the xxx signal in another block (verilogams), how to do this in verilogasm?

I know if they are digital, we can use assignment to do it
wire xxx_monitor  =   AAA.BBB.CCC.xxx;

I read the Ken Kundert's book: The Designer's Guide to Verilog-AMS, but did not find which command or function I can use in verilogams.

Could you give me some suggestions? Thank you!
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: how to monitor analog signal using verilog-ams
Reply #1 - Dec 5th, 2011, 1:13pm
 
I would expect you could do
 real xxx_monitor;

 xxx_monitor = V(AAA.BBB.CCC.xxx);

but you'll have to write some kind of function to decide if the value has changed "enough" to warrant printing.  A digital $monitor isn't appropriate for an analog value, which will change by tiny amounts (every iteration of) every timestep.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Marq Kole
Senior Member
****
Offline

Hmmm. That's
weird...

Posts: 122
Eindhoven, The Netherlands
Re: how to monitor analog signal using verilog-ams
Reply #2 - Jan 17th, 2012, 5:41am
 
Use the absdelay event function if you're using Cadence tooling (it is a Cadence propietary extension).

Code:
real xxx_monitor;

always
  @(absdelay(V(AAA.BBB.CCC.xxx), 10m))
    xxx_monitor = V(AAA.BBB.CCC.xxx);
 



For non-Cadence tooling you can do the same but using the above event function:

Code:
real xxx_monitor;

always
  @(above(abs(V(AAA.BBB.CCC.xxx) - xxx_monitor) - 10m))
    xxx_monitor = V(AAA.BBB.CCC.xxx);
 



Cheers,
Marq
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.