The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 2:06am
Pages: 1
Send Topic Print
transition filter rise and fall time delay not working as expected (Read 2606 times)
sanforyou
Junior Member
**
Offline



Posts: 17

transition filter rise and fall time delay not working as expected
Jun 21st, 2019, 5:06am
 
Hi,

I have below expressions inside my analog begin block:

  Code:
analog begin

    I(PH,PGND) <+ 100.0p*ddt(V(PH,PGND));
    I(PGND,PH) <+ is*(limexp(V(PGND,PH)/(N*$vt))-1.0) + V(PGND,PH)*1p;

    I(PH,PGND) <+ V(PH,PGND)/transition(LSG_switch,0,500.0p,500.0p);

  end 



As you can see I'm using transition filter to smooth out discrete signal LSG_swith.

However when I plot V(PH,PGND) signal at the output, I see that PH signal is just being delayed by 500p instead of smooth rise/fall time. Could you explain why the transition filter is not working as expected?

I have attached LSG_switch and PH output waveform for your reference. Thanks.
Back to top
 

LSG_switch_and_PH.png
View Profile   IP Logged
sanforyou
Junior Member
**
Offline



Posts: 17

Re: transition filter rise and fall time delay not working as expected
Reply #1 - Jun 21st, 2019, 9:52am
 
Here is what I tried so far to get around above problem I described.
I forced discrete signal LSG_switch to ramp down slowly from high to low with below code inside always block:

Code:
  always @(posedge LSG_sns) begin
	  if(LSG_Weak==1) begin
		 LSG_switch=1.0G+HS_Rdson;
		 #td_LSGWeak //this is just some plain delay before fall time delay begins
		 for (i = 0; i <=count-1; i = i +1) begin
		 	LSG_switch=LSG_switch-(1.0G/20);
			#(tf_LSGWeak/count);
		 end	//for
	  end//if
	  else
       	 LSG_switch = HS_Rdson;
  end 



Code:
analog begin

    I(PH,PGND) <+ 100.0p*ddt(V(PH,PGND));
    I(PGND,PH) <+ is*(limexp(V(PGND,PH)/(N*$vt))-1.0) + V(PGND,PH)*1p;

    I(PH,PGND) <+ V(PH,PGND)/transition(LSG_switch,0,500.0p,500.0p);

  end  



Now I see that LSG switch is ramping down as I expected as shown in the attached screenshot. However I still don't see the same effect on "PH" node waveform. I also tried to take transition filter out but it didn't make any difference.


This code is followed by the same analog begin block as in my original post:

Back to top
 

LSG_switch_and_PH_2.png
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: transition filter rise and fall time delay not working as expected
Reply #2 - Jun 21st, 2019, 9:57pm
 
If you think there is a problem with the transition function, you should show the output of the transition function. Also, you should show the time points that the analog simulator is using.

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



Posts: 17

Re: transition filter rise and fall time delay not working as expected
Reply #3 - Jun 22nd, 2019, 6:45am
 
Hi Ken,
Thanks for the pointer. I updated the code to plot transition filter output. I was wrong, transition filter is giving the rise/fall delay as expected as shown in attached waveforms. Not sure why it is not being reflected in "PH" node output?

analog begin

   I(PH,PGND) <+ 100.0p*ddt(V(PH,PGND));
   I(PGND,PH) <+ is*(limexp(V(PGND,PH)/(N*$vt))-1.0) + V(PGND,PH)*1p;

   ss_test=transition(LSG_switch,0,500.0p,500.0p);
   I(PH,PGND) <+ V(PH,PGND)/ss_test;

 end

As you can see in attached waveforms, I do see some fall time at the end of 500ps delay on PH node. All I want here is total 500ps smooth fall time curve(as seen on 'ss_test' real variable) instead of just 500ps propagation delay.

Also here are the simulator timepoints captured from irun.log:

Code:
    tran: time = 1.257 us    (2.51 %), step = 6.754 ns    (13.5 m%)
    tran: time = 3.846 us    (7.69 %), step = 111.9 ns     (224 m%)
    tran: time = 6.254 us    (12.5 %), step = 191.2 ns     (382 m%)
    tran: time = 8.83 us     (17.7 %), step = 274.7 ns     (549 m%)
    tran: time = 11.42 us    (22.8 %), step = 340.8 ns     (682 m%)
    tran: time = 14.09 us    (28.2 %), step = 369.8 ns     (740 m%)
    tran: time = 16.48 us      (33 %), step = 235.9 ns     (472 m%)
    tran: time = 18.86 us    (37.7 %), step = 198.4 ns     (397 m%)
    tran: time = 21.28 us    (42.6 %), step = 363.6 ns     (727 m%)
    tran: time = 24.15 us    (48.3 %), step = 420.5 ns     (841 m%)
    tran: time = 26.27 us    (52.5 %), step = 423.8 ns     (848 m%)
    tran: time = 28.82 us    (57.6 %), step = 426.7 ns     (853 m%)
    tran: time = 31.39 us    (62.8 %), step = 429.7 ns     (859 m%)
    tran: time = 33.98 us      (68 %), step = 433.6 ns     (867 m%)
    tran: time = 36.6 us     (73.2 %), step = 439.8 ns     (880 m%)
    tran: time = 38.83 us    (77.7 %), step = 450.9 ns     (902 m%)
    tran: time = 41.54 us    (83.1 %), step = 344.2 ns     (688 m%)
    tran: time = 43.95 us    (87.9 %), step = 349.4 ns     (699 m%)
    tran: time = 46.27 us    (92.5 %), step = 32.55 ns    (65.1 m%)
    tran: time = 48.8 us     (97.6 %), step = 192 ns       (384 m%)  



