help-gnucap
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gnucap] Time step control


From: a r
Subject: Re: [Help-gnucap] Time step control
Date: Mon, 3 Dec 2007 13:17:57 +0000

Hi,

I have tested it and all the edges of the pulse waveform are now
modeled precisely. However, there are still some issues:

1. there is something wrong with the pulse formula:
"pulse (0 2.5 2.5n 0.01n 0.01n 1.48n 3n)" does not generate 1.48n
width pulses. I will look into it later.
2. (this seems more critical) time step is not decreased (or not
decreased enough) when the transition occurs. Sure, additional events
are added but all devices (bsim3) driven by this signal are not
modeled exactly.

Below is the file I used for testing:

BTW, the plugin system works great.

* inverter test

.include TSMC_025u_Mosis.txt

.subckt inv vdd vss out in
Mp out in vdd vdd CMOSP l=0.25u w=1.5u
Mn out in vss vss CMOSN l=0.25u w=0.9u
.ends inv

.parameter p_vdd=2.5

vvdd vdd vss 'p_vdd'
vvss vss 0 0

vck in vss pulse (0 'p_vdd' 2.5n 0.01n 0.01n 1.48n 4.5n)

xi1 vdd vss n1 in inv
xi2 vdd vss n2 n1 inv
xi3 vdd vss n3 n2 inv
xi4 vdd vss n4 n3 inv

.option acct
*.option method=euler dtmin=1e-16 reltol=1e-4 itl3=3 itl4=4
.option method=euler dtmin=1e-16 reltol=1e-4

.probe tran v(nodes)

.dc

.tran 1n 20n trace alltime >inv_test.dat
*.tran 0.001n 20n trace alltime >inv_test.dat

.END

-r.

On Dec 3, 2007 7:11 AM, al davis <address@hidden> wrote:
> On Saturday 01 December 2007, al davis wrote:
> > I will look at it in the next few days.
>
> Try this .....
>
> If you have the development snapshot you can do it without recompiling
> the whole simulator.  Otherwise you need to recompile.
>
> Copy the file bm_pulse.cc to a place where you can play with it.
>
> In the file "bm_pulse.cc" ... replace this function:
> /*--------------------------------------------------------------------------*/
> void EVAL_BM_PULSE::tr_eval(ELEMENT* d)const
> {
>   double time = SIM::time0;
>   if (0 < _period && _period < BIGBIG) {
>     time = fmod(time,_period);
>   }
>   double time_offset = SIM::time0 - time;
>
>   double ev = 0; // effective value
>   if (time >= _delay+_rise+_width+_fall) {      /* past pulse   */
>     ev = _iv;
>     SIM::new_event(_period + time_offset);
>   }else if (time >= _delay+_rise+_width) {      /* falling      */
>     double interp = (time - (_delay+_rise+_width)) / _fall;
>     ev = _pv + interp * (_iv - _pv);
>     SIM::new_event(_delay + _rise + _width + _fall + time_offset);
>   }else if (time >= _delay + _rise) {           /* pulse val    */
>     ev = _pv;
>     SIM::new_event(_delay + _rise + _width + time_offset);
>   }else if (time >= _delay) {                   /* rising       */
>     double interp = (time - _delay) / _rise;
>     ev = _iv + interp * (_pv - _iv);
>     SIM::new_event(_delay + _rise + time_offset);
>   }else{                                        /* init val     */
>     ev = _iv;
>     SIM::new_event(_delay + time_offset);
>   }
>
>   tr_finish_tdv(d, ev);
> }
> /*--------------------------------------------------------------------------*/
>
> Now, compile this file .....
>
> g++ -fPIC --shared -I <path_to_gnucap_source> bm_pulse.cc -o bm_pulse.so
>
> Now, bm_pulse.o is a plugin that should fix your problem.
>
> You can manually attach it:
>
> gnucap>  attach ./bm_pulse.so
>
> or ..  if you are running in batch mode, you can do it on the command line:
>
> $$ gnucap -a ./bm_pulse.so -b .......
>
> Try it!!
>
>
> This is not the "permanent" fix, but it should help for now.
>
> You can manually force a time step any time by calling
> the function SIM::new_event(time_of_event) .
>
>
>
>
> _______________________________________________
> Help-gnucap mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gnucap
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]