The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 27th, 2024, 7:25am
Pages: 1
Send Topic Print
Modeling a controlled switch for currents (Read 7170 times)
topquark
Community Member
***
Offline



Posts: 61
Thames Valley, UK
Modeling a controlled switch for currents
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
Back to top
 

osc_002.jpg
View Profile   IP Logged
jbdavid
Community Fellow
*****
Offline



Posts: 378
Silicon Valley
Re: Modeling a controlled switch for currents
Reply #1 - 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 



Back to top
 
 

jbdavid
Mixed Signal Design Verification
View Profile WWW   IP Logged
jbdavid
Community Fellow
*****
Offline



Posts: 378
Silicon Valley
Re: Modeling a controlled switch for currents
Reply #2 - 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..


Back to top
 
 

jbdavid
Mixed Signal Design Verification
View Profile WWW   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.