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

Accellera

 

 

Version 2.3.1, June 1, 2009

VERILOG-AMS

integer i, num_ones, num_zeros;

 

assign

d=out;

 

initial begin

 

num_ones = 0;

 

num_zeros = 0;

 

end

 

 

always

@(driver_update(d)) begin

 

num_ones = 0;

 

num_zeros = 0;

 

for

( i = 0; i < $driver_count(d); i=i+1)

 

if ( $driver_state(d,i) == 1 )

 

 

num_ones = num_ones + 1;

 

else

 

end

num_zeros = num_zeros + 1;

 

 

 

always

@(cross(V(a) - vt_hi, -1) or cross(V(a) - vt_lo, +1))

 

out

= 1’bx;

 

always

@(cross(V(a) - vt_hi, +1))

 

out

= 1’b1;

 

always

@(cross(V(a) - vt_lo, -1))

 

out

= 1’b0;

 

analog begin

//Approximately one impedance1 resistor to rail per high output

//connected to the digital net

V(pull_up) <+ 1/((1/impedance1)*num_ones+(1/impedanceOff)) *

I(pull_up);

//Approximately one impedance0 resistor to ground per low output

//connected to the digital net

V(pull_down) <+ 1/((1/impedance0)*num_zeros+(1/impedanceOff)) * I(pull_down);

V(power) <+ supply; end

endmodule

9.22 Supplementary connectmodule driver access system functions

Verilog-AMS HDL extends IEEE std 1364-2005 Verilog HDL so that a set of supplementary driver access functions are supported in the digital context of connectmodules.

These driver access functions are provided for access to digital events which have been scheduled onto a driver but might not have matured by the current simulation time.

These functions can be used to create analog waveforms which cross a specified threshold at the same time the digital event matures, thus providing accurate registration of analog and digital representations of a signal. This assumes there is at least as long a delay in the maturation of the digital signal as the required rise/ fall times of the analog waveform.

NOTE—Because the scheduled digital events can be scheduled with an insufficient delay or cancelled before they mature, be careful when using these functions.

Copyright © 2009 Accellera Organization, Inc.

236

 

Accellera

Analog and Mixed-signal Extensions to Verilog HDL

Version 2.3.1, June 1, 2009

9.22.1 $driver_delay

$driver_delay returns the delay, from current simulation time, after which the pending state or strength becomes active. If there is no pending value on a signal, it returns the value minus one (-1.0). The syntax is shown in Syntax 9-19.

driver_delay_function ::=

$driver_delay ( signal_name , driver_index )

Syntax 9-19—Syntax for $driver_delay

driver_index is an integer value between 0 and N-1, where N is the total number of drivers contributing to the signal value. The returned delay value is a real number, which is defined by the `timescale for that module where the call has been made. The fractional part arises from the possibility of a driver being updated by an A2D event off the digital timeticks.

9.22.2 $driver_next_state

$driver_next_state returns the pending state of the driver, if there is one. If there is no pending state, it returns the current state. The syntax is shown in Syntax 9-20.

driver_next_state_function ::=

$driver_next_state ( signal_name , driver_index )

Syntax 9-20—Syntax for $driver_next_state

driver_index is an integer value between 0 and N-1, where N is the total number of drivers contributing to the signal value. The pending state value is returned as 1’b0, 1’b1, 1’bx, or 1’bz.

9.22.3 $driver_next_strength

$driver_next_strength returns the strength associated with the pending state of the driver, if there is one. If there is no pending state, it returns the current strength. The syntax is shown in Syntax 9-21.

driver_next_strength_function ::=

$driver_next_strength ( signal_name , driver_index )

Syntax 9-21—Syntax for$ driver_next_strength

driver_index is an integer value between 0 and N-1, where N is the total number of drivers contributing to the signal value. The pending strength value is returned as an integer between 0 and 7.

9.22.4 $driver_type

$driver_type returns an integer value with its bits set according to the system header file “driver_access.vams” (refer to Annex D for the header file) for the driver specified by the signal_name and the driver_index. Connect modules for digital to analog conversion can use the returned information to help minimize the difference between the digital event time and the analog crossover when the user swaps between coding styles and performs backannotation1. A simulator that cannot provide proper information for a given driver type should return 0 (‘DRIVER_UNKNOWN). All drivers on wor and wand nets will

237

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

Accellera

 

Version 2.3.1, June 1, 2009

VERILOG-AMS

have a bit set indicating such, and any extra drivers added by the kernel for pull-up or pull-down will be marked as belonging to the kernel. The syntax is shown in Syntax 9-22.

driver_type_function ::=

$driver_type ( signal_name , driver_index )

Syntax 9-22—Syntax for$ driver_type

Digital primitives (like nand and nor gates) should always provide data about their scheduled output changes; i.e., a gate with a 5ns delay should provide 5ns of look-ahead. Behavioral code with blocking assigns cannot provide look-ahead, but non-blocking assigns with delays can. However, since the capability is implementationand configuration-dependent, this function is provided so that the connect module can adapt for a particular instance.

1SDF backannotation will not change which D2A is inserted.

Copyright © 2009 Accellera Organization, Inc.

238

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