Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
AMS.pdf
Скачиваний:
70
Добавлен:
05.06.2015
Размер:
2.68 Mб
Скачать

Virtuoso AMS Environment User Guide

Producing Customized Netlists

More Powerful Approach: Using Fully Customized Netlisting Procedures

The full-custom use model builds on the capability described in the previous section, expanding beyond resetting the value of fields to completely rewriting the netlisting procedures. The major difference in the fully customized approach, is that the helper netlisting functions are used much more extensively to fine tune the operation of the netlister. This is the most powerful form of custom netlisting procedures because it allows you to add new components, ports, or wires as necessary. While taking advantage of this flexibility, you must account for the various environment variables and format the netlist accordingly. And, of course, you must ensure that the resulting netlist is syntactically correct.

Much of the information you need for full-blown custom netlisting is described earlier in the chapter, including the SKILL operators used to access and change the fields in the data objects and the mechanism for overriding the default netlisting procedures. Detailed information about the data objects can be found in “DataObjects Supported for Netlisting” on page 327.

Examples: Problems Addressed by Customized Netlists

The flexibility of customized netlisting procedures lends itself to addressing a wide range of problems. The extended examples in the following sections illustrate how various problems can be resolved by using netlisting procedures.

Example: Adjusting Parameter Values to Account for Number of Fingers on page 314

Example: Using Symbols that Represent Verilog Test Code on page 318

Example: Using CDF Instance Parameters to Define Inherited Connections on page 322

Example: Adjusting Parameter Values to Account for Number of Fingers

The basic problem addressed in this example is the need to pass the number of fingers on a mosfet to the simulator so that the narrow width effect can be accounted for during simulation.

The netlist has two nmos transistors with the same width and multiplier but the M0 instance has 10 fingers, while theM1 instance has 1 finger. The same models are used for both preand post-layout so the scaling needed to adjust for the differing numbers of fingers cannot be done in the models; it must be done during netlisting.

April 2004

314

Product Version 5.3

Virtuoso AMS Environment User Guide

Producing Customized Netlists

The number of fingers for each instance is specified as a user property in the Edit Object

Properties form. For instance, the form for instance M0 looks like this.

April 2004

315

Product Version 5.3

Virtuoso AMS Environment User Guide

Producing Customized Netlists

The parameters that must be scaled are w, as, ad, ps, pd and m. For the approach taken in this example to work, these parameters have to appear in the instParameters field of the ams Simulation Information.

Notice, however, that the fingers property does not appear in the instParameters list.

There is no need for it there because, although it is used as data for the netlist, it does not appear in the netlist.

The netlisting procedure looks at each parameter. If the current parameter is w, as, ad, ps, pd, or m then the parameter is scaled, either by dividing by the number of fingers or by multiplying by the number of fingers. After the new parameter values are set, the netlisting procedure calls the default instance parameter printing function, amsPrintInstanceParameters, to finish the work.

;;=======================================================================

;;A custom netlist procedure to compute instance parameters based

;;on number of fingers on the instance

;;=======================================================================

(defun myPrintInstanceParameters (formatterId cvId instanceId)

;;Modify the parameters for "nmos" in a customized way -

;;based on number of fingers.

;;

(if (instanceId->masterName == "nmos") then

;;We want to change the value of parameters w, as, ad, ps, pd and m

;;depending upon the value of property <fingers>.

;;A few notes regarding the simInfo:

;;

;;Please make sure that w, as, ad, ps, pd and m are in the

;;instParameters section of ams simInfo. Otherwise, amsdirect does

;;not pick them up for writing to the netlist.

;;

;;Please note that, "fingerwidth" should NOT be an instParameter, as

;;it is not required to be printed as a parameter on the instance.

;;Because it is not in the include list, amsdirect does not pick

April 2004

316

Product Version 5.3

Virtuoso AMS Environment User Guide

Producing Customized Netlists

;;it up. But it is there on the instance as a normal CDBA

;;property. Grab it from the instance.

numfingers = instanceId->id->fingers

(if (numfingers != nil) then

;;Go through the list of parameters for nmos and modify

;;the value for the following parameters:

;;w, as, ad, ps, pd, m.

;;

(foreach param instanceId->parameters

(if ((param->name

== "w")

||

(param->name

== "as")

||

(param->name

== "ad")

||

(param->name

==

"ps")

||

(param->name

==

"pd")

) then

param->value = strcat(param->value "/" numfingers)

); if

(if (param->name == "m") then

param->value = strcat(param->value "*" numfingers) ); if

);foreach

);if

); if

/* Call the default instance parameters print function */ amsPrintInstanceParameters(formatterId cvId instanceId)

); defun

;;=======================================================================

;;Set up area

;;=======================================================================

netlisterId = amsGetNetlister() formatterId = netlisterId->vlog

;; Override the printing of instance parameters netlist procedure formatterId->instanceParametersProc = ’myPrintInstanceParameters

Running this netlist procedure results in a netlist that includes the following instantiation statements.

nmos #(.ps(1.268u), .as(2.04E-12), .l(130.0n), .pd(12.68u), .ad(2.04E-12),

.w(6u), .m(2))

(* integer library_binding = "analogLib"; integer passed_mfactor = "m"; *)

M1 ( out_y, net20, cds_globals.„nd! , •ulk_n_gnd! );

nmos #(.ps(11.6u/10), .as(1.32E-12/10), .l(130.0n), .pd(9.8u/10), .ad(1.14E-12/10 ),

.w(6u/10), .m(2*10))

(* integer library_binding = "analogLib"; integer passed_mfactor = "m"; *)

M0 ( net20, net9, cds_globals.„nd! , •ulk_n_gnd! );

Notice how in the second instantiation (for M0) the values for ps, as, pd, ad, and w are divided by 10, while the value for m is multiplied by 10.

April 2004

317

Product Version 5.3

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]