F
Updating Verilog-A Modules
The Verilog®-A language is a subset of Verilog-AMS, but some of the language elements in that subset have changed since Verilog-A was released by itself. As a consequence, you might need to revise your Verilog-A modules before using them as Verilog-AMS modules. The following table highlights the differences.
| Feature | Independent Verilog-A | Verilog-AMS | Change type |
|---|---|---|---|
|
Supports additional time tolerance argument for |
|||
Suggestions for Updating Models
The remainder of this appendix describes some of these changes in greater detail and suggests ways of modifying your existing Verilog-A models so that they work in version 4.4.6 of Verilog-A and in version 1.0 of Verilog-AMS. The changes recommended here might not work with 4.4.5 or earlier versions of Verilog-A.
Current Probes
OVI Verilog-A 1.0 syntax for a current probe is I(a,a). OVI Verilog-AMS 2.0 changes this to I(<a>).
Suggested change: Put I(<a>) inside an `ifdef __VAMS_ENABLE__, which makes the syntax effective only for Verilog-AMS. For example, change
iin_val = I(vin,vin);
`ifdef __VAMS_ENABLE__ iin_val = I(<vin>); `else iin_val = I(vin,vin);
`endif
Analog Functions
OVI Verilog-A 1.0 declaration of an analog function is
functionname;
OVI Verilog-AMS 2.0 uses the syntax
analog functionname;
Suggested change: Prefix all function declarations by the word analog. For example, change
function real foo;
analog function real foo;
NULL Statements
OVI Verilog-A 1.0 allows NULL statements to be used anywhere in an analog block. OVI Verilog-AMS 2.0 allows NULL statements to be used only after case statements or event control statements.
Remove illegal NULL statements. For example, change
begin
end;
begin
end
inf Used as a Number
Spectre Verilog-A allows 'inf to be used as a number. OVI Verilog-AMS 2.0 allows 'inf to be used only on ranges.
Change all illegal references to 'inf to a large number such as 1M. For example, change;
parameter real points_per_cycle = inf from [6:inf];
parameter real points_per_cycle = 1M from [6:inf];
Changing Delay to Absdelay
OVI Verilog-A 1.0 uses delay as the analog delay operator but OVI Verilog-AMS 2.0 uses absdelay.
Suggested change: Change delay to absdelay. This change usually leads to faster, better results.
Changing $realtime to $abstime
OVI Verilog-A 1.0 uses $realtime as absolute time but OVI Verilog-AMS 2.0 uses $abstime.
Suggested change: Change $realtime to $abstime.
Changing bound_step to $bound_step
OVI Verilog-A 1.0 uses bound_step for step bounding but OVI Verilog-AMS 2.0 uses $bound_step.
Suggested change: Change bound_step to $bound_step.
Changing Array Specifications
OVI Verilog-A 1.0 uses [] to specify arrays but OVI Verilog-AMS 2.0 uses {}.
Suggested change: Change [] to {}. For example, change
svcvs #(.poles([-2*`PI*bw,0])) output_filter
svcvs #(.poles({-2*`PI*bw,0})) output_filter
Chained Assignments Made Illegal
Spectre-Verilog-A allows chained assignments, such as x=y=z, but OVI Verilog-AMS 2.0 makes this illegal.
Suggested change: Break chain assignments into single assignments. For example, change
x=y=z;
y = z; x = y;
Real Argument Not Supported as Direction Argument
Spectre-Verilog-A allows real numbers to be used for the arguments of @cross and last_crossing but OVI Verilog-AMS 2.0 makes this illegal.
Suggested change: Change the real numbers to integers. For example, change
@(cross(V(in),1.0) begin
@(cross(V(in),1) begin
$limexp Changed to limexp
OVI Verilog-A 1.0 uses $limexp, but OVI Verilog-AMS 2.0 uses limexp.
Suggested change: Change $limexp to limexp. For example, change
I(vp,vn) <+ is * ($limexp(vacross/$vt) - 1);
I(vp,vn) <+ is * (limexp(vacross/$vt) - 1);
'if 'MACRO is Not Allowed
Spectre-Verilog-A allows users to type 'if 'MACRO, but OVI Verilog-AMS 2.0, 1.0 and 1364 say this is illegal.
Suggested change: Change 'if 'MACRO to 'if MACRO (Do not use the tick mark for the macro). For example, change
`ifdef `CHECK_BACK_SURFACE
`ifdef CHECK_BACK_SURFACE
$warning is Not Allowed
Spectre-Verilog-A supports $warning, but OVI Verilog-AMS 2.0, 1.0 and 1364 do not support this as a standard built-in function.
Suggested change: Change $warning to $strobe.
discontinuity Changed to $discontinuity
OVI Verilog-A 1.0 uses discontinuity, but OVI Verilog-AMS 2.0 uses $discontinuity.
Suggested change: Change discontinuity to $discontinuity.
Return to top