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

 

Accellera

Analog and Mixed-signal Extensions to Verilog HDL

Version 2.3.1, June 1, 2009

Notice that I(diode) is found on both sides of the contribution operator. The underlying implementation of the simulator will find the value of I(diode) that equals the sum of the contributions made to it, even if the contributions are a function of I(diode) itself.

5.6.7 Indirect branch contribution statements

Direct contribution statements are not the only way that values can be assigned to analog signals. Indirect branch contributions provide an alternative approach that is useful in cases where direct contributions do not behave as needed. One such case is the ideal opamp (or nullor). In this model, the output is driven to the voltage that results in the input voltage being zero. The constitutive equation is

vin = 0,

(1)

which can be formulated with a contribution statement as

V(out) <+ V(out) + V(in);

This statement defines the output of the opamp to be a controlled voltage source by assigning to V(out) and defines the input to be high impedance by only probing the input voltage. That the desired behavior is achieved can be seen by subtracting V(out) from both sides of the contribution operator, resulting in (1). However, this approach does not result in the right tolerances being applied to the equation if out and in have different disciplines. In this situation the tolerances for the equations would come from V(out) because it is the target of the contribution, but the final equation does not contain V(out). It would be better if the tolerances for the equation were taken from V(in).

The indirect branch assignment should be used in this situation.

V(out): V(in) == 0;

which reads “drive V(out) so that V(in) == 0”. This indicates out is driven with a voltage source and the source voltage needs to be adjusted so that the given equation is satisfied. Any branches referenced in the equation are only probed and not driven. In particular, V(in) acts as a voltage probe.

The left hand side of the equality operator must either be an access function, or ddt, idt or idtmod applied to an access function. The tolerance for the equation is taken from the argument on the left side of the equality operator, in this case V(in) as desired. Syntax 5-6 shows the syntax for an indirect assignment statement.

indirect_contribution_statement ::=

// from A.6.10

branch_lvalue : indirect_expression == analog_expression ;

// from A.8.3

indirect_expression ::=

branch_probe_function_call

 

| port_probe_function_call

 

| ddt ( branch_probe_function_call [ , abstol_expression ] )

 

| ddt ( port_probe_function_call [ , abstol_expression ] )

 

| idt ( branch_probe_function_call [ , analog_expression

 

[ , analog_expression [ , abstol_expression ] ] ] )

 

| idt ( port_probe_function_call [ , analog_expression [ , analog_expression

 

[ , abstol_expression ] ] ] )

 

| idtmod ( branch_probe_function_call [ , analog_expression [ , analog_expression

 

[ , analog_expression [ , abstol_expression ] ] ] ] )

 

| idtmod ( port_probe_function_call [ , analog_expression [ , analog_expression

 

[ , analog_expression [ , abstol_expression ] ] ] ] )

 

103

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

Accellera

 

Version 2.3.1, June 1, 2009

VERILOG-AMS

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-6—Syntax for indirect branch assignment

 

Indirect branch contributions shall not be used in conditional or looping statements, unless the conditional expression is a constant expression. The constant expression shall not include the analysis() function with an argument that can result in different return values during a single analysis, such as the "ic" or "nodeset" arguments.

For example, a complete description of an ideal opamp is:

module opamp(out, pin, nin); inout out, pin, nin; electrical out, pin, nin; analog

V(out):V(pin,nin) == 0; endmodule

5.6.7.1 Multiple indirect contributions

For multiple indirect contribution statements, the targets frequently can be paired with any equation.

For example, the following ordinary differential equation,

dxdt = f(x, y, z) dydt = g(x, y, z) dzdt = h(x, y, z)

can be written as

V(x): ddt(V(x)) == f(V(x), V(y), V(z));

V(y): ddt(V(y)) == g(V(x), V(y), V(z));

V(z): ddt(V(z)) == h(V(x), V(y), V(z));

or

V(y): ddt(V(x)) == f(V(x), V(y), V(z));

V(z): ddt(V(y)) == g(V(x), V(y), V(z));

V(x): ddt(V(z)) == h(V(x), V(y), V(z));

or

V(z): ddt(V(x)) == f(V(x), V(y), V(z));

V(x): ddt(V(y)) == g(V(x), V(y), V(z));

V(y): ddt(V(z)) == h(V(x), V(y), V(z));

without affecting the results.

Copyright © 2009 Accellera Organization, Inc.

104

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