Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Video and Image Processing Suite User Guide Avalon st video.pdf
Скачиваний:
81
Добавлен:
11.06.2015
Размер:
2.64 Mб
Скачать

UG-VIPSUITE

Constrained Random Test

A-13

2015.01.23

 

 

Stage

 

Description

 

 

 

Stage 2

• After the reader assembles a complete video object, the reader casts the

 

video object into the base class (c_av_st_video_item). This code is for this

 

base class:

 

typedef c_av_st_video_data #(BITS_PER_CHANNEL, CHANNELS_

 

PER_PIXEL) video_t;

 

item_data = video_t'(video_data);

 

• After the reader casts the video object into the base class, it sends the video

 

object to the mailbox.

 

 

Stage 3

• The video source BFM retrieves the data from its mailbox, recasts the data

 

back into a c_av_st_video_data video object, and begins translating it into

 

transactions for the Avalon-ST source BFM.

 

• To indicate that a video packet is being sent, there is one transaction per

 

pixel and an initial transaction with LSBs of 0×0 when using RGB24 data,

 

24-bit data buses, and parallel transmission.

 

 

Stage 4

The Avalon-ST source BFM turns each transaction into beats of data on the

 

Avalon-ST bus, which are received by the DUT.

 

 

Stage 5

• The DUT processes the data and presents the output data on the Avalon-ST

 

bus.

 

• The Avalon-ST Sink BFM receives these and triggers a signal_transaction_

 

received event for each beat.

 

 

Stage 6

• After the video sink BFM detects the signal_transaction_received

 

event, the video sink BFM starts collecting transaction data from the BFM.

 

• When a start of packet (SOP) beat is detected, the type of the packet is

 

verified, and transaction data is pushed into a pixel object, which is in turn

 

pushed into a video_data object.

 

 

Stage 7

• An end of packet (EOP) is seen in the incoming transactions, the video sink

 

BFM casts the video data into a c_av_st_video_item object, and transfers the

 

data into its mailbox.

 

• The file writer then receives the video item.

 

 

Stage 8

The file writer recasts the video item to a video data packet, pops off the pixel,

 

and writes the data to the output file as binary data.

 

 

Constrained Random Test

The constrained random test is easily assembled using the class library.

Avalon-ST Video Verification IP Suite

Altera Corporation

 

 

Send Feedback

A-14

Constrained Random Test

UG-VIPSUITE

2015.01.23

 

 

Figure A-6: Example of a Constrained Random Test Environment

The figure below shows the constrained random test environment structure.

tb_test.v (test environment)

tb.v (netlist)

 

 

 

 

Avalon-ST

AV-ST

 

AV-ST

Avalon-ST

bus

DUT

bus

Source BFM

Sink BFM

module

 

 

 

module

function call

 

 

function call

 

interface

 

 

interface

 

 

 

Avalon-ST

Avalon-ST

 

 

 

 

Video Source

Video Sink BFM

 

 

 

mailbox

BFM

object

mailbox

 

 

object

 

 

Random

m_video_items_for_src_bfm

 

m_video_items_

 

 

 

 

video item

 

 

 

for_sink_bfm

Scoreboard

generation

 

 

mailbox

 

 

 

 

 

 

 

 

 

 

m_video_items_for_scoreboard

 

 

The randomized video and control and user packets are generated using the SystemVerilog’s built-in constrained random features. The DUT processes the video packets and the scoreboard determines a test pass or fail result..

Altera Corporation

Avalon-ST Video Verification IP Suite

 

 

Send Feedback

UG-VIPSUITE 2015.01.23

Constrained Random Test

A-15

• Code for constrained random generation

fork

`SOURCE.start();

`SINK.start();

forever begin

// Randomly determine which packet type to send : r = $urandom_range(100, 0);

if (r>67) begin

video_data_pkt1.set_max_length(100); video_data_pkt1.randomize(); video_data_pkt1.populate();

// Send it to the source BFM : m_video_items_for_src_bfm.put(video_data_pkt1);

// Copy and send to scoreboard : video_data_pkt2 = new(); video_data_pkt2.copy(video_data_pkt1);

m_video_items_for_scoreboard.put(video_data_pkt2);

end

else if (r>34) begin

video_control_pkt1.randomize(); m_video_items_for_src_bfm.put(video_control_pkt1);

// Copy and send to scoreboard : video_control_pkt2 = new(); video_control_pkt2.copy(video_control_pkt1);

m_video_items_for_scoreboard.put(video_control_pkt2);

end

else begin

user_pkt1.set_max_length(33); user_pkt1.randomize() ; m_video_items_for_src_bfm.put(user_pkt1);

// Copy and send to scoreboard : user_pkt2 = new(); user_pkt2.copy(user_pkt1);

m_video_items_for_scoreboard.put(user_pkt2);

end

// Video items have been sent to the DUT and the scoreboard, //wait for the analysis :

-> event_constrained_random_generation; wait(event_dut_output_analyzed);

end

join

This code starts the source and sink, then randomly generates either a video data, control or user packet. Generation is achieved by simply calling randomize() on the objects previously created at the end of this code, putting the objects in the source BFM’s mailbox (m_video_items_for_src_bfm), making a copy of the objects, and putting that in a reference mailbox used by the scoreboard

(m_video_items_for_scoreboard).

Finally, the code signals to the scoreboard that a video item has been sent and waits for the output of

Avalon-ST Video Verification IP Suite Altera Corporation the DUT to be analyzed, also signalled by an event from the scoreboard.

Send FeedbackAll that remains now is to create the scoreboard, which retrieves the video item objects from the two scoreboard mailboxes and compares the ones from the DUT with the reference objects.

Note: The scoreboard expects to see the DUT returning greyscale video data. You must customize the data to mirror the behavior of individual DUTs exactly..

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