Inheritance diagram for class svt_8b10b_data:
A utility class that encapsulates an individual unit of transfer in an 8b/10b encoding protocol. The object can be initialized with either eight bit data or ten bit data. Methods are present on the object 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:
Public Member Functions | |
| function bit | decode_data ( bit [9:0] value, ref bit RD ) |
| function bit | decode_prop_val ( string prop_name, bit [1023:0] prop_val, ref string prop_val_string, input svt_pattern_data :: type_enum typ ) |
| function svt_pattern | do_allocate_pattern ( ) |
| function bit | do_compare ( ovm_object rhs, ovm_comparer comparer ) |
| function bit | do_is_valid ( bit silent = 1, int kind = -1 ) |
| function bit | encode_data ( bit [7:0] value, ref bit RD ) |
| function bit | encode_kcode ( bit [7:0] value, ref bit RD ) |
| function bit | encode_prop_val ( string prop_name, string prop_val_string, ref bit [1023:0] prop_val, input svt_pattern_data :: type_enum typ ) |
| function string | get_code_group ( ) |
| function string | get_mcd_class_name ( ) |
| function bit | get_prop_val ( string prop_name, ref bit [1023:0] prop_val, input int array_ix, ref svt_sequence_item_base data_obj ) |
| function bit | is_valid_10b ( bit [9:0] value, logic disp_in = 1'bx ) |
| function bit | is_valid_K8b ( bit [7:0] value, logic disp_in = 1'bx ) |
| function bit [8:0] | lookup_8b ( bit [9:0] value, bit disp_in ) |
| function bit [9:0] | lookup_D10b ( bit [7:0] value, bit disp_in ) |
| function bit [9:0] | lookup_K10b ( bit [7:0] value, bit disp_in ) |
| function void | new ( string name = "svt_8b10b_data", string suite_name = "" ) |
| function string | psdisplay_meta_info ( string prefix = "" ) |
| function string | psdisplay_short ( string prefix = "", bit hdr_only = 0 ) |
| function int | reasonable_constraint_mode ( bit on_off ) |
| function bit | set_prop_val ( string prop_name, bit [1023:0] prop_val, int array_ix ) |
Public Attributes | |
| rand bit [9:0] | data_10bit |
| rand bit [7:0] | data_8bit |
| rand bit | data_k |
| svt_sequence_item :: status_enum | status |
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] |
Constraints | |
| constraint | reasonable_data_10bit ( ) |
| constraint | reasonable_data_8bit ( ) |
|
||
Decodes a ten bit data value into its eight bit representation. The data_8bit, data_k, and data_10bit values are updated as a result of calling this function. The function returns 0 and no properties are updated if Xs or Zs are passed in via the arguments, or if the value that is passed in is not in the 10b/8b lookup table.
value - Ten bit value to be decoded RD - 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. |
|
||||||
Simple utility used to convert 'bit [1023:0]' property value representation into its equivalent string property value representation. If provided the type is used by the default implementation to choose an appropriate conversion method. If the type is specified as UNDEF then the the field is assumed to be an int field and the string is assumed to be an ascii int representation. Derived classes can extend this method to support other field representations such as strings, enums, bitvecs, etc.
prop_name - The name of the property being decoded. prop_val - The bit vector decoding of prop_val_string. prop_val_string - The resulting decoded value. typ - Optional field type used to help in the decode effort.
Return values - Status indicating the success/failure of the decode. | ||||||
|
|
||||||
HDL Support: This method allocates a pattern containing svt_pattern_data instances for all of the primitive data fields in the object. The svt_pattern_data :: name is set to the corresponding field name, the svt_pattern_data :: value is set to 0.
Return values - An svt_pattern instance containing entries for all of the data fields. | ||||||
|
|
||||||||
Override the 'do_compare' method to compare fields directly.
| ||||||||
|
|
||||||
Checks to see that the data field values are valid, focusing mainly on checking/enforcing valid_ranges constraint. Only supported kind values are -1 and svt_sequence_item_base :: COMPLETE. If protocol defines physical representation for transaction then -1 does RELEVANT is_valid. If not, -1 does COMPLETE (i.e., all fields checked) is_valid. svt_sequence_item_base :: COMPLETE always results in COMPLETE is_valid.
| ||||||
|
|
||
Encodes an eight bit data value into its ten bit representation. The data_8bit, data_k, and data_10bit values are updated as a result of calling this function. The function returns 0 and no properties are updated if Xs or Zs are passed in via the arguments.
value - Eight bit value to be encoded RD - 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. value |
|
||
Encodes an eight bit control value into its ten bit representation. The data_8bit, data_k, and data_10bit values are updated as a result of calling this function. The function returns 0 and no properties are updated if Xs or Zs are passed in via the arguments, or if the value passed in is not in the 8b/10b lookup table.
value - Eight bit value to be encoded RD - 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. |
|
||||||
Simple utility used to convert string property value representation into its equivalent 'bit [1023:0]' property value representation. If provided the type is used by the default implementation to choose an appropriate conversion method. If the type is specified as UNDEF then the the field is assumed to be an int field and the string is assumed to be an ascii int representation. Derived classes can extend this method to support other field representations such as strings, enums, bitvecs, etc.
prop_name - The name of the property being encoded. prop_val_string - The string describing the value to be encoded. prop_val - The bit vector encoding of prop_val_string. typ - Optional field type used to help in the encode effort.
Return values - Status indicating the success/failure of the encode. | ||||||
|
|
||
Returns the code group of the data value as a string
|
|
||||
Returns the class name for the object.
| ||||
|
|
||||||
HDL Support: For read access to public data members of this class.
| ||||||
|
|
||
|
||
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: Create a new transaction instance, passing the appropriate argument values to the parent class.
name - Instance name of the transaction suite_name - A String that identifies the product suite to which the transaction object belongs. | ||||||
|
|
||||
Displays the meta information to a string. Each line of the generated output is preceded by prefix. Extends class flexibility in choosing what meta information should be displayed.
| ||||
|
|
||||
Returns a string (with no line feeds) that reports the essential contents of the transaction generally necessary to uniquely identify that transaction.
prefix - (Optional: default = "") The string given in this argument becomes the first item listed in the value returned. It is intended to be used to identify the transactor (or other source) that requested this string. This argument should be limited to 8 characters or less (to accommodate the fixed column widths in the returned string). If more than 8 characters are supplied, only the first 8 characters are used. hdr_only - (Optional: default = 0) If this argument is supplied, and is '1', the function returns a 3-line table header string, which indicates which transaction data appears in the subsequent columns. If this argument is '1', the prefix argument becomes the column label for the first header column (still subject to the 8 character limit). | ||||
|
|
||||
Method to turn reasonable constraints on/off as a block.
| ||||
|
|
||||||
HDL Support: For write access to public data members of this class.
| ||||||
|
|
|
Ten bit representation of the data
This property is declared rand, but the rand_mode is disabled in the constructor. |
|
|
Eight bit representation of the data
This property is declared rand, but the rand_mode is disabled in the constructor. |
|
|
Flag that determines when the eight bit data represents a control character
This property is declared rand, but the rand_mode is disabled in the constructor. |
|
|
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
|
|
|
Status information about the current processing state
|
|
|
Ensures that the 10 bit representation matches the 8 bit representation with either positive or negative disparity
Note: Functions in constraints won't be supported until VCS 2008.03, so this constraint is commented out for now. | |
constraint reasonable_data_10bit {
/* if (data_k == 1'b0) { data_10bit inside { lookup_D10b(data_8bit, 1'b0), lookup_D10b(data_8bit, 1'b1) }; } else { data_10bit inside { lookup_K10b(data_8bit, 1'b0), lookup_K10b(data_8bit, 1'b1) }; } */ } |
|
|
Ensures that the 8 bit representation matches the 10 bit representation and if the data represents a control character, then the constraint ensures that a valid control character is selected
Note: Functions in constraints won't be supported until VCS 2008.03, so this constraint is commented out for now. | |
constraint reasonable_data_8bit {
/* {data_k, data_8bit} inside { lookup_8b(data_10bit, 1'b0), lookup_8b(data_10bit, 1'b1) }; if (data_k == 1'b1) { lookup_table_K10b.exists(data_8bit); } */ } |