The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 23rd, 2024, 9:10pm
Pages: 1
Send Topic Print
Delay in Verilog-A (Read 2528 times)
ssdfz
Junior Member
**
Offline



Posts: 13

Delay in Verilog-A
May 14th, 2008, 10:10pm
 
Hi all:

I read Ken's book on Verilog-AMS and it says that delay (using '#’) and wait statements are not allowed. I was just wondering how to achieve a function such as the one below in Verilog-A
     if (condition) begin
         # time;
         statement;
     end
I am kind of clueless in dealing with this situation in verilogA.

Thank you in advance for your invaluable opinions!
Erik
Back to top
 
 
View Profile   IP Logged
jbdavid
Community Fellow
*****
Offline



Posts: 378
Silicon Valley
Re: Delay in Verilog-A
Reply #1 - May 15th, 2008, 3:47am
 
1 way use a timer..
at the event where you want to start the delay you set the timer trigger point..
and then in the timer event you take the second actions.

Alternatively if your second action is something like a transition, the function has a builtin delay value..

or you can filter your continuous output thru an $absdelay filter..
Back to top
 
 

jbdavid
Mixed Signal Design Verification
View Profile WWW   IP Logged
ssdfz
Junior Member
**
Offline



Posts: 13

Re: Delay in Verilog-A
Reply #2 - May 15th, 2008, 9:42am
 
The waveform manipulation that i really wished to do is sth like
@(above(a-b))  //when a>b
   c = V(VDD);
@(above(b-a))  // when b<a
   # 100  (but this is not supported by va)
   c= V(VSS);

The current way I am dealing with this situation is to feed c into a transition filter with asymmetric tr and tf, and then they will cross vth at different time. But I thought there might an efficient way dealing this kind of situation. I am not sure if timer is able to handle that -- it seems to me that it generates periodic event. I will look into it. Thanks for your reply!
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Delay in Verilog-A
Reply #3 - May 15th, 2008, 11:06am
 
Try something like ...
Code:
@(above(a-b))  //when a>b
    c = V(VDD);
@(above(b-a))  // when b<a
    next = $abstime+100*`tick
@(timer(next))
    c= V(VSS); 

where `tick  is defined to contain the time units from `timescale (next and $abstime use seconds).

The timer function generates periodic events only if the second argument is given.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
ssdfz
Junior Member
**
Offline



Posts: 13

Re: Delay in Verilog-A
Reply #4 - May 15th, 2008, 2:01pm
 
Thanks a lot Ken!

It seems that neither hspice nor hsim would accept the syntax "`timescale" (I guess they can just deal with Verilog-A but not Verilog-AMS); I don't know if there is any Synopsys tool will handle Verilog-AMS (only synopsys tools are available to my flow).
So instead of writing "next = $abstime+100*`tick", i wrote something like "next = $abstime+100n".
It functions well but I don't know if they are equivalent in terms of simulator's computation resource.
I am building a Verilog-A model for a system with many blocks, so I am kind of avoiding any expensive command.

Erik
Back to top
 
 
View Profile   IP Logged
ywguo
Community Fellow
*****
Offline



Posts: 943
Shanghai, PRC
Re: Delay in Verilog-A
Reply #5 - May 30th, 2008, 12:40am
 
Hi,

Quote:
or you can filter your continuous output thru an $absdelay filter..  


I tried to delay a voltage input while running a transient simulation. It looks like the following.

Code:
electrical vin;
realy	 vin_delay;
	 vin_delay = absdelay(V(vin),10n); 



The spectre simulator reported the following warning message.
Warning from spectre during AHDL read-in.
    "/export/home/myhome/work_libs/dac_inl_10bit/veriloga/veriloga.va", line 87: Warning: '(abs)delay()" does not account for phase shift in small-signal analysis.

What does that mean?


Thank you in advance.
Yawei

Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Delay in Verilog-A
Reply #6 - May 30th, 2008, 3:51pm
 
It means that using the small signal analyses (AC, XF, noise, etc) on a circuit that contains absdelay will give the wrong results because absdelay does not have an small-signal implementation.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
ywguo
Community Fellow
*****
Offline



Posts: 943
Shanghai, PRC
Re: Delay in Verilog-A
Reply #7 - Jun 1st, 2008, 4:37am
 
Thank you, Ken.


Yawei
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.