Video and Image Processing Suite User Guide

ID 683416
Date 4/04/2022
Public
Document Table of Contents

A.3.10. av_mm_transaction

The av_mm_transaction class is the base class for an Avalon-MM transaction (command), including member variables for address, data, read or write, and byte enable values.
Table 106.  Method Calls for av_mm_transaction Class
Method Call Description
function new(int max_args); Class constructor. max_args is only used during the randomization process as a maximum number of arguments. It does not limit how many arguments you can assign to the class.
function void copy(av_mm_transaction #(ADDR_WIDTH, BYTE_WIDTH , USE_BYTE_ENABLE) val_to_cpy); Deep copy from val_to_cpy into class.
function cmd get_cmd(); Returns the current command (READ or WRITE).
function void set_cmd(Cmd cmd); Sets the current command (READ or WRITE).
function longint get_address(); Returns the read/write address.
function void set_address(longint addr); Sets the read/write address.
function int num_args(); Returns the number of arguments (1 argument corresponds to 1 data beat on the bus).
function void set_num_args(int length); Sets the number of arguments.
function int byte_enable_length(); Sets the number of byte enables – used for writes whose bytes are not modulo BYTE_WIDTH in size.
function void print_config_one_arg_per_line(bit one_arg_per_line); If called with an argument of 1, any following calls to ps_printf will print the details for each argument (beat on the bus) on a new line.
function string ps_printf(string indent_each_line_with); Prints the entire command.
function bit args_match(av_mm_transaction #(ADDR_WIDTH, BYTE_WIDTH, USE_BYTE_ENABLE) cmp); Compares cmp against the av_mm_transaction object and returns a 1 if the number of arguments and value of each argument in a message match. Called by the equals method call.
function bit byte_enable_match(av_mm_transaction #(ADDR_WIDTH, BYTE_WIDTH, USE_BYTE_ENABLE) cmp); Compares the byte enable values in cmp against the av_mm_transaction object’s byte enable values and returns a 1 if the number of byte enables and values match. Called by the equals method call.
function bit equals(av_mm_transaction #(ADDR_WIDTH, BYTE_WIDTH, USE_BYTE_ENABLE) cmp); Compares cmp against the av_mm_transaction object and returns a 1 if they are identical.
Table 107.  Members of av_mm_transaction Class
Member Description
int c_max_args; Maximum number of arguments for constrained random generation.
rand enum { READ, WRITE } cmd; The command itself (read or write).
rand bit [ADDR_WIDTH-1 : 0] addr; Address.
rand bit [BYTE_WIDTH*8-1 : 0] arguments [$]; Arguments / data beats.
rand byte byte_enable [$]; Byte enable bus values.