[SOLVED] Using .alter and .param in HSpice

Status
Not open for further replies.

r_usso

Newbie level 6
Joined
Jun 24, 2009
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,354
Hello everyone,

I have written the following code for my classwork.

Code:
*CMOS NOT Gate

****************************************************

.OPTION POST
.INCLUDE 'C:\synopsys\NangateOpenCellLibrary_PDKv1_3_v2009_07\technology\models\hspice\hspice_nom.include'

****************************************************

*Global nodes

.GLOBAL VDD
.GLOBAL VSS

****************************************************

.param 	SUPPLY	= 0.85V
.param 	Wn 		= 0.415u
+		Wp 		= 0.630u
+		Lnp		= 0.05u

****************************************************

*Stimuli

VG VSS 0 0
Vdd VDD VSS 	'SUPPLY'
Va	a 	VSS 	PULSE (0 'SUPPLY' 20ps 20ps 20ps 220ps 1000ps)



****************************************************

*subcircuits


.SUBCKT INV_X1 A ZN VDD VSS 
*.PININFO A:I ZN:O VDD:P VSS:G 
*.EQN ZN=!A
M_i_0 ZN A VSS VSS NMOS_VTL W=Wn L=Lnp
M_i_1 ZN A VDD VDD PMOS_VTL W=Wp L=Lnp
.ENDS 


***************************************************
*main circuit

Xinvert 	a 	out		VDD 	VSS		INV_X1

***************************************************

* Anlysis Options

.measure TRAN 	RiseDelay	TRIG v(a) 	td=20ps	VAL='SUPPLY/2' CROSS=1
+ 							TARG v(out) td=20ps	VAL='SUPPLY/2' CROSS=1

.measure TRAN	FallDelay	TRIG v(a) 	td=60ps	VAL='SUPPLY/2' CROSS=1
+ 							TARG v(out) td=60ps	VAL='SUPPLY/2' CROSS=1

.measure TotalParameterDelay param	='(RiseDelay+FallDelay)/2'


.TRAN 1ps 1000ps  START=0ps



****************************************************

.alter 	Case 1: Change Temperature 
.TRAN 1PS 1000PS UIC SWEEP TEMP 25 125 10

.alter 	Case 2: Change Voltage 
.tran 1ns 10US UIC SWEEP SUPPLY 0.85 1.35 0.05

.alter Case 3: Varying Width and Length 
.param Wp = '2*Wn'	Wn = '0.5*Wp'	Lnp = 0.045


.END



I have 2 questions.

1. How do I vary the Wp so that it will automatically vary from for example 0.400u to 0.430u?
2. After case 2, case 3 doesn't run.

Any suggestion is highly appreciated.

- - - Updated - - -

I have solved the problem 2. Please help me with problem 1.
 
Last edited by a moderator:

1. How do I vary the Wp so that it will automatically vary from for example 0.400u to 0.430u?
2. After case 2, case 3 doesn't run.

- - - Updated - - -

I have solved the problem 2. Please help me with problem 1.

I guess this should work:
Code:
.alter Case 3: Varying Width
.param Wn = '0.5*Wp'	Lnp = 45n
.tran 1ns 10us UIC SWEEP Wp 400n 430n 5n
 
Reactions: r_usso

    r_usso

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…