Eberhard2010
Newbie level 2
- Joined
- Feb 26, 2013
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,316
Hallo,
I try to get some basic simulation variables into the .mt0 measurement file. Therefore I use the .meas statement in spectre. As I parse mt0 file afterwards with C++, I don't want to go to another file like "print", the raw-folder with the psf inside or something like that to obtain the parameters I need. Consequently the C++ prog would be not portable to other simulators anymotr and would lead to have specialized C++ code for spectre.
So how I get instance parameters into the .measure file?
Here is my short example I use currently. Just plain spectre, with mdlControl in background.
<<<Inc File INVX1>>>
simulator lang=spectre
subckt INVX1 (INP ZN VDD GND)
parameters gatew=100 gateh=20
M1 ZN INP GND GND nmos
M2 ZN INP VDD VDD pmos
ends INVX1
>>>>>>>>>>>>>>
<<<<inc Measure File measureINV.inc >>>>
simulator lang=spice
.param area='par(X1.gatew)*par(X1.gateh)'
.meas tran cell_area param='area'
>>>>>>>>>>>>>>>>>>
<<<<Main File>>>>>>>>>
simulator lang=spectre
finalTimeOP 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
*Include Subcircuits
include "../cell_templates/INVX1.scs"
*Main Netlist
X1 GND ZN VDD GND INVX1
*Voltage Sources
VDD_source (VDD GND) vsource dc=15 type=dc
*Output Load
Cload (ZN GND) capacitor c=1
include "../circuit_stimuli/measureINV.inc"
*Do the tran Analysis
tran0 tran stop=5e-6
>>>>>>>>>>>>>>>>>>>>>>>>>>>
The simulation is running fine.
The problem arises with ".meas tran cell_area param='area' " line as the MDL-Control tries to evaluate the expression par(X1.gatew)*par(X1.gateh). Without this .meas line, it's running fine and the expression is not giving any error. I tried first to place in the expression directly into .measure, but gives the same error:
Error found by spectre during transient analysis `transient1', during task `MDLControl'.
ERROR: Unknown parameter name `X1.gateh' found in expression.
ERROR: validate object failure -- parameter or terminal 'area' not found in specified scope
ERROR: line `70': MDL expression for identifier 'cell_area' can not be evaluated due to previous errors.
Any suggestions to fix this syntax problem?
Regards Eberhard
I try to get some basic simulation variables into the .mt0 measurement file. Therefore I use the .meas statement in spectre. As I parse mt0 file afterwards with C++, I don't want to go to another file like "print", the raw-folder with the psf inside or something like that to obtain the parameters I need. Consequently the C++ prog would be not portable to other simulators anymotr and would lead to have specialized C++ code for spectre.
So how I get instance parameters into the .measure file?
Here is my short example I use currently. Just plain spectre, with mdlControl in background.
<<<Inc File INVX1>>>
simulator lang=spectre
subckt INVX1 (INP ZN VDD GND)
parameters gatew=100 gateh=20
M1 ZN INP GND GND nmos
M2 ZN INP VDD VDD pmos
ends INVX1
>>>>>>>>>>>>>>
<<<<inc Measure File measureINV.inc >>>>
simulator lang=spice
.param area='par(X1.gatew)*par(X1.gateh)'
.meas tran cell_area param='area'
>>>>>>>>>>>>>>>>>>
<<<<Main File>>>>>>>>>
simulator lang=spectre
finalTimeOP 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
*Include Subcircuits
include "../cell_templates/INVX1.scs"
*Main Netlist
X1 GND ZN VDD GND INVX1
*Voltage Sources
VDD_source (VDD GND) vsource dc=15 type=dc
*Output Load
Cload (ZN GND) capacitor c=1
include "../circuit_stimuli/measureINV.inc"
*Do the tran Analysis
tran0 tran stop=5e-6
>>>>>>>>>>>>>>>>>>>>>>>>>>>
The simulation is running fine.
The problem arises with ".meas tran cell_area param='area' " line as the MDL-Control tries to evaluate the expression par(X1.gatew)*par(X1.gateh). Without this .meas line, it's running fine and the expression is not giving any error. I tried first to place in the expression directly into .measure, but gives the same error:
Error found by spectre during transient analysis `transient1', during task `MDLControl'.
ERROR: Unknown parameter name `X1.gateh' found in expression.
ERROR: validate object failure -- parameter or terminal 'area' not found in specified scope
ERROR: line `70': MDL expression for identifier 'cell_area' can not be evaluated due to previous errors.
Any suggestions to fix this syntax problem?
Regards Eberhard