Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check if a variable exist

Status
Not open for further replies.

menyl

Programmer
Oct 26, 2011
12
NL
HI all,

Im using this awk line to modify my ntlist file :

awk 'BEGIN{FS="[ )(]+"}{print;for(i=1;i<=NF;++i)if($i~/^net[0-9]/)print "R_par("$i" net_lik) res r=1e9"}' input.scs > output.scs

now , there is a new condition that I need to be acount for, as well as the old one (if($i~/^net[0-9]/)),
I need to make sure that $i also exist on a one colum list-file, and only if it does, then I should do the :

print "R_par("$i" net_lik) res r=1e9"}

also, after make sure its there, and doing the: print "R_par(....,
I need to delete it from that list-file ( and there can be more than one with the same name)

I hope I explained myself well enought.

meny
 
Hi

Please note that the Attachment field in the post form is not a file input so it not uploads files. You have to upload it somewhere then copy its URL into the Attachment field. Just specifying "I:\input1.scs" there you not made it accessible for us.


Feherke.
 
this is the input.scs file



// Library name: RFPOC016_fe
// Cell name: RFPOC016_fe_LNA1_ind
// View name: schematic
subckt RFPOC016_fe_LNA1_ind C L1 L2
R2 (L2 net044) rmt l=1.5u w=8u mf=(1)
R1 (net036 L1) rmt l=1.5u w=8u mf=(1)
R3 (net044 C) rm4 l=1.5u w=8u mf=(1)
R4 (C net036) rm4 l=1.5u w=8u mf=(1)
ends RFPOC016_fe_LNA1_ind
// End of subcircuit definition.

// Library name: basicDSP
// Cell name: inv
// View name: schematic
subckt inv I VDD VSS Z
parameters Lp=180.00n Wp=420.00n M_inv=1 Ln=180.00n Wn=420.00n
pmos_0 (Z I VDD VDD) pch l=Lp w=Wp m=1*M_inv ad=Wp/M_inv * 0.48u as=Wp/M_inv * 0.48u pd=2 * Wp/M_inv + 0.96u ps=2 * Wp/M_inv + 0.96u nrd=0.135 nrs=0.135
nmos_0 (Z I VSS VSS) nch l=Ln w=Wn m=1*M_inv ad=Wn/M_inv * 0.48u as=Wn/M_inv * 0.48u pd=2 * Wn/M_inv + 0.96u ps=2 * Wn/M_inv + 0.96u nrd=0.135 nrs=0.135
ends inv
// End of subcircuit definition.

// Library name: spc_rf
// Cell name: rf18tc1_sw1
// View name: schematic
subckt rf18tc1_sw1 I Ngate VDD VSS Z
inv0 (Ngate VDD VSS net8) inv Lp=180.0n Wp=420.0n M_inv=1 Ln=180.0n Wn=420.0n
pmos_0 (I net8 Z VDD) pch l=180.0n w=2u m=4 ad=5.4e-13 as=7.5e-13 pd=2.54u ps=3.75u nrd=0.135 nrs=0.135
nmos_0 (I Ngate Z VSS) nch l=180.0n w=2u m=4 ad=5.4e-13 as=7.5e-13 pd=2.54u ps=3.75u nrd=0.135 nrs=0.135
ends rf18tc1_sw1
// End of subcircuit definition.