Any further help in debug will be greatly appreciated. Thanks.
Back to top
 

LSG_switch_and_PH_3.png
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: transition filter rise and fall time delay not working as expected
Reply #4 - Jun 22nd, 2019, 4:34pm
 
The progress summary was not at all what I was thinking when I suggested showing the time points. Rather I was expecting that you would select one of your analog signals in the waveform viewer, select Format->Trace->Points and Lines to show the time points on the waveform. In doing so I was expecting that you would see a delay between when LSG_switch changed and when the transition function started changing. That is because you are not controlling the time step in your model. You should have some code like the following to synchronize the time step to the change in LSG_switch:
Code:
reg sync;
always @(LSG_switch)
    sync <= ~sync;

analog begin
    @(posedge sync or negedge sync)
	  ;

    ...
 


Adding that code assures that the analog part of the circuit responds in a timely manner to the changes of digital control signals.

As far as why PH is not responding the way you expected, we cannot help you with that as you are not showing us everything. Your model includes a resistor, capacitor and diode, all in parallel with nothing to drive the circuit. So the voltage should be zero regardless of the the value of LSG_switch. It is not zero, so there must be more to the circuit.

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



Posts: 17

Re: transition filter rise and fall time delay not working as expected
Reply #5 - Jun 23rd, 2019, 7:44am
 
Hi Ken,
I added code you suggested to synchronize the time step when LSG_switch changes but it doesn't seem to make any difference to PH node output.

I have attached waveform showing analog time points to show delay between LSG_switch transition and transition filter output.  I have also attached complete code in case it helps you to find out what might be the issue in the code causing PH node not to transition as expected?
Back to top
 

LSG_switch_and_PH_4.PNG
View Profile   IP Logged
sanforyou
Junior Member
**
Offline



Posts: 17

Re: transition filter rise and fall time delay not working as expected
Reply #6 - Jun 23rd, 2019, 7:47am
 
Part one of the code
Back to top
 

LSG_switch_and_PH_5.PNG
View Profile   IP Logged
sanforyou
Junior Member
**
Offline



Posts: 17

Re: transition filter rise and fall time delay not working as expected
Reply #7 - Jun 23rd, 2019, 7:48am
 
Part 2 of the code
Back to top
 

LSG_switch_and_PH_6.PNG
View Profile   IP Logged
sanforyou
Junior Member
**
Offline



Posts: 17

Re: transition filter rise and fall time delay not working as expected
Reply #8 - Jun 23rd, 2019, 7:49am
 
Part 3 of the code
Back to top
 

LSG_switch_and_PH_7.PNG
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: transition filter rise and fall time delay not working as expected
Reply #9 - Jun 23rd, 2019, 10:01am
 
Sorry, I meant Format->Symbol->Points and Lines.
Back to top
 
 
View Profile WWW   IP Logged
sanforyou
Junior Member
**
Offline



Posts: 17

Re: transition filter rise and fall time delay not working as expected
Reply #10 - Jun 23rd, 2019, 1:41pm
 
Here is how it looks after enabling Format->Symbol->points and lines
Back to top
 

LSG_switch_and_PH_8.PNG
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: transition filter rise and fall time delay not working as expected
Reply #11 - Jun 23rd, 2019, 9:04pm
 
Good there is an analog time point at the time when LSG_switch changes.  So I think the transition function is working properly.

I believe the behavior you are seeing is the actual behavior of the circuit. With ideal switches where the switch resistance sweeps over a very large range that the circuit reacts most strongly at the very end of the range.

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



Posts: 17

Re: transition filter rise and fall time delay not working as expected
Reply #12 - Jun 24th, 2019, 4:52am
 
That's good to know. After your comment I checked decrease in magnitude of transition filter output("ss_test") after LSG_switch goes high to low and I noticed that decrease in magnitude is very small at first few analog time points. It decreases like this: 1e(+09)->8.37e(+08)->5.1e(+08) and so on. That means its still pretty high to make any change to PH node noticeable. However "ss_test" decreases rapidly at the end of 500ps when you actually see the fall time transition on PH node.

All I'm trying to do is to switch PH node similar to "ss_test" because that's how actual transistor schematic behaves. That means I need 'ss_test' to decrease rapidly at the beginning to make PH node transition similar to "ss_test".  Is there a way to achieve this?
Back to top
 
 
View Profile   IP Logged
sanforyou
Junior Member
**
Offline



Posts: 17

Re: transition filter rise and fall time delay not working as expected
Reply #13 - Jun 24th, 2019, 5:42am
 
One more quick question, If I don't use transition filter at all on LSG_switch (as shown in below code) then I still see fall time delay of about 10ps on the PH node high to low transition as shown in the attached waveform. What controls this fall time? Can I change it to a different value?

 analog begin
     //@(posedge LSG_sns)
     //;

Code:
    I(PVIN,PH) <+ 100.0p*ddt(V(PVIN,PH));
    I(PH,PVIN) <+ is*(limexp(V(PH,PVIN)/(N*$vt))-1.0) + V(PH,PVIN)*1p;

    I(PH,PGND) <+ 100.0p*ddt(V(PH,PGND));
    I(PGND,PH) <+ is*(limexp(V(PGND,PH)/(N*$vt))-1.0) + V(PGND,PH)*1p;

    //ss_test=transition(LSG_switch,0,500.0p,500.0p);
    I(PVIN,PH) <+ V(PVIN,PH)/transition(HSG_switch,0,500.0p,500.0p);
    I(PH,PGND) <+ V(PH,PGND)/LSG_switch;
    V(PH_SNS,PGND) <+ V(PH,PGND);
    V(PGND_SNS) <+ V(PGND);
  end 

Back to top
 

LSG_switch_and_PH_9.PNG
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.