Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
VAMS-LRM-2-3-1.pdf
Скачиваний:
43
Добавлен:
05.06.2015
Размер:
3.73 Mб
Скачать

Accellera

 

Version 2.3.1, June 1, 2009

VERILOG-AMS

electrical a, b, n1, n2;

 

branch (n1, n2) cap;

 

parameter real c= 1p;

 

analog begin

 

I(a,b) <+ c*ddt(V(a,b), a.potential.abstol);

 

I(cap) <+ c*ddt(V(cap), n1.potential.abstol);

 

end

 

endmodule

 

The syntax for referencing access attributes is shown in Syntax 5-4. This syntax shall not be used for the access, ddt_nature, or idt_nature attributes of a nature, nor any other attribute whose value is not a constant expression.

nature_attribute_reference ::=

// from A.8.9

net_identifier . potential_or_flow . nature_attribute_identifier

 

potential_or_flow ::= potential | flow

// from A.1.7

 

 

Syntax 5-4—Syntax for referencing attributes of a net

 

The abstol attribute of a nature may also be accessed simply by using the nature’s identifier as the appropriate argument to the ddt(), idt(), or idtmod() operators described in 4.5.

5.6 Contribution statements

The branch contribution statement is used in the analog block to describe continuous-time behavior between a module’s analog nets and ports. Contribution statements may be described in direct or indirect form.

5.6.1 Direct branch contribution statements

The direct contribution statement uses the branch contribution operator <+ to describe the mathematical relationship between one or more analog nets within the module. The mapping is done with contribution statements using the form shown in Syntax 5-5:

contribution_statement ::= branch_lvalue <+ analog_expression ;

// from A.6.10

branch_lvalue ::= branch_probe_function_call

// from A.8.5

branch_probe_function_call ::=

// from A.8.2

nature_attribute_identifier ( branch_reference )

 

| nature_attribute_identifier ( analog_net_reference [ , analog_net_reference ] )

 

Syntax 5-5—Syntax for branch contribution

 

In general, a branch contribution statement consists of two parts, a left-hand side and a right-hand side, separated by a branch contribution operator. The right-hand side can be analog_expression can be any combination of linear, nonlinear, or differential expressions of module signals, constants, and parameters which evaluates to or can be promoted to a real value. The left-hand side specifies the source branch signal where the right-hand side shall be assigned. It shall consist of a signal access function applied to a branch.

If the branch contribution statement is conditionally executed, the expression shall not include an analog filter function, as described in 4.5, unless the conditional expression is a constant expression.

Copyright © 2009 Accellera Organization, Inc.

96

 

Accellera

Analog and Mixed-signal Extensions to Verilog HDL

Version 2.3.1, June 1, 2009

Electrical behavior can be described using:

V(n1, n2) <+ expression;

or

I(n1, n2) <+ expression;

where (n1,n2) represents an unnamed source branch and V(n1,n2) refers to the potential on the branch, while I(n1,n2) refers to the flow through the branch. The ‘V’ and ‘I’ functions (access attributes of the nature) are obtained from the discipline’s potential and flow bindings of the electrical net (refer 3.6 for further details on disciplines and natures).

Contributions cannot be made to an analog port declared with an input direction, but an output port can be accessed.

There shall be no contributions to an implicit net; contributions shall be done only on analog nets declared with a continuous discipline.

For example, the following modules model a resistor and a capacitor.

module resistor(p, n);

 

inout p, n;

 

electrical p, n;

// named branch

branch (p,n) path;

parameter real r = 0;

 

analog

V(path) <+ r*I(path); endmodule

module capacitor(p, n); inout p, n; electrical p, n; parameter real c = 0;

analog

I(p,n) <+ c*ddt(V(p, n)); // unnamed branch p,n endmodule

5.6.1.1 Relations

Branch contribution statements implicitly define source branch relations. The branch is directed from the first net of the access function to the second net. If the second net is not specified, the global reference node (ground) is used as the reference net.

A branch relation is a path of the flow between two nets in a module. Each net has two quantities associated with it—the potential of the net and the flow out of the net. In electrical circuits, the potential of a net is its voltage, whereas the flow out of the net is its current. Similarly, each branch has two quantities associated with it—the potential across the branch and the flow through the branch.

For example, the following module models a simple single-ended amplifier.

module amp(out, in); input in;

output out;

97

Copyright © 2009 Accellera Organization, Inc. All rights reserved.

Accellera

 

Version 2.3.1, June 1, 2009

VERILOG-AMS

electrical out, in; parameter real Gain = 1;

analog

V(out) <+ Gain*V(in); endmodule

5.6.1.2 Evaluation

A statement is evaluated as follows for source branch contributions:

1)The simulator evaluates the right-hand side.

2)The simulator adds the value of the right-hand side to any previously retained value of the branch for later assignment to the branch. If there are no previously retained values, the value of the right-hand side itself is retained.

3)At the end of the simulation cycle, the simulator assigns the retained value to the source branch.

Parasitics are added to the amplifier shown in 5.6.1.1 by simply adding additional contribution statements to model the input admittance and output impedance.

Examples:

module amp(out, in); inout out, in; electrical out, in;

parameter real Gain = 1, Rin = 1, Cin = 1, Rout = 1, Lout = 1;

analog begin

//gain of amplifier V(out) <+ Gain*V(in);

//model input admittance I(in) <+ V(in)/Rin;

I(in) <+ Cin*ddt(V(in));

//model output impedance V(out) <+ Rout*I(out); V(out) <+ Lout*ddt(I(out));

end endmodule

5.6.1.3 Value retention

When solving an analog block during an iteration, multiple contributions to the same potential branch or same flow branch will be additive. However, contributing a flow to a branch which already has a value retained for the potential results in the potential being discarded and the branch being converted to a flow source. Conversely, contributing a potential to a branch which already has a value retained for the flow results in the flow being discarded and the branch being converted into a potential source.

Unlike variables, the contributed value for a branch is only valid for the current iteration. If a branch is not contributed to, directly or indirectly, for any particular iteration, and it is not a branch probe, it shall be treated as a flow source with a value of 0.

Example 1:

if (closed)

Copyright © 2009 Accellera Organization, Inc.

98

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