Altera® AXI4 Bus Functional Model User Guides

ID 838773
Date 5/19/2025
Public
Document Table of Contents

2.5.1.2.3. Methods in Axi4StreamBytes Class

This topic describes the methods in the Axi4StreamBytes class.

Method: get_data_type(): axi4_stream_bytes_t {virtual function}

Returns the object’s data format value in type axi4_stream_bytes_t. The allows you to identify the byte’s type to users and other methods.

Method: get_data(): byte_t{virtual function}

Returns the Axi4StreamBytes object data value is done with this get method.

Method: get_keep_value(): bit{virtual function}

Returns the AXI4 streaming bus value of TKEEP for the byte. For TKEEP and TSTRB rules, refer to the AMBA AXI Protocol Specification.

Method: get_strb_value(): bit {virtual function}

Returns the AXI4 streaming bus value of TSTRB for the byte. For TKEEP and TSTRB Refer to the AMBA AXI Protocol Specification.

Method: get_tuser_value(): bit vector{virtual function}

Returns the TUSER data for the current byte. You specify the size and content of this field.

Method: get_raw_data(): byte_t{virtual function}

For the base class, returns the byte’s data value since no errors are applied. This method is included in the base class Axi4StreamBytes so that derived error classes can retrieve the original data value for the byte without errors being applied.

Method: get_error_mask(): byte_t {virtual function}

This method supports the derived error classes. This method returns the error mask value that is EXOR’ed with the raw data to create an errored data value.

For the base class Axi4StreamBytes, the method returns a byte of all zeros, since error creation is only done in the byte error classes.

Method: set_error_mask(error_mask: byte_t): void {virtual function}

This method is used by the byte error classes to set the value of the error mask value that is EXOR’ed with the raw data to create an errored data value.

For the base class Axi4StreamBytes, this function does nothing and is just an empty method. This function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: data_has_errors(): bit{virtual function}

Reports whether a byte has had any errors introduced by the data or the format of the byte. The byte error classes are setup to introduce data errors in the AXI4 streaming bus, but may be configured to send error-free data. Formatting errors involve showing the wrong values for TKEEP or TSTRB for the byte.

For the base class Axi4StreamBytes, the method returns a zero since error creation is only done in the byte error classes.

Method: get_signal_data_as_position_byte(): bit {virtual function}

This get method checks this error control bit to see if it is set. The data error class Axi4StreamBytesDataError can create format errors such that the Data byte is signaled as a Position byte instead.

For the base class Axi4StreamBytes, the method returns a zero, since error creation is only done in the byte error classes.

Method: get_signal_data_as_null_byte(): bit{virtual function}

Checks this error control bit to see if it is set. The data error class Axi4StreamBytesDataError can create format errors such that the Data byte is signaled as a Null byte instead.

For the base class Axi4StreamBytes the method returns a zero, since error creation is only done in the byte error classes.

Method: get_signal_data_as_reserved_byte(): bit{virtual function}

Verifies that this error control bit is set. The data error class Axi4StreamBytesDataError can create format errors, such that the Data byte is signaled as a reserved byte.

For the base class Axi4StreamBytes, the method returns a zero, since error creation is only done in the byte error classes.

Method: set_signal_data_as_position_byte(signal_data_as_position_byte: bit): void{virtual function}

Writes the value of this error control bit to enable or disable occurrences of this format error. The data error class Axi4StreamBytesDataError can create format errors, such that the Data byte is signaled as a Position byte.

For the base class Axi4StreamBytes, this function does nothing and is an empty method. This function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: set_signal_data_as_null_byte(signal_data_as_null_byte: bit): void {virtual function}

Writes the value of this error control bit to enable or disable occurrences of this format error. The data error class Axi4StreamBytesDataError can create format errors, such that the Data byte is signaled as a Null byte.

For the base class Axi4StreamBytes, this function does nothing and is an empty method. The function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: set_signal_data_as_reserved_byte(signal_data_as_reserved_byte: bit): void{virtual function}

Writes the value of this error control bit to enable or disable occurrences of this format error. The data error class Axi4StreamBytesDataError can create format errors, such that the Data byte is signaled as a reserved byte.

For the base class Axi4StreamBytes, this function does nothing and is an empty method. The function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: get_signal_position_as_data_byte(): bit{virtual function}

Verifies that this error control bit is set. The position error class Axi4StreamBytesPositionError can create format errors such that the Position byte is signaled as a Data byte.

For the base class Axi4StreamBytes, the method returns a zero, since error creation is only done in the byte error classes.

Method: get_signal_position_as_null_byte(): bit{virtual function}

Verifies that this error control bit is set. The position error class Axi4StreamBytesPositionError can create format errors such that the Position byte is signaled as a Null byte.

For the base class Axi4StreamBytes, the method returns a zero, since error creation is only done in the byte error classes.

Method: get_signal_position_as_reserved_byte(): bit{virtual function}

Verifies this error control bit is set. The position error class Axi4StreamBytesPositionError can create format errors, such that the Data byte is signaled as a reserved byte.

For the base class Axi4StreamBytes, the method returns a zero, since error creation is only done in the byte error classes.

