PlTbUtils
1.3
PlTbUtils is a collection of functions, procedures and components for easily creating stimuli and checking response in automatic self-checking testbenches.
|
This package defines fuctions and procedures for controlling stimuli to a DUT and checking response. More...
Package Body >> pltbutils_func_pkgFunctions | |
boolean | is_test_active ( constant pltbv: in in pltbv_t ) |
Returns true if a test is active (not skipped), otherwise false. | |
std_logic_vector | to_ascending ( constant s: in std_logic_vector ) |
Converts a vector to ascending range ("to-range"). | |
unsigned | to_ascending ( constant s: in unsigned ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
signed | to_ascending ( constant s: in signed ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
std_logic_vector | to_descending ( constant s: in std_logic_vector ) |
Converts a vector to descending range ("downto-range"). | |
unsigned | to_descending ( constant s: in unsigned ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
signed | to_descending ( constant s: in signed ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
string | hxstr ( constant s: in std_logic_vector constant prefix: in string "" constant postfix: in string "" ) |
Converts a vector to a string in hexadecimal format. | |
string | hxstr ( constant s: in unsigned constant prefix: in string "" constant postfix: in string "" ) |
Converts a vector to a string in hexadecimal format. | |
string | hxstr ( constant s: in signed constant prefix: in string "" constant postfix: in string "" ) |
Converts a vector to a string in hexadecimal format. | |
string | str ( constant n: in integer constant len: in integer constant fillchar: in character ' ' ) |
boolean | str_equal ( constant s1: in STRING , constant s2: in STRING ) |
Function str_equal returns true if strings s1 and s2 are equal, otherwise false. |
Procedures | |
startsim( constant testcase_name: in string constant skiptests: in std_logic_vector variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
Displays a message at start of simulation message, and initializes PlTbUtils' status and control variable and -signal. | |
endsim( variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant show_success_fail: in boolean false constant force_stop: in boolean false ) | |
Displays a message at end of simulation message, presents the simulation results, and stops the simulation. | |
starttest( constant name: in string variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
Sets a number (optional) and a name for a test. The number and name will be printed to the screen, and displayed in the simulator's waveform window. | |
starttest( constant num: in integer - 1 constant name: in string variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
endtest( variable pltbv: inout pltbv_t ,signal pltbs: out pltbs_t ) | |
Prints an end-of-test message to the screen. | |
print( constant active: in boolean variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant txt: in string ) | |
Prints text messages to a signal for viewing in the simulator's waveform window. | |
print( constant active: in boolean signal s: out string constant txt: in string ) | |
print( signal s: out string ,constant txt: in string ) | |
printv( constant active: in boolean variable s: out string constant txt: in string ) | |
printv( variable s: out string ,constant txt: in string ) | |
print( variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant txt: in string ) | |
print2( constant active: in boolean variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant txt: in string ) | |
print2( constant active: in boolean signal s: out string constant txt: in string ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
print2( signal s: out string ,constant txt: in string ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
print2( variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant txt: in string ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitclks( constant N: in natural signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
Waits specified amount of clock cycles of the specified clock. | |
waitsig( signal s: in integer constant value: in integer signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
Waits until a signal has reached a specified value after specified clock edge. | |
waitsig( signal s: in std_logic constant value: in std_logic signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitsig( signal s: in std_logic constant value: in integer signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitsig( signal s: in std_logic_vector constant value: in std_logic_vector signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitsig( signal s: in std_logic_vector constant value: in integer signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitsig( signal s: in unsigned constant value: in unsigned signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitsig( signal s: in unsigned constant value: in integer signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitsig( signal s: in signed constant value: in signed signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitsig( signal s: in signed constant value: in integer signal clk: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitsig( signal s: in std_logic constant value: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
waitsig( signal s: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant falling: in boolean false constant timeout: in time C_PLTBUTILS_TIMEOUT ) | |
check( constant rpt: in string constant actual: in std_logic_vector constant expected: in std_logic_vector constant mask: in std_logic_vector variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
Checks that the value of a signal or variable is equal to expected. | |
check( constant rpt: in string constant actual: in integer constant expected: in integer variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in std_logic constant expected: in std_logic variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in std_logic constant expected: in integer variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in std_logic_vector constant expected: in std_logic_vector variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in std_logic_vector constant expected: in integer variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in std_logic_vector constant expected: in integer constant mask: in std_logic_vector variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in unsigned constant expected: in unsigned variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in unsigned constant expected: in integer variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in signed constant expected: in signed variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in signed constant expected: in integer variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in boolean constant expected: in boolean variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in boolean constant expected: in integer variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in time constant expected: in time variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant actual: in time constant expected: in time constant tolerance: in time variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
check( constant rpt: in string constant actual: in string constant expected: in string variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant expr: in boolean variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
check( constant rpt: in string constant expr: in boolean constant actual: in string constant expected: in string constant mask: in string variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
check base procedure | |
check_binfile( constant rpt: in string constant filename1: in string constant filename2: in string constant verbosity: in integer variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
Checks that the contents of a file is equal to expected contents, by comparing with a reference file. | |
check_txtfile( constant rpt: in string constant filename1: in string constant filename2: in string constant verbosity: in integer variable pltbv: inout pltbv_t signal pltbs: out pltbs_t ) | |
check_txtfile compares two text files. | |
check_datfile( constant rpt: in string constant filename1: in string constant filename2: in string constant verbosity: in integer variable pltbv: inout pltbv_t signal pltbs: out pltbs_t constant skip_init_items: in integer 0 ) | |
check_datfile compares two files with data formatted as follows. The files contain a sequence of data items separated by whitespace (spaces, tabs, newlines). The files can contain comments starting with a hash sign (#), and ending at next newline. | |
pltbs_update( variable pltbv: inout pltbv_t ,signal pltbs: out pltbs_t ) | |
pltbutils internal procedure(s), do not call from user's code |
Constants | |
C_PLTBUTILS_STRLEN | natural := 80 |
C_PLTBUTILS_SKIPTESTLEN | natural := 512 |
C_PLTBUTILS_TIMEOUT | time := 10 sec |
C_WAIT_BEFORE_STOP_TIME | time := 1 us |
EMPTY_CHR | character := ' ' |
C_PLTBV_INIT | pltbv_t := ( testcase_name = > ( others = > EMPTY_CHR ) , testcase_name_len = > 1 , test_num = > 0 , test_name = > ( others = > EMPTY_CHR ) , test_name_len = > 1 , skiptests = > ( others = > ' 0 ' ) , test_active = > true , info = > ( others = > EMPTY_CHR ) , info_len = > 1 , test_cnt = > 0 , skiptest_cnt = > 0 , chk_cnt = > 0 , err_cnt = > 0 , chk_cnt_in_test = > 0 , err_cnt_in_test = > 0 , stop_sim = > ' 0 ' ) |
C_PLTBS_INIT | pltbs_t := ( test_num = > 0 , test_name = > ( others = > EMPTY_CHR ) , info = > ( others = > EMPTY_CHR ) , chk_cnt = > 0 , err_cnt = > 0 , stop_sim = > ' 0 ' ) |
Records | |
pltbv_t | |
Type for status- and control variable. | |
testcase_name | string ( 1 to C_PLTBUTILS_STRLEN ) |
testcase_name_len | integer |
test_num | integer |
test_name | string ( 1 to C_PLTBUTILS_STRLEN ) |
test_name_len | integer |
skiptests | std_logic_vector ( 0 to C_PLTBUTILS_SKIPTESTLEN - 1 ) |
test_active | boolean |
info | string ( 1 to C_PLTBUTILS_STRLEN ) |
info_len | integer |
test_cnt | integer |
skiptest_cnt | integer |
chk_cnt | integer |
err_cnt | integer |
chk_cnt_in_test | integer |
err_cnt_in_test | integer |
stop_sim | std_logic |
pltbs_t | |
Status- and control signal (subset of pltbv_t) | |
test_num | natural |
test_name | string ( 1 to C_PLTBUTILS_STRLEN ) |
info | string ( 1 to C_PLTBUTILS_STRLEN ) |
chk_cnt | natural |
err_cnt | natural |
stop_sim | std_logic |
This package defines fuctions and procedures for controlling stimuli to a DUT and checking response.
Definition at line 46 of file pltbutils_func_pkg.vhd.
|
Procedure |
Checks that the value of a signal or variable is equal to expected.
If not equal, displays an error message and increments the error counter.
rpt | Report message to be displayed in case of mismatch. It is recommended that the message is unique and that it contains the name of the signal or variable being checked. The message should NOT contain the expected value, becase check() prints that automatically. |
actual | The signal or variable to be checked. Supported types: integer, std_logic, std_logic_vector, unsigned, signed, boolean, time, string. |
expected | Expected value. Same type as data or integer. |
mask | Bit mask and:ed to data and expected before comparison. Optional if data is std_logic_vector. Not allowed for other types. |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
Examples
Definition at line 654 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 709 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 664 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 673 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 682 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 691 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 700 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 719 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 728 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 737 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 746 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 755 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 764 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 773 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 815 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
rpt | Report message to be displayed in case of mismatch. It is recommended that the message is unique and that it contains the name of the signal or variable being checked. The message should NOT contain the expected value, becase check() prints that automatically. |
actual | The signal or variable to be checked. Supported types: integer, std_logic, std_logic_vector, unsigned, signed, boolean, time, string. |
expected | Expected value. Same type as data or integer. |
tolerance | Allowed tolerance. Checks that expected - tolerance <= actual <= expected + tolerance is true. |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
Definition at line 805 of file pltbutils_func_pkg.vhd.
|
Procedure |
check base procedure
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
expr | boolean expression for checking. This makes it possible to check any kind of expresion, not just equality. |
rpt | Report message to be displayed in case of mismatch. It is recommended that the message is unique and that it contains the name of the signal or variable being checked. The message should NOT contain the expected value, becase check() prints that automatically. |
actual | The signal or variable to be checked. Supported types: integer, std_logic, std_logic_vector, unsigned, signed, boolean, time, string. |
expected | Expected value. Same type as data or integer. |
mask | Bit mask and:ed to data and expected before comparison. Optional if data is std_logic_vector. Not allowed for other types. |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
All other check procedures perform the check, and calls this procedure with the check result in the expr argument. This procedure can also be called directly. It allow any kind of check, including less than, greater than, ranges, etc. Your calling code must convert actual, expected and mask to strings.
Definition at line 869 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 824 of file pltbutils_func_pkg.vhd.
|
Procedure |
Checks that the contents of a file is equal to expected contents, by comparing with a reference file.
If not equal, displays an error message and increments the error counter. This is useful for examining different types of files generated by testbench components during a simulation against reference files. It can be different kinds of data sequences, video image data, etc.
check_binfile compares two binary files. It uses "file of character" to read bytes from the files. The VHDL LRM does not define how a "file of character" should be written or to/read from disk. In theory, there is a risk that a VHDL file of character is not compatible with a normal binary file, but practical tests done with some popular simulators have shown that they are compatible. This does not guarantee that this procedure works with ALL simulators, and with ALL future versions of the tested simulators. Use your own judgement.
rpt | Report message to be displayed in case of mismatch. It is recommended that the message is unique and that it contains the name of the signal or variable being checked. |
filename1 | Name of first file to be compared, including relative path from the simulator's working directory. |
filename2 | Name of second file to be compared, including relative path from the simulator's working directory. |
verbosity | Controls amount of individual error reports when differences between files are found, to make it possible to prevent flooding with error messages.
|
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
Example
Definition at line 924 of file pltbutils_func_pkg.vhd.
|
Procedure |
check_datfile compares two files with data formatted as follows. The files contain a sequence of data items separated by whitespace (spaces, tabs, newlines). The files can contain comments starting with a hash sign (#), and ending at next newline.
If not equal, displays an error message and increments the error counter. This is useful for examining different types of files generated by testbench components during a simulation against reference files. It can be different kinds of data sequences, video image data, etc.
Only the data items are compared. The types of whitespace and comments are ignored. This is useful for different kinds of data dumps, including some image file formats such as
rpt | Report message to be displayed in case of mismatch. It is recommended that the message is unique and that it contains the name of the signal or variable being checked. |
filename1 | Name of first file to be compared, including relative path from the simulator's working directory. |
filename2 | Name of second file to be compared, including relative path from the simulator's working directory. |
verbosity | Controls amount of individual error reports when differences between files are found, to make it possible to prevent flooding with error messages.
|
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
Example
Definition at line 1023 of file pltbutils_func_pkg.vhd.
|
Procedure |
check_txtfile compares two text files.
If not equal, displays an error message and increments the error counter. This is useful for examining different types of files generated by testbench components during a simulation against reference files. It can be different kinds of data sequences, video image data, etc.
rpt | Report message to be displayed in case of mismatch. It is recommended that the message is unique and that it contains the name of the signal or variable being checked. |
filename1 | Name of first file to be compared, including relative path from the simulator's working directory. |
filename2 | Name of second file to be compared, including relative path from the simulator's working directory. |
verbosity | Controls amount of individual error reports when differences between files are found, to make it possible to prevent flooding with error messages.
|
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
Example
Definition at line 968 of file pltbutils_func_pkg.vhd.
|
Procedure |
Displays a message at end of simulation message, presents the simulation results, and stops the simulation.
Call endsim() only once.
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
show_success_fail | If true, endsim() shows "*** SUCCESS ***", "*** FAIL ***", or "*** NO CHECKS ***". Optional, default is false. |
force_stop | If true, forces the simulation to stop using an assert failure statement. Use this option only if the normal way of stopping the simulation doesn't work (see below). Optional, default is false. |
The testbench should be designed so that all clocks stop when endsim() sets the signal pltbs.stop_sim to '1'. This should stop the simulator. In some cases that doesn't work, then set the force_stop argument to true, which causes a false assert failure, which should stop the simulator. Scripts searching transcript logs for errors and failures, should ignore the failure with "--- FORCE END OF SIMULATION ---" as part of the report.
DO NOT MODIFY the messages "--- END OF SIMULATION ---", "*** SUCCESS ***", "*** FAIL ***", "*** NO CHECKS ***".
DO NOT OUTPUT IDENTICAL MESSAGES anywhere else.
Examples
Definition at line 229 of file pltbutils_func_pkg.vhd.
Prints an end-of-test message to the screen.
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
Example
Definition at line 308 of file pltbutils_func_pkg.vhd.
|
Function |
Converts a vector to a string in hexadecimal format.
An optional prefix can be specified, e.g. "0x", as well as a suffix.
The input argument can have ascending range ( "to-range" ) or descending range ("downto-range"). There is no vector length limitation.
s | constant, signal or variable to convert |
prefix | optional prefix |
postfix | optional suffix |
hexstr | s represented as a hex string |
Examples:
Definition at line 1110 of file pltbutils_func_pkg.vhd.
|
Function |
Converts a vector to a string in hexadecimal format.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1119 of file pltbutils_func_pkg.vhd.
|
Function |
Converts a vector to a string in hexadecimal format.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1128 of file pltbutils_func_pkg.vhd.
|
Function |
Returns true if a test is active (not skipped), otherwise false.
pltbv | PlTbUtils' status- and control variable |
active | True if a test is active |
Example
Definition at line 295 of file pltbutils_func_pkg.vhd.
pltbutils internal procedure(s), do not call from user's code
Definition at line 1135 of file pltbutils_func_pkg.vhd.
|
Procedure |
Prints text messages to a signal for viewing in the simulator's waveform window.
txt | The text. |
active | The text is only printed if active is true. Useful for debug switches, etc. |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
If the string txt is longer than the signal s, the text will be truncated. If txt is shorter, s will be padded with spaces.
Examples
Definition at line 335 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
active | The text is only printed if active is true. Useful for debug switches, etc. |
s | Signal of type string to be printed to. |
txt | The text. |
Definition at line 349 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
txt | The text. |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
Definition at line 397 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
s | Signal of type string to be printed to. |
txt | The text. |
Definition at line 360 of file pltbutils_func_pkg.vhd.
|
Procedure |
Prints both to a signal and to the transcript window. see print() for more information. The type of the output can be string or pltbv_t+pltbs_t.
Examples
Definition at line 412 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 420 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 433 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 427 of file pltbutils_func_pkg.vhd.
|
Procedure |
Does the same thing as print(), but to a variable instead.
s | Variable of type string to be printed to. |
txt | The text. |
active | The text is only printed if active is true. Useful for debug switches, etc. |
Example
Definition at line 377 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
s | Variable of type string to be printed to. |
txt | The text. |
Definition at line 388 of file pltbutils_func_pkg.vhd.
|
Procedure |
Displays a message at start of simulation message, and initializes PlTbUtils' status and control variable and -signal.
Call startsim() only once.
testcase_name | Name of the test case, e.g. "tc1". |
skiptests | std_logic_vector for marking tests that should be skipped. The leftmost bit has position 0, and position numbers increment to the right. A '1' indicates that the test with the same number as the position should be skipped. Note that there is usually no test which has number 0, so bit zero in the vector is usually ignored. This argument is normally fed by a generic. If no tests should be skipped, a zero-length vector is allowed, (""). |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
DO NOT MODIFY the message "--- START OF SIMULATION ---".
DO NOT OUTPUT AN IDENTICAL MESSAGE anywhere else.
Examples
Definition at line 175 of file pltbutils_func_pkg.vhd.
|
Procedure |
Sets a number (optional) and a name for a test. The number and name will be printed to the screen, and displayed in the simulator's waveform window.
The test number and name is also included if there errors reported by the check() procedure calls.
name | Test name. |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
Examples
Definition at line 252 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
num | Test number. Optional, default is to increment the current test number. |
name | Test name. |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
If the test number is omitted, a new test number is automatically computed by incrementing the current test number. Manually setting the test number may make it easier to find the test code in the testbench code, though.
Examples
Definition at line 276 of file pltbutils_func_pkg.vhd.
|
Function |
function str converts integer n to a string with fixed length len and leading fillchar
Definition at line 1142 of file pltbutils_func_pkg.vhd.
|
Function |
Function str_equal returns true if strings s1 and s2 are equal, otherwise false.
The normal VHDL string comparison s1 = s2 only works correctly if the length of the strings are equal. str_equal works even if the lengths differ.
Definition at line 1152 of file pltbutils_func_pkg.vhd.
|
Function |
Converts a vector to ascending range ("to-range").
The argument s can have ascending or descending range. E.g. an argument defined as a std_logic_vector(3 downto 1) will be returned as a std_logic_vector(1 to 3).
s | Constant, signal or variable to convert |
r | Converted value |
Examples
Definition at line 1048 of file pltbutils_func_pkg.vhd.
|
Function |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1053 of file pltbutils_func_pkg.vhd.
|
Function |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1058 of file pltbutils_func_pkg.vhd.
|
Function |
Converts a vector to descending range ("downto-range").
The argument s can have ascending or descending range. E.g. an argument defined as a std_logic_vector(1 to 3) will be returned as a std_logic_vector(3 downto 1).
s | Constant, signal or variable to convert |
r | Converted value |
Examples
Definition at line 1077 of file pltbutils_func_pkg.vhd.
|
Function |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1082 of file pltbutils_func_pkg.vhd.
|
Function |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1087 of file pltbutils_func_pkg.vhd.
|
Procedure |
Waits specified amount of clock cycles of the specified clock.
Or, to be more precise, a specified number of specified clock edges of the specified clock.
N | Number of rising or falling clock edges to wait. |
clk | The clock to wait for. |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
falling | If true, waits for falling edges, otherwise rising edges. Optional, default is false. |
timeout | Timeout time, in case the clock is not working. Optional, default is C_PLTBUTILS_TIMEOUT. |
Examples
Definition at line 463 of file pltbutils_func_pkg.vhd.
|
Procedure |
waitsig std_logic edge, unclocked
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 609 of file pltbutils_func_pkg.vhd.
|
Procedure |
Waits until a signal has reached a specified value after specified clock edge.
s | The signal to test. Supported types: integer, std_logic, std_logic_vector, unsigned, signed. |
value | Value to wait for. Same type as data or integer. |
clk | The clock. |
pltbv,pltbs | PlTbUtils' status- and control variable and -signal. |
falling | If true, waits for falling edges, otherwise rising edges. Optional, default is false. |
timeout | Timeout time, in case the clock is not working. Optional, default is C_PLTBUTILS_TIMEOUT. |
Examples
Definition at line 499 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 510 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 521 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 532 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 543 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 554 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 565 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 576 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 587 of file pltbutils_func_pkg.vhd.
|
Procedure |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 598 of file pltbutils_func_pkg.vhd.
|
Constant |
Definition at line 127 of file pltbutils_func_pkg.vhd.
|
Constant |
Definition at line 49 of file pltbutils_func_pkg.vhd.
|
Constant |
Definition at line 48 of file pltbutils_func_pkg.vhd.
|
Constant |
Definition at line 50 of file pltbutils_func_pkg.vhd.
|
Constant |
Definition at line 91 of file pltbutils_func_pkg.vhd.
|
Constant |
Definition at line 51 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 86 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 84 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 122 of file pltbutils_func_pkg.vhd.
|
Constant |
Definition at line 53 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 87 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 85 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 123 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 81 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 121 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 80 of file pltbutils_func_pkg.vhd.
|
Record |
Status- and control signal (subset of pltbv_t)
test_num | : natural |
test_name | : string(1 to C_PLTBUTILS_STRLEN) |
info | : string(1 to C_PLTBUTILS_STRLEN) |
chk_cnt | : natural |
err_cnt | : natural |
stop_sim | : std_logic |
Definition at line 117 of file pltbutils_func_pkg.vhd.
|
Record |
Type for status- and control variable.
testcase_name | : string(1 to C_PLTBUTILS_STRLEN) |
testcase_name_len | : integer |
test_num | : integer |
test_name | : string(1 to C_PLTBUTILS_STRLEN) |
test_name_len | : integer |
skiptests | : std_logic_vector(0 to C_PLTBUTILS_SKIPTESTLEN-1) |
test_active | : boolean |
info | : string(1 to C_PLTBUTILS_STRLEN) |
info_len | : integer |
test_cnt | : integer |
skiptest_cnt | : integer |
chk_cnt | : integer |
err_cnt | : integer |
chk_cnt_in_test | : integer |
err_cnt_in_test | : integer |
stop_sim | : std_logic |
Definition at line 72 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 83 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 78 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 88 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 124 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 79 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 82 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 77 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 120 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 76 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 119 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 75 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 74 of file pltbutils_func_pkg.vhd.
|
Record |
Definition at line 73 of file pltbutils_func_pkg.vhd.