The AMS Designer Simulator supports analog instances instantiated inside the generate block hierarchy. The following generate statements are supported.
- generate-for - Also called for-generate, it enables the AMS module items to be instantiated multiple times using a for-loop construct. For example:
module vs_vams ();... ... ...genvar j;generatefor (j=0; j<3; j=j+1) begin//Analog instancebeh_vsource V1 (a[i],gnd);//SPICE primitiveresistor #(.r(100k)) R1 (a[j], gnd);endendgenerateendmodule
- generate-if - Also called if-generate, it enables the AMS module items to be conditionally instantiated, based on the evaluation of an if-else condition.
module vs_vams ()... ... ...generateif ( behModel) begin:behmodbeh_vsource V1 (in,gnd);beh_resistor R1 (in, gnd);endelse begin: spiprimvsource #(.dc(5)) V1(in,gnd)vsource #(.r(100k)) R1(in,gnd)endendgenerateendmodule
- generate-case - Also called case-generate, it enables the module items to be conditionally instantiated, based on a select one-on-many case construct.
module vs_vams ()... ... ...generatecase: param0:begin:gen1beh_vsource V1 (in,gnd);beh_resistor R1 (in, gnd);end1:begin:gen1vsource #(.dc(5)) V1 (in,gnd);resistor #(.r(100k)) R1 (in,gnd);endendcaseendgenerateendmodule
Currently, the following is not supported:
- Analog behavioral block inside the generate statement
- Declaration of local parameters and nets
- User-defined functions
