SyoSil ApS UVM Scoreboard  1.0.3.0
Static Public Member Functions | List of all members
cl_syoscb_string_library Class Reference

A utility class holding a number of static methods for performing string manipulation. More...

Inherits uvm_object, and uvm_object.

Static Public Member Functions

static string pad_str (string str, int unsigned max_length, string expand=" ", bit side=0b0)
 Pads the input string with another string until it reaches a given length. More...
 
static string scb_separator_str (int unsigned pre_length)
 Creates a new separator string for scoreboard stat tables. More...
 
static string scb_header_str (string hn, int unsigned pre_length, bit side, string col_names[]=(" Inserts ", " Matches ", " Flushed ", " Orphans "))
 Creates a new header string for a scoreboard stat table. More...
 
static void split_string (string in, byte delim[], output string out[])
 Splits the string 'in' by any of the delimiter strings in 'delim', returning the result in 'out'. More...
 
static int merge_string_arrays (string inputs[$][], string concat="|", output string result)
 Takes a queue of string arrays, merging these into a single string. More...
 
static string generate_cmp_table_header (int table_width, string header_text)
 Generates the header section of a comparison table. More...
 
static int generate_cmp_table_body (cl_syoscb_item items[], cl_syoscb_cfg cfg, output string result)
 Generates the body of a comparison table. More...
 
static string generate_cmp_table_footer (int table_width, uvm_comparer comparer)
 Generates the footer section of a comparison table. More...
 
static string sprint_item (cl_syoscb_item item, cl_syoscb_cfg cfg)
 Utility function for printing sequence items using a table printer. This function sprints the given seq. item. using the uvm_default_table_printer. The value of the configuration object's default_printer_verbosity bit is used to control. More...
 

Detailed Description

A utility class holding a number of static methods for performing string manipulation.

Definition at line 2 of file cl_syoscb_string_library.svh.

Member Function Documentation

◆ generate_cmp_table_body()

int cl_syoscb_string_library::generate_cmp_table_body ( cl_syoscb_item  items[],
cl_syoscb_cfg  cfg,
output string  result 
)
static

Generates the body of a comparison table.

Primarily used for inspecting miscompares.

Parameters
itemsAn array of all cl_syoscb_items that must be included in the table
cfgThe configuration object for the scoreboard
resultHandle to a string in which the result is returned
Returns
The width of the comparison table

Definition at line 210 of file cl_syoscb_string_library.svh.

References merge_string_arrays(), split_string(), and sprint_item().

Referenced by cl_syoscb_compare_base::generate_miscmp_table(), cl_syoscb_queue_locator_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::validate_match(), and cl_syoscb_queue_locator_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::validate_no_match().

◆ generate_cmp_table_footer()

string cl_syoscb_string_library::generate_cmp_table_footer ( int  table_width,
uvm_comparer  comparer 
)
static

Generates the footer section of a comparison table.

Parameters
table_widthThe width of the comparison table
comparerThe UVM comparer used to compare seq. items

Definition at line 249 of file cl_syoscb_string_library.svh.

Referenced by cl_syoscb_compare_base::generate_miscmp_table(), and cl_syoscb_queue_locator_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::validate_match().

◆ generate_cmp_table_header()

string cl_syoscb_string_library::generate_cmp_table_header ( int  table_width,
string  header_text 
)
static

Generates the header section of a comparison table.

Parameters
table_widthThe width of the comparison table
header_textThe text to be included in the header
Returns
A string containing the header

Definition at line 229 of file cl_syoscb_string_library.svh.

References pad_str(), and split_string().

Referenced by cl_syoscb_compare_base::generate_miscmp_table(), cl_syoscb_queue_locator_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::validate_match(), and cl_syoscb_queue_locator_hash< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::validate_no_match().

◆ merge_string_arrays()

int cl_syoscb_string_library::merge_string_arrays ( string  inputs[$][],
string  concat = "|",
output string  result 
)
static

Takes a queue of string arrays, merging these into a single string.

The output consists of the i'th lines of all entries concatenated together. Each corresponding line is joined with a line break "\n". Primarily intended to be used for merging item printouts previously split by split_string()

Parameters
inputsA queue of string arrays. inputs[x] is a string array, and inputs [x][y] is the yth line of that string
concatA concatenator to be used between strings. Defaults to "|"
resultA string handle where the result is returned
Returns
The width of the resulting table

Definition at line 148 of file cl_syoscb_string_library.svh.

