# How do I measure power consumed in a subcircuit in TSpice?

Status
Not open for further replies.

#### saritac

##### Newbie level 3
TSpice help

Hi,
I have started using TSpice recently. How do I measure power consumed in a subcircuit and not the complete circuit, when I use a single voltage source.

Thanks

#### goodboy_pl

##### Full Member level 5
Re: TSpice help

I Think this solution is general for all spice simulators:
u can define VCC/GND pins for each subckt and use current probe in each subckt to measure the supply current and use a simple function in waveform editor to see the power level.
in this way your ckt is ready for other simulation like dependency to supply/GND noise in each sub block and finding sensitive blocks.

BEST!

shilpa.katre

### shilpa.katre

Points: 2

#### saritac

##### Newbie level 3
Re: TSpice help

Hi,
thanks a lot for replying back.

My problem is the part of the circuit for which I want power is not connected to Vdd directly. It is fed through output of another block which may have a Vdd. But I don't want the power drawn from that block in my result.

Thanks again

#### vardan

##### Member level 1
Re: TSpice help

Hi!
For general case insert a zero voltage-source in your subcircuit's input. Then measure power. Other variants are possible too.
See example below.

* Power measurement
.model cmosn NMOS VTO= .7 KP=25U LAMBDA=.01 GAMMA=.5 PHI=.5
.model cmosp PMOS VTO=-.7 KP=10U LAMBDA=.01 GAMMA=.5 PHI=.5
M1n in Vdd gout Gnd cmosn L=.5u W=20u
M1p in Gnd gout Vdd cmosp L=.5u W=20u
Vdd Vdd 0 3
Vzero gout out 0
Vin in GND PULSE (0 3 0 1n 1n 98n 200n)
.tran .1n 250n
.print P3<W>='(-is(M1n)-is(M1p))*v(gout)' ; inward current is positive!
.power Vzero ; You can see report at the end of *.out file
.end

Vardan

Status
Not open for further replies.