Method: set_signal_position_as_data_byte(signal_position_as_data_byte: bit): void{virtual function}

Writes the value of this error control bit to enable or disable occurrences of this format error. The position error class Axi4StreamBytesPositionError can create format errors, such that the Position byte is signaled as a Data byte.

For the base class Axi4StreamBytes, this function does nothing and is an empty method. The function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: set_signal_position_as_null_byte(signal_position_as_null_byte: bit): void {virtual function}

Writes the value of this error control bit to enable or disable occurrences of this format error. The position error class Axi4StreamBytesPositionError can create format errors, such that the Position byte is signaled as a Null byte.

For the base class Axi4StreamBytes, this function does nothing and is an empty method. The function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: set_signal_position_as_reserved_byte(signal_position_as_reserved_byte: bit): void {virtual function}

Writes the value of this error control bit to enable or disable occurrences of this format error. The position error class Axi4StreamBytesPositionError can create format errors, such that the Position byte is signaled as a reserved byte.

For the base class Axi4StreamBytes, this function does nothing and is an empty method. The function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: get_signal_null_as_data_byte(): bit {virtual function}

Verifies this error control bit is set. The null error class Axi4StreamBytesNullError can create format errors, such that the Null byte is signaled as a Data byte.

For the base class Axi4StreamBytes, the method returns a zero, since error creation is only done in the byte error classes.

Method: get_signal_null_as_position_byte(): bit {virtual function}

Verifies this error control bit is set. The null error class Axi4StreamBytesNullError can create format errors, such that the Null byte is signaled as a Position byte.

For the base class Axi4StreamBytes, the method returns a zero, since error creation is only done in the byte error classes.

Method: get_signal_null_as_reserved_byte(): bit{virtual function}

Verifies this error control bit is set. The null error class Axi4StreamBytesNullError can create format errors, such that the Null byte is signaled as a reserved byte.

For the base class Axi4StreamBytes, the method returns a zero, since error creation is only done in the byte error classes.

Method: set_signal_null_as_data_byte(signal_null_as_data_byte: bit): void {virtual function}

Writes the value of this error control bit to enable or disable occurrences of this format error. The null error class Axi4StreamBytesNullError can create format errors, such that the Null byte is signaled as a Data byte.

For the base class Axi4StreamBytes, this function does nothing and is an empty method. The function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: set_signal_null_as_position_byte(signal_null_as_position_byte: bit): void {virtual function}

Writes the value of this error control bit to enable or disable occurrences of this format error. The null error class Axi4StreamBytesNullError can create format errors such that the Null byte would be signaled as a Position byte instead.

For the base class Axi4StreamBytes, this function does nothing and is an empty method. The function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: set_signal_null_as_reserved_byte(signal_null_as_reserved_byte: bit): void{virtual function}

Writes the value of this error control bit to enable or disable occurrences of this format error. The null error class Axi4StreamBytesPositionError can create format errors, such that the Null byte is signaled as a reserved byte.

For the base class Axi4StreamBytes, this function does nothing and is an empty method. The function is included in the base class Axi4StreamBytes, like the other error byte methods, for polymorphism compatibility throughout the class hierarchy.

Method: print_byte(): void{virtual function}

Prints out the contents of the byte into the console. In the base class Axi4StreamBytes, the values of the data_format, data_value, and tuser_value are printed out for the byte.

Method: set_data(data_byte: byte_t): void{pure virtual function}

A pure, abstract method specified in the base class Axi4StreamBytes. This function prototype declaration of pure forces all derived classes to include their own set_data() function definition. This is enforced because the act of setting the data might require different processes for different classes.

In the class Axi4StreamBytesDataError, for instance, setting a new data value also means reapplying the error mask to the data to create its new data_error_value. This value is the actual value provided by the method get_data().

Method: is_equal(b: Axi4StreamBytes): bit{pure virtual function}

Compares the local object to one passed in as operand and determines if the objects are equal.

This method is a pure, abstract method specified in the base class Axi4StreamBytes. This function prototype declaration of pure forces all derived classes to include their own is_equal() function definition. This is enforced because what makes different bytes “equal” might require more checking in further generations of subclasses.

For example, in the simple class of AxiStreamBytesData, the only requirements for two bytes to be equal are to have matching the following:

  • data_format
  • data_value

In the class AxiStreamBytesDataError, however, all the following must match for is_equal() to return true:

  • data_format
  • data_value
  • error_mask_value
  • signal_data_as_position_byte
  • signal_data_as_null_byte
  • signal_data_as_reserved_byte

Method: is_not_equal(b: Axi4StreamBytes): bit{virtual function}

Compares one byte to another. The is_not_equal() method is implemented as the inversion of the is_equal() method.

Method: copy(): Axi4StreamBytes{pure virtual function}

A pure, abstract method specified in the base class Axi4StreamBytes and performs a “deep copy” of the byte object and returns this copy as its return value. This is a unique duplicate copy of the object and not simply a copy of the object’s handle. A copy must also have duplicates of their data members, which is why this is an abstract method requiring redefinition in each subclass of Axi4StreamBytes.