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

Accellera

 

Version 2.3.1, June 1, 2009

VERILOG-AMS

output_expression(t)

y

y

rate

 

 

 

------

pmax

 

t

t

 

 

 

 

 

Figure 4-8: Slew filter transition

The two rate values are optional. max_pos_slew_rate shall be greater than zero(0)and max_neg_slew_rate shall be less than zero (0). If the max_neg_slew_rate is not specified, it defaults to the opposite of the max_pos_slew_rate. If no rates are specified, slew() passes the signal through unchanged. If the rate of change of expr is less than the specified maximum slew rates, slew() returns the value of expr.

In DC analysis, slew() simply passes the value of the destination to its output. In small-signal analyses, the slew() function has a transfer function from the first argument to the output of 1.0 when not slewing (e.g. for a small-signal analysis following a dc operating point) and 0.0 when slewing.

4.5.10 last_crossing function

Related to the cross() function, the last_crossing() function returns a real value representing the simulation time when a signal expression last crossed zero (0). The general form is

last_crossing ( expr , direction )

The direction flag is interpreted in the same way as in the cross() function. The last_crossing() function is subject to the same usage restrictions as the cross() function.

The last_crossing() function does not control the timestep to get accurate results; it uses linear interpolation to estimate the time of the last crossing. However, it can be used with the cross function for improved accuracy.

The following example measures the period of its input signal using the cross() and last_crossing() functions.

module period(in); input in; voltage in;

integer crossings; real latest, previous;

analog begin

@(initial_step) begin crossings = 0; previous = 0;

end

@(cross(V(in), +1)) begin crossings = crossings + 1; previous = latest;

end

latest = last_crossing(V(in), +1);

Copyright © 2009 Accellera Organization, Inc.

72

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