Referenced by generate_cmp_table_body().

◆ pad_str()

string cl_syoscb_string_library::pad_str ( string  str,
int unsigned  max_length,
string  expand = " ",
bit  side = 0b0 
)
static

Pads the input string with another string until it reaches a given length.

Parameters
strThe input string to pad
max_lengthThe length to pad it to
expandThe character(s) to insert on the left/right of the original string until max_length is reached
sideWhich side of the string to insert padding on. If 1, inserts on the right, if 0, inserts on the left
Returns
The padded string

Definition at line 44 of file cl_syoscb_string_library.svh.

Referenced by cl_syoscb_queue_base::create_producer_stats(), cl_syoscb_queue_base::create_queue_report(), cl_syoscb::create_total_stats(), cl_syoscbs_base::create_total_stats(), cl_syoscb::dump_join_txt(), cl_syoscb::dump_split_txt(), cl_syoscb::dump_split_xml(), generate_cmp_table_header(), scb_header_str(), and scb_separator_str().

◆ scb_header_str()

string cl_syoscb_string_library::scb_header_str ( string  hn,
int unsigned  pre_length,
bit  side,
string  col_names[] = ("  Inserts " , "  Matches ", "  Flushed ", "  Orphans ") 
)
static

Creates a new header string for a scoreboard stat table.

Parameters
hnThe name of the table
pre_lengthThe width of the first column of the table
sideWhether to pad the table name with spaces on the right (1) or left (0)
col_namesThe names of the columns in the table. Must have exactly 4 entries, each of which should be 10 characters wide

Definition at line 74 of file cl_syoscb_string_library.svh.

References pad_str(), and scb_separator_str().

Referenced by cl_syoscb::create_report(), cl_syoscb::intermediate_queue_stat_dump(), and cl_syoscbs_base::report_phase().

◆ scb_separator_str()

string cl_syoscb_string_library::scb_separator_str ( int unsigned  pre_length)
static

Creates a new separator string for scoreboard stat tables.

Parameters
pre_lengthThe width of the first column of the table
Returns
The separator string

Definition at line 59 of file cl_syoscb_string_library.svh.

References pad_str().

Referenced by cl_syoscb::create_queues_stats(), cl_syoscbs_base::create_report(), cl_syoscb::create_report(), cl_syoscbs_base::create_scb_stats(), cl_syoscb::intermediate_queue_stat_dump(), cl_syoscbs_base::report_phase(), and scb_header_str().

◆ split_string()

void cl_syoscb_string_library::split_string ( string  in,
byte  delim[],
output string  out[] 
)
static

Splits the string 'in' by any of the delimiter strings in 'delim', returning the result in 'out'.

Example: in="Hello, world..", delim={",", " ", "."} => out={"Hello", "world"}

Parameters
inThe input string to be split
delimAn array of possible delimiter characters to be used in splitting the string
outA handle to an array in which the split strings will be placed.

Definition at line 99 of file cl_syoscb_string_library.svh.

Referenced by generate_cmp_table_body(), and generate_cmp_table_header().

◆ sprint_item()

string cl_syoscb_string_library::sprint_item ( cl_syoscb_item  item,
cl_syoscb_cfg  cfg 
)
static

Utility function for printing sequence items using a table printer. This function sprints the given seq. item. using the uvm_default_table_printer. The value of the configuration object's default_printer_verbosity bit is used to control.

how many array elements are included in long arrays. (See cl_syoscb_cfg::default_printer_verbosity)

Parameters
itemThe sequence item to sprint
cfgThe configuration object for the current scoreboard

Definition at line 303 of file cl_syoscb_string_library.svh.

Referenced by generate_cmp_table_body(), cl_syoscb_compare_io_2hp::primary_loop_do(), cl_syoscb_compare_io::primary_loop_do(), cl_syoscb_compare_iop::primary_loop_do(), cl_syoscb_compare_io::secondary_loop_do(), and cl_syoscb_compare_iop::secondary_loop_do().


The documentation for this class was generated from the following files:

Project: SyoSil ApS UVM Scoreboard, Revision: 1.0.3.0

Copyright 2014-2022 SyoSil ApS
All Rights Reserved Worldwide

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
doxygen
Doxygen Version: 1.8.14
Generated with IDV SV Filter Version: 2.6.3
Fri Sep 2 2022 14:41:15
Find a documentation bug? Report bugs to: scoreboard@syosil.com