gnucap-devel
[Top][All Lists]
Advanced

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

Re: [Gnucap-devel] gnucap and python


From: a r
Subject: Re: [Gnucap-devel] gnucap and python
Date: Sat, 24 Mar 2007 15:56:26 +0900

On 3/24/07, al davis <address@hidden> wrote:

Use only the CMD::command(string) interface.  Since your plugin
will be a class derived from CMD, you can just do
command("string").

This sounds like a good low-level API. But from a convenient python
wrapper I would expect a bit higher level of abstraction.

How about building class hierarchy? Let me know what do you thing
about following sketch.

from Gnucap import Tran, NetGnucap, Wave, AsciiTabular, Measure
(exception should be thrown if some commands are not available)

net = NetGnucap.get("aCircuitFile")
net.xsubckt1.setBlockName("block2")
net.xsubckt1.MMload.setParam("w", 10e-6)

out = Wave(step=1e-6)
out.save(net.xsubckt1.net1, net.xsubckt1.net2)
out.setFormat(AsciiTabular())

sim = Tran(netlist = net, start=0, end=1e-3, output=out)
(or)
sim = Tran(net, out)
sim.setStart(0)
sim.setEnd(1e-3)

results = sim.run()

meas = Measure(results)

(ttrig, vtrig) = meas.tcross(signal=net.subckt1.net2,
threshold=net.subckt1.net1, direction=meas.rising, count=1)
print meas.avg(net.xsubckt1.net1, from=ttrig, to=(ttrig+0.1e-3))

-R.




reply via email to

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