Inheritance diagram for class svt_data_converter:
A utility class that encapsulates different conversions and calculations used across various protocols. Such as:
a) 8B10B ENCODING Methods are used to encode eight bit data into its ten bit representation, or decode ten bit data into its eight bit representation. The current running disparity must be provided to encode or decode the data properly, and the updated running disparity value is returned from these functions via a ref argument.
The 8b/10b and 10b/8b conversion methods utilize lookup tables instead of calculations for performance reasons. The data values represent the full 8-bit state space, but the K-code values only utilize a subset of the 8-bit state space. Therefore, the following K-code values are incorporated into the lookup tables:
b) CRC CALCULATIONS
Public Member Functions | |
| function void | apply_byte_to_crc ( bit [7:0] value, bit init = 0 ) |
| function bit | decode_8b10b_data ( input bit [9:0] data_in, ref bit running_disparity, output bit data_k, output bit [7:0] data_out ) |
| function bit | encode_8b10b_data ( input bit [7:0] data_in, input bit data_k, ref bit running_disparity, output bit [9:0] data_out ) |
| function bit | get_code_group ( input bit [9:0] value, output bit data_k, output string byte_name ) |
| function bit [31:0] | get_crc ( ) |
| function bit [31:0] | get_crc_initial_value ( ) |
| function bit [31:0] | get_crc_polynomial ( ) |
| function void | initialize_8b10b ( bit force_load = 0 ) |
| function void | initialize_crc ( bit [31:0] poly, int width, bit [31:0] init, bit force_load = 0 ) |
| function bit | is_valid_10b ( bit [9:0] value, logic disp_in = 1'bx ) |
| function bit | is_valid_K8b ( byte unsigned value, logic disp_in = 1'bx ) |
| function void | new ( uvm_report_object reporter ) |
| function string | psdisplay_meta_info ( string prefix ) |
| function void | scramble ( input byte unsigned array_in[], ref bit [15:0] lfsr, output byte unsigned array_out[] ) |
| function void | set_crc_initial_value ( bit [31:0] init ) |
| function void | set_crc_polynomial ( bit [31:0] poly ) |
| function void | unscramble ( input byte unsigned array_in[], ref bit [15:0] lfsr, output byte unsigned array_out[] ) |
Public Attributes | |
| uvm_report_object | reporter |
Protected Attributes | |
| static protected bit [8:0] | lookup_table_8b [int] |
| static protected bit [9:0] | lookup_table_D10b [512] |
| static protected integer | lookup_table_disparity [int] |
| static protected bit [9:0] | lookup_table_K10b [int] |
|
||
|
||
Decodes a ten bit data value into its eight bit representation. The function returns 0 and the output is unpredictable.
data_in - Ten bit value to be decoded running_disparity - The value provided to this argument determines whether the ten bit value is selected from the positive or negative disparity column. The value is updated with the disparity of the new ten bit value that is selected. If the encode operation fails then the value remains unchanged. data_k - Flag that determines when the Ten bit data represents a control character. data_out - Eight bit decoded data. |
|
||
Encodes an eight bit data value into its ten bit representation. The function returns 0 and the output is unpredictable if Xs and Zs are passed in via the argument.
data_in - Eight bit value to be encoded. data_k - Flag that determines when the eight bit data represents a control character. running_disparity - The value provided to this argument determines whether the ten bit value is selected from the positive or negative disparity column. The value is updated with the disparity of the new ten bit value that is selected. If the encode operation fails then the value remains unchanged. data_out - Ten bit encoded data. |
|
||
Returns the code group of the data value as a string and a data_k bit indicating if the 10 bit value is of type D-CODE or K-CODE. The function returns 0 if the value is not to be located in the tables.
value - Value to be looked up in the 10B table. data_k - Bit indicating if the input value belongs to the D or K CODE. byte_name - String code group name, sunch as D0.0 or K28.1. |
|
||
This method returns the calculated CRC value.
|
|
||
Utility method for getting the CRC initial value.
Return values - The CRC initial value. |
|
||
Utility method for getting the crc polynomial value.
Return values - The CRC polynomial value. |
|
||
This method initializes the 8b10b lookup tables.
force_load - Forces the 8b10b tables to be re-initialized. |
|
||
This method initializes the CRC lookup table, saves the CRC width, and the initial CRC value.
poly - Polynomial used to initialize the CRC lookup table width - Width of the CRC lookup table that is generated init - The CRC value is initialized to this value force_load - Forces the CRC algorithm to be re-initialized |
|
||
|
||
Returns true if the provided value is in the 8 bit control character lookup table. Otherwise returns false.
value - Value to be tested disp_in - Optional disparity to test against. If this value is not provided, then the function returns true whether the value was found in the positive or negative disparity column. |
|
||
CONSTRUCTOR: Constructor for the svt_data_converter. This does not initialize any of the conversion packages. Individual converters (e.g., 8b10b, crc, etc.) must be initialized individually by the extended classes.
reporter - Required `SVT_XVM(report_object) used for message output. |
|
||
Displays the meta information to a string. Each line of the generated output is preceded by prefix.
|
|
||
Function is used for scrambling a byte of data. Following rules are followed while implementing this function: 1) The LFSR implements the polynomial: G(X)=X^16+X^5+X^4+X^3+1 2) All D-codes and K-codes are scrambled. 3) There is no resetting of the LFSR under any condition.
array_in - An array that contains data to be scrambled. lfsr - Sixteen bit value with which the function encodes the data. It is up to the entity calling this function to keep track of the lfsr value and to provide the correct lfsr value on the subsequent calls. array_out - An array constaing the scrambled data. |
|
||
Utility method for setting the CRC initial value.
init - The new CRC initial value. |
|
||
Utility method for setting the CRC polynomial value.
poly - The new CRC polynomial value. |
|
||
Function is used for unscrambling a byte of data. The function returns 0 and the output is unpredictable if Xs and Zs are passed in via the argument. Following rules are followed while implementing this function: 1) The LFSR implements the polynomial: G(X)=X^16+X^5+X^4+X^3+1 2) There is no resetting of the LFSR under any condition.
array_in - An array whose elements need to be unscrambled. lfsr - Is the Sixteen bit value with which the function decodes the data. It is up to the entity calling this function to keep track of the lfsr value and to provide the correct lfsr value on the subsequent calls. array_out - An array containing unscrambled data. |
|
|
Ten bit value to eight bit lookup table
|
|
|
Eight bit data value to ten bit lookup table
|
|
|
Disparity lookup table (indexed by ten bit values)
|
|
|
Eight bit control value to ten bit lookup table
|
|
|
Report Server
|