Using analogmodel for Model Passing (analogmodel)
Description
analogmodel is a reserved word in Spectre that allows you to bind an instance to different masters based on the value of a special instance parameter called modelname. An instance of analogmodel must have a parameter named modelname, whose string value represents the name of the master this instance will be bound to. The value of modelname can be passed into subcircuits.
The analogmodel keyword is used by the Cadence Analog Design Environment to enable model name passing through the schematic hierarchy.
Sample Instance Statement
name [(]node1 ... nodeN[)] analogmodel modelname=mastername [[param1=value1] ...[paramN=valueN]]
//example spectre netlist to illustrate modelname parameter
simulator lang=spectre
parameters b="bottom"
include "VerilogAStuff.va"
topInst1 (out in) top
topInst2 (out in) analogmodel modelname="VAMaster" //VAMaster is defined in "VerilogAStuff.va"
topInst3 (out in) analogmodel modelname="resistor" //topInst3 binds to a primitive
topInst4 (out 0) analogmodel modelname="myOwnRes" //topInst4 binds to modelcard "myOwnRes" defined below
v1 in 0 vsource dc=1
model myOwnRes resistor r=100
subckt top out in
parameters a="mid"
x1 (out in) analogmodel modelname=a //topInst1.x1 binds to "mid"
ends top
subckt mid out in
parameters c="low"
x1 (out in) analogmodel modelname=b //topInst1.x1.x1 binds to "bottom"
x2 (out in) analogmodel modelname=c //topInst1.x1.x1.x2 binds to "low"
ends mid
subckt low out in
x1 (out in) analogmodel modelname="bottom" //topInst1.x1.x1.x2.x1 binds to
"bottom"
ends low
subckt bottom out in
x1 (out in) analogmodel modelname="resistor" //x1 binds to primitive "resistor"
ends bottom
dc1 dc
//"VerilogAStuff.va"‘include "constants.h"module VAMaster(n1, n2);
‘include "discipline.h"
inout n1, n2;
electrical n1, n2;
parameter r=1k;
analog begin
I(n1, n2) <+ V(n1, n2)/r;
end
endmodule
Return to top