The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Modeling >> Behavioral Models >> Modeling a controlled switch for currents
https://designers-guide.org/forum/YaBB.pl?num=1161716309

Message started by topquark on Oct 24th, 2006, 11:58am

Title: Modeling a controlled switch for currents
Post by topquark on Oct 24th, 2006, 11:58am

Hi folks,

I'm new to this community and new also to ahdl modeling in cadence.[schematic-based and not code]
I'm working on behavioral modeling of a simple schmitt-trigger based relaxation oscillator. [See attached pic]
I've modeled the schmitt trigger with "hysteresis" block. I'm stuck up with getting a switch (activated by output of schmitt trigger) to change the direction of current (dis)charging the Cap.

When I use two complementary single-throw switches, "sw" instance from analogLib, I get "no DC path for current source" error during transient run.
I didn't know how to use the "sp2tswitch" which is a 2-throw switch.
Can someone guide me how to get the control for sp2tswitch?


Regards,
Gautham

Title: Re: Modeling a controlled switch for currents
Post by jbdavid on Dec 8th, 2006, 10:48pm

Sorry this is a late response,
In a real circuit, one would add charge Into the cap from the Vdd rail, and take it away to ground..
to a spdt switch would connect one throw to a resistor to Vdd, and the other to a resistor to ground,
in a real transistor circuit, you would aways have a LARGE resistance on both branches, in parallel with the low resistance of the switch while its on..
doing this is EASIER in verilog-A (at least for me) than trying to use someone else's library of elements..
doing macro models always required that I translate the spice netlist into a circuit schematic.. (drawing it out on paper)
which always seemed to require half a day to reverse engineer somebody elses MacroModel.. so while the functional lib was great when I first saw it, spectreHDL was even better, and the STANDARD verilog-A was even better yet!

since you are using cadence, you might find the spectre help facility helpful
just run

Code:
spectre -help



Title: Re: Modeling a controlled switch for currents
Post by jbdavid on Dec 8th, 2006, 10:59pm

then of course, after answering your question, I took a look at the library

Code:
spectre -h switch

reports on the switch element..
sp2tswitch is a symbol for a two pole (ports 0, 1, 2) instance of "switch".

Switch doesn't change its state during a simulation, but rather can have different positions in differnt simulations..

In fact the element you might want to use is in ahdlLib, charge_pump..

this has TWO control nodes, one to put current into, the other to pull current out of, and both off, means no current running.. so you just invert the output of your hysterisis block (making Down = !Up ) and connect these two signals to the charge pump controls..

Of course this is two months later - so maybe you found your answer via a search on her already..



The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.