// Library name: RF19_fe
// Cell name: RF19_fe_LNA_CurrMirror_apux
// View name: schematic
subckt RF19_fe_LNA_CurrMirror_apux Iref_cs1 RFcon VDD VSS en_bias1_b\<1\> en_bias1_b\<0\> en_bias1_q\<1\> en_bias1_q\<0\> ext_lna
NM3 (Iref_cs1 en_bias1_q\<1\> net92 VSS) nch l=180.0n w=5u m=10 ad=1.35e-12 as=1.56e-12 pd=5.54u ps=6.624u nrd=0.054 nrs=0.054
NM2 (net88 en_bias1_b\<0\> VSS VSS) nch l=180.0n w=3u m=5 ad=9.36e-13 as=9.36e-13 pd=4.224u ps=4.224u nrd=0.09 nrs=0.09
NM1 (net92 en_bias1_b\<1\> VSS VSS) nch l=180.0n w=3u m=5 ad=9.36e-13 as=9.36e-13 pd=4.224u ps=4.224u nrd=0.09 nrs=0.09
NM7 (net92 net92 VSS VSS) nch l=180.0n w=1.5u m=9 ad=4.4e-13 as=4.4e-13 pd=2.25333u ps=2.25333u nrd=0.18 nrs=0.18
NM4 (Iref_cs1 en_bias1_q\<0\> net88 VSS) nch l=180.0n w=5u m=10 ad=1.35e-12 as=1.56e-12 pd=5.54u ps=6.624u nrd=0.054 nrs=0.054
NM6 (net88 net88 VSS VSS) nch l=180.0n w=1.5u m=4 ad=4.05e-13 as=5.625e-13 pd=2.04u ps=3u nrd=0.18 nrs=0.18
NM5 (RFcon1 RFcon1 VSS VSS) nch l=180.0n w=1.5u m=3 ad=5.1e-13 as=5.1e-13 pd=2.68u ps=2.68u nrd=0.18 nrs=0.18
M10 (RFcon1 EXT VSS VSS) nch l=180.0n w=3u m=5 ad=9.36e-13 as=9.36e-13 pd=4.224u ps=4.224u nrd=0.09 nrs=0.09
M0 (RFcon2 RFcon2 VSS VSS) nch l=180.0n w=570.0n m=1 ad=2.736e-13 as=2.736e-13 pd=2.1u ps=2.1u nrd=0.473684 nrs=0.473684
M5 (RFcon2 EXTq VSS VSS) nch l=180.0n w=3u m=5 ad=9.36e-13 as=9.36e-13 pd=4.224u ps=4.224u nrd=0.09 nrs=0.09
PM1 (net88 en_bias1_b\<0\> Iref_cs1 VDD) pch l=180.0n w=5u m=10 ad=1.35e-12 as=1.56e-12 pd=5.54u ps=6.624u nrd=0.054 nrs=0.054
PM0 (net92 en_bias1_b\<1\> Iref_cs1 VDD) pch l=180.0n w=5u m=10 ad=1.35e-12 as=1.56e-12 pd=5.54u ps=6.624u nrd=0.054 nrs=0.054
I27 (ext_lna VDD VSS EXTq) inv Lp=180.0n Wp=1.0u M_inv=1 Ln=180.0n Wn=1.0u
I5 (EXTq VDD VSS EXT) inv Lp=180.0n Wp=1.0u M_inv=1 Ln=180.0n Wn=1.0u
I6 (Iref_cs1 EXT VDD VSS RFcon2) rf18tc1_sw1
I7 (Iref_cs1 EXTq VDD VSS RFcon1) rf18tc1_sw1
I35 (RFcon2 EXT VDD VSS net0101) rf18tc1_sw1
I34 (RFcon1 EXTq VDD VSS net0101) rf18tc1_sw1
//Series configuration of R2
R2_1__dmy0 (net0101 R2_1__dmy0 ) rppo1rpo l=15.66u w=2u m=1
R2_2__dmy0 (R2_1__dmy0 RFcon ) rppo1rpo l=15.66u w=2u m=1
//End of R2

ends RF19_fe_LNA_CurrMirror_apux
// End of subcircuit definition.

// Library name: RF19_fe
// Cell name: RF19_fe_LNA1_half_apux
// View name: schematic
subckt RF19_fe_LNA1_half_apux Cap_attn IND_D1 IND_S1 Iref_cs1 RFIN RFOUT VDD VG1 VG2 VSS en_bias1_b\<1\> en_bias1_b\<0\> en_bias1_q\<1\> en_bias1_q\<0\> en_gc en_tank_q\<1\> en_tank_q\<0\> ext_lna
I21 (Iref_cs1 RFIN VDD VSS en_bias1_b\<1\> en_bias1_b\<0\> en_bias1_q\<1\> en_bias1_q\<0\> ext_lna) RF19_fe_LNA_CurrMirror_apux
M1 (net0147 net0173 VDD VDD) pmos_rf lr=180.0n wr=5.6u nr=18 m=1
M2 (resistor net0169 VDD VDD) pmos_rf lr=180.0n wr=5u nr=50 m=1
R18 (net0114 VDD) rm2 l=1.5u w=1.5u mf=(1)
M16 (IND_D1 VG1 net89 VSS) nmos_rf lr=180.0n wr=5.55u nr=5 m=1
M7 (net97 RFIN IND_S1 VSS) nmos_rf lr=180.0n wr=5.55u nr=25 m=1
M17 (net89 RFIN IND_S1 VSS) nmos_rf lr=180.0n wr=5.55u nr=5 m=1
M3 (IND_D1 VG2 net97 VSS) nmos_rf lr=180.0n wr=5.55u nr=25 m=1
NM0 (Cap_attn VSS RFOUT VSS) nch l=180.0n w=2.5u m=10 ad=6.75e-13 as=7.8e-13 pd=3.04u ps=3.624u nrd=0.108 nrs=0.108
//Series configuration of R9
R9_1__dmy0 (VSS R9_1__dmy0 ) rppo1rpo l=12.68u w=2u m=1
R9_2__dmy0 (R9_1__dmy0 R9_2__dmy0 ) rppo1rpo l=12.68u w=2u m=1
R9_3__dmy0 (R9_2__dmy0 R9_3__dmy0 ) rppo1rpo l=12.68u w=2u m=1
R9_4__dmy0 (R9_3__dmy0 R9_4__dmy0 ) rppo1rpo l=12.68u w=2u m=1
R9_5__dmy0 (R9_4__dmy0 net0147 ) rppo1rpo l=12.68u w=2u m=1
//End of R9

R17 (IND_D1 resistor ) rppo1rpo l=2u w=9.5u m=1

R16 (VSS VSS ) rppo1rpo l=2u w=9.5u m=1

R13 (IND_D1 resistor ) rppo1rpo l=2u w=9.5u m=1

R15 (IND_D1 resistor ) rppo1rpo l=2u w=9.5u m=1

//Series configuration of R0
R0_1__dmy0 (Cap_attn R0_1__dmy0 ) rppo1rpo l=51.79u w=2u m=1
R0_2__dmy0 (R0_1__dmy0 R0_2__dmy0 ) rppo1rpo l=51.79u w=2u m=1
R0_3__dmy0 (R0_2__dmy0 VSS ) rppo1rpo l=51.79u w=2u m=1
//End of R0

R2 (net116 VSS ) rppo1rpo l=2.78u w=2u m=1

R1 (net116 VSS ) rppo1rpo l=2.78u w=2u m=1

R19 (VSS VSS ) rppo1rpo l=2u w=9.5u m=1

R20 (VSS VSS ) rppo1rpo l=2u w=9.5u m=1

inv_0 (en_tank_q\<0\> VDD VSS net0173) inv Lp=180.0n Wp=1.0u M_inv=1 Ln=180.0n Wn=1.0u
inv_1 (en_gc VDD VSS net0169) inv Lp=180.0n Wp=1.0u M_inv=1 Ln=180.0n Wn=1.0u
C4 (IND_D1 net116 VSS) mimcap_shield lt=16.0u wt=5.5u m=1
C0 (RFOUT IND_D1 VSS) mimcap_shield lt=26.0u wt=26.0u m=1
C11 (RFOUT IND_D1 VSS) mimcap_shield lt=26.0u wt=26.0u m=1
C12 (RFOUT IND_D1 VSS) mimcap_shield lt=26.0u wt=26.0u m=1
C26 (VDD net0114 VSS) mimcap_shield lt=6u wt=6u m=1
C2 (VSS VSS VSS) mimcap_shield lt=7.63u wt=7.63u m=1
C1 (VSS VSS VSS) mimcap_shield lt=7.63u wt=7.63u m=1
ends RF19_fe_LNA1_half_apux
// End of subcircuit definition.

// Library name: RF18TC1
// Cell name: RF18TC1_FE_LNA_NotX2
// View name: schematic
subckt RF18TC1_FE_LNA_NotX2 VDD VSS en en_b en_q
inv_0 (en VDD VSS en_b) inv Lp=180.00n Wp=420.00n M_inv=1 Ln=180.00n Wn=420.00n
inv_1 (en_b VDD VSS en_q) inv Lp=180.00n Wp=420.00n M_inv=1 Ln=180.00n Wn=420.00n
ends RF18TC1_FE_LNA_NotX2
// End of subcircuit definition.

// Library name: meny_test
// Cell name: RF19_fe_LNA1_apux
// View name: schematic
RFPOC016_fe_LNA1_ind_0 (VDD net156 net141) RFPOC016_fe_LNA1_ind
RFPOC016_fe_LNA1_half_0 (net157 net156 IND_S1_N Iref_cs1 RFIN_N RFOUT_N VDD VG1 VG2 VSS en_bias1_b\<1\> en_bias1_b\<0\> en_bias1_q\<1\> en_bias1_q\<0\> en_gc_q en_tank_q\<1\> en_tank_q\<0\> ext_lna) RF19_fe_LNA1_half_apux
RFPOC016_fe_LNA1_half_1 (net142 net141 IND_S1_P Iref_cs1 RFIN_P RFOUT_P VDD VG1 VG2 VSS en_bias1_b\<1\> en_bias1_b\<0\> en_bias1_q\<1\> en_bias1_q\<0\> en_gc_q en_tank_q\<1\> en_tank_q\<0\> ext_lna) RF19_fe_LNA1_half_apux
M4 (net107 ENB VDD VDD) pch l=180.0n w=2u m=1 ad=9.6e-13 as=9.6e-13 pd=4.96u ps=4.96u nrd=0.135 nrs=0.135
PM0 (Iref_1 ENB Iref_cs1 VDD) pch l=180.0n w=4u m=1 ad=1.92e-12 as=1.92e-12 pd=8.96u ps=8.96u nrd=0.0675 nrs=0.0675
PM1 (net111 ENB VDD VDD) pch l=180.0n w=2u m=1 ad=9.6e-13 as=9.6e-13 pd=4.96u ps=4.96u nrd=0.135 nrs=0.135
NM2 (Iref_1 EN Iref_cs1 VSS) nch l=180.0n w=4u m=1 ad=1.92e-12 as=1.92e-12 pd=8.96u ps=8.96u nrd=0.0675 nrs=0.0675
NM0 (Iref_cs1 ENB VSS VSS) nch l=180.0n w=4u m=2 ad=1.92e-12 as=1.92e-12 pd=8.96u ps=8.96u nrd=0.0675 nrs=0.0675
NM1 (VG1 ENB VSS VSS) nch l=180.0n w=12.0u m=2 ad=5.76e-12 as=5.76e-12 pd=24.960u ps=24.960u nrd=0.0225 nrs=0.0225
M6 (VG2 ext_lna VSS VSS) nch l=180.0n w=12.0u m=2 ad=5.76e-12 as=5.76e-12 pd=24.960u ps=24.960u nrd=0.0225 nrs=0.0225
RF18TC1_FE_LNA_NotX2_1 (VDD VSS en_gc net90 en_gc_q) RF18TC1_FE_LNA_NotX2
RF18TC1_LNA_NotX2_0 (VDD VSS en_bias1\<1\> en_bias1_b\<1\> en_bias1_q\<1\>) RF18TC1_FE_LNA_NotX2
RF18TC1_FE_LNA_NotX2_2 (VDD VSS en_tank\<0\> net85 en_tank_q\<0\>) RF18TC1_FE_LNA_NotX2
RF18TC1_FE_LNA_NotX2_0 (VDD VSS en_tank\<1\> net124 en_tank_q\<1\>) RF18TC1_FE_LNA_NotX2
RF18TC1_LNA_NotX2_1 (VDD VSS en_bias1\<0\> en_bias1_b\<0\> en_bias1_q\<0\>) RF18TC1_FE_LNA_NotX2
//Series configuration of R3
R3_1__dmy0 (net0142 R3_1__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R3_2__dmy0 (R3_1__dmy0 R3_2__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R3_3__dmy0 (R3_2__dmy0 R3_3__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R3_4__dmy0 (R3_3__dmy0 R3_4__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R3_5__dmy0 (R3_4__dmy0 net0138 ) rppo1rpo l=62.23u w=2u m=1
//End of R3

//Series configuration of R5
R5_1__dmy0 (net0140 R5_1__dmy0 ) rppo1rpo l=46.51u w=2u m=1
R5_2__dmy0 (R5_1__dmy0 net0142 ) rppo1rpo l=46.51u w=2u m=1
//End of R5

//Series configuration of R9
R9_1__dmy0 (net0138 R9_1__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R9_2__dmy0 (R9_1__dmy0 R9_2__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R9_3__dmy0 (R9_2__dmy0 R9_3__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R9_4__dmy0 (R9_3__dmy0 R9_4__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R9_5__dmy0 (R9_4__dmy0 VSS ) rppo1rpo l=62.23u w=2u m=1
//End of R9

//Series configuration of R15
R15_1__dmy0 (net113 R15_1__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R15_2__dmy0 (R15_1__dmy0 R15_2__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R15_3__dmy0 (R15_2__dmy0 R15_3__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R15_4__dmy0 (R15_3__dmy0 R15_4__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R15_5__dmy0 (R15_4__dmy0 VSS ) rppo1rpo l=62.23u w=2u m=1
//End of R15

//Series configuration of R1
R1_1__dmy0 (VG1 R1_1__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R1_2__dmy0 (R1_1__dmy0 R1_2__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R1_3__dmy0 (R1_2__dmy0 R1_3__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R1_4__dmy0 (R1_3__dmy0 R1_4__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R1_5__dmy0 (R1_4__dmy0 net115 ) rppo1rpo l=62.23u w=2u m=1
//End of R1

//Series configuration of R17
R17_1__dmy0 (VG2 R17_1__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R17_2__dmy0 (R17_1__dmy0 R17_2__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R17_3__dmy0 (R17_2__dmy0 R17_3__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R17_4__dmy0 (R17_3__dmy0 R17_4__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R17_5__dmy0 (R17_4__dmy0 net113 ) rppo1rpo l=62.23u w=2u m=1
//End of R17

//Series configuration of R7
R7_1__dmy0 (net103 R7_1__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R7_2__dmy0 (R7_1__dmy0 R7_2__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R7_3__dmy0 (R7_2__dmy0 R7_3__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R7_4__dmy0 (R7_3__dmy0 R7_4__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R7_5__dmy0 (R7_4__dmy0 net101 ) rppo1rpo l=62.23u w=2u m=1
//End of R7

//Series configuration of R6
R6_1__dmy0 (net99 R6_1__dmy0 ) rppo1rpo l=46.51u w=2u m=1
R6_2__dmy0 (R6_1__dmy0 net103 ) rppo1rpo l=46.51u w=2u m=1
//End of R6

//Series configuration of R16
R16_1__dmy0 (net107 R16_1__dmy0 ) rppo1rpo l=46.51u w=2u m=1
R16_2__dmy0 (R16_1__dmy0 VG2 ) rppo1rpo l=46.51u w=2u m=1
//End of R16

//Series configuration of R2
R2_1__dmy0 (net115 R2_1__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R2_2__dmy0 (R2_1__dmy0 R2_2__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R2_3__dmy0 (R2_2__dmy0 R2_3__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R2_4__dmy0 (R2_3__dmy0 R2_4__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R2_5__dmy0 (R2_4__dmy0 VSS ) rppo1rpo l=62.23u w=2u m=1
//End of R2

//Series configuration of R0
R0_1__dmy0 (net111 R0_1__dmy0 ) rppo1rpo l=46.51u w=2u m=1
R0_2__dmy0 (R0_1__dmy0 VG1 ) rppo1rpo l=46.51u w=2u m=1
//End of R0

//Series configuration of R8
R8_1__dmy0 (net101 R8_1__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R8_2__dmy0 (R8_1__dmy0 R8_2__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R8_3__dmy0 (R8_2__dmy0 R8_3__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R8_4__dmy0 (R8_3__dmy0 R8_4__dmy0 ) rppo1rpo l=62.23u w=2u m=1
R8_5__dmy0 (R8_4__dmy0 VSS ) rppo1rpo l=62.23u w=2u m=1
//End of R8

C0 (net142 net157) mimcap l=12.0u w=12.0u m=1
C1 (net157 net142) mimcap l=12.0u w=12.0u m=1
R10 (VSS net0140) rm1 l=230n w=230n mf=(1)
R4 (VSS net99) rm1 l=230n w=230n mf=(1)
simulatorOptions options reltol=1e-3 vabstol=1e-6 iabstol=1e-12 temp=27 tnom=27 scalem=1.0 scale=0.9 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 digits=5 cols=80 pivrel=1e-3 ckptclock=1800 sensfile="../psf/sens.output" checklimitdest=psf
dcOp dc write="spectre.dc" maxiters=150 maxsteps=10000 annotate=status
dcOpInfo info what=oppoint where=rawfile
modelParameter info what=models where=rawfile
element info what=inst where=rawfile
outputParameter info what=output where=rawfile
designParamVals info what=parameters where=rawfile
primitives info what=primitives where=rawfile
subckts info what=subckts where=rawfile
saveOptions options save=allpub


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

this is the list-file


net044
net036
net044
net036
net8
net8
net92
net88
net92
net92
net92
net88
net88
net88
net88
net92
net0101
net0101
net0101
net0147
net0173
net0169
net0114
net89
net97
net89
net97
net0147
net116
net116
net0173
net0169
net116
net0114
net156
net141
net157
net156
net142
net141
net107
net111
net90
net85
net124
net0142
net0138
net0140
net0142
net0138
net113
net115
net113
net103
net101
net99
net103
net107
net115
net111
net101
net142
net157
net157
net142
net0140
net99







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top