OpenCores
URL https://opencores.org/ocsvn/pltbutils/pltbutils/trunk

Subversion Repositories pltbutils

[/] [pltbutils/] [trunk/] [src/] [vhdl/] [pltbutils_func_pkg.vhd] - Diff between revs 24 and 36

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 24 Rev 36
Line 48... Line 48...
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.numeric_std.all;
use std.textio.all;
use std.textio.all;
use work.txt_util.all;
use work.txt_util.all;
use work.pltbutils_type_pkg.all; -- Use for VHDL-2002, comment out for VHDL-93
 
use work.pltbutils_user_cfg_pkg.all;
use work.pltbutils_user_cfg_pkg.all;
 
 
package pltbutils_func_pkg is
package pltbutils_func_pkg is
 
 
  -- See the package body for a description of the functions and procedures.
  -- See the package body for a description of the functions and procedures.
  constant C_PLTBUTILS_STRLEN  : natural := 80;
  constant C_PLTBUTILS_STRLEN  : natural := 80;
  constant C_PLTBUTILS_TIMEOUT : time    := 10 sec;
  constant C_PLTBUTILS_TIMEOUT : time    := 10 sec;
  constant C_WAIT_BEFORE_STOP_TIME : time := 1 us;
  constant C_WAIT_BEFORE_STOP_TIME : time := 1 us;
 
 
  -- Counters for number of checks and number of errors
  -- Type for status- and control variable
  -- VHDL-2002:
  type pltbv_t is
  shared variable v_pltbutils_testcase_name : pltbutils_p_string_t;
    record
  shared variable v_pltbutils_testcase_name_len : pltbutils_p_integer_t;
      testcase_name    : string(1 to C_PLTBUTILS_STRLEN);
  shared variable v_pltbutils_test_num  : pltbutils_p_integer_t;
      testcase_name_len: integer;
  shared variable v_pltbutils_test_name : pltbutils_p_string_t;
      test_num         : integer;
  shared variable v_pltbutils_test_name_len : pltbutils_p_integer_t;
      test_name        : string(1 to C_PLTBUTILS_STRLEN);
  shared variable v_pltbutils_info      : pltbutils_p_string_t;
      test_name_len    : integer;
  shared variable v_pltbutils_info_len  : pltbutils_p_integer_t;
      info             : string(1 to C_PLTBUTILS_STRLEN);
  shared variable v_pltbutils_test_cnt  : pltbutils_p_integer_t;
      info_len         : integer;
  shared variable v_pltbutils_chk_cnt   : pltbutils_p_integer_t;
      test_cnt         : integer;
  shared variable v_pltbutils_err_cnt   : pltbutils_p_integer_t;
      chk_cnt          : integer;
  shared variable v_pltbutils_chk_cnt_in_test : pltbutils_p_integer_t;
      err_cnt          : integer;
  shared variable v_pltbutils_err_cnt_in_test : pltbutils_p_integer_t;
      chk_cnt_in_test  : integer;
  shared variable v_pltbutils_stop_sim  : pltbutils_p_std_logic_t;
      err_cnt_in_test  : integer;
  -- VHDL-1993:
      stop_sim         : std_logic;
  --shared variable v_pltbutils_testcase_name : string(1 to C_PLTBUTILS_STRLEN) := (others => ' ');
    end record;
  --shared variable v_pltbutils_testcase_name_len : integer := 1;
 
  --shared variable v_pltbutils_test_num  : natural := 0;
  constant C_PLTBV_INIT : pltbv_t := (
  --shared variable v_pltbutils_test_name : string(1 to C_PLTBUTILS_STRLEN) := (others => ' ');
    (others => ' '),   -- testcase_name
  --shared variable v_pltbutils_test_name_len : integer := 1;
    1,                 -- testcase_name_len
  --shared variable v_pltbutils_info      : string(1 to C_PLTBUTILS_STRLEN) := (others => ' ');
    0,                 -- test_num
  --shared variable v_pltbutils_info_len  : integer := 1;
    (others => ' '),   -- test_name
  --shared variable v_pltbutils_test_cnt  : natural := 0;
    1,                 -- test_name_len
  --shared variable v_pltbutils_chk_cnt   : natural := 0;
    (others => ' '),   -- info
  --shared variable v_pltbutils_err_cnt   : natural := 0;
    1,                 -- info_len
  --shared variable v_pltbutils_chk_cnt_in_test : natural := 0;
    0,                 -- test_cnt
  --shared variable v_pltbutils_err_cnt_in_test : natural := 0;
    0,                 -- chk_cnt
  --shared variable v_pltbutils_stop_sim  : std_logic := '0';
    0,                 -- err_cnt
 
    0,                 -- chk_cnt_in_test
 
    0,                 -- err_cnt_in_test
 
    '0'                -- stop_sim
 
  );
 
 
  -- Global status- and control signal
  -- Status- and control signal (subset of pltbv_t)
  type pltbutils_sc_t is
  type pltbs_t is
    record
    record
      test_num  : natural;
      test_num  : natural;
      test_name : string(1 to C_PLTBUTILS_STRLEN);
      test_name : string(1 to C_PLTBUTILS_STRLEN);
      info      : string(1 to C_PLTBUTILS_STRLEN);
      info      : string(1 to C_PLTBUTILS_STRLEN);
      chk_cnt   : natural;
      chk_cnt   : natural;
      err_cnt   : natural;
      err_cnt   : natural;
      stop_sim  : std_logic;
      stop_sim  : std_logic;
    end record;
    end record;
  signal pltbutils_sc : pltbutils_sc_t;
 
 
  constant C_PLTBS_INIT : pltbs_t := (
 
    0,                  -- test_num
 
    (others => ' '),    -- test_name    
 
    (others => ' '),    -- info
 
    0,                  -- chk_cnt
 
    0,                  -- err_cnt
 
    '0'                 -- stop_sim
 
  );
 
 
  -- startsim 
  -- startsim 
  procedure startsim(
  procedure startsim(
    constant testcase_name      : in    string;
    constant testcase_name      : in    string;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
 
 
  -- endsim
  -- endsim
  procedure endsim(
  procedure endsim(
    signal   pltbutils_sc        : out pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant show_success_fail   : in   boolean := false;
    constant show_success_fail   : in   boolean := false;
    constant force               : in boolean := false
    constant force               : in boolean := false
  );
  );
 
 
  -- starttest
  -- starttest
  procedure starttest(
  procedure starttest(
    constant num                : in    integer := -1;
    constant num                : in    integer := -1;
    constant name               : in    string;
    constant name               : in    string;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure starttest(
  procedure starttest(
    constant name               : in    string;
    constant name               : in    string;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
  );
    signal   pltbs              : out   pltbs_t
 
 
  -- testname (depricated)
 
  procedure testname(
 
    constant num                : in    integer := -1;
 
    constant name               : in    string;
 
    signal   pltbutils_sc       : out   pltbutils_sc_t
 
  );
 
  procedure testname(
 
    constant name               : in    string;
 
    signal   pltbutils_sc       : out   pltbutils_sc_t
 
  );
  );
 
 
  -- endtest
  -- endtest
  procedure endtest(
  procedure endtest(
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
 
 
  -- print, printv, print2
  -- print, printv, print2
  procedure print(
  procedure print(
    constant active             : in    boolean;
    constant active             : in    boolean;
Line 159... Line 164...
  );
  );
  procedure printv(
  procedure printv(
    variable s                  : out   string;
    variable s                  : out   string;
    constant txt                : in    string
    constant txt                : in    string
  );
  );
  procedure printv(
 
    constant active             : in    boolean;
 
    variable s                  : inout pltbutils_p_string_t;
 
    constant txt                : in    string
 
  );
 
  procedure printv(
 
    variable s                  : inout pltbutils_p_string_t;
 
    constant txt                : in    string
 
  );
 
  procedure print(
  procedure print(
    constant active             : in    boolean;
    constant active             : in    boolean;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant txt                : in    string
    constant txt                : in    string
  );
  );
  procedure print(
  procedure print(
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant txt                : in    string
    constant txt                : in    string
  );
  );
  procedure print2(
  procedure print2(
    constant active             : in    boolean;
    constant active             : in    boolean;
    signal   s                  : out   string;
    signal   s                  : out   string;
Line 188... Line 186...
    signal   s                  : out   string;
    signal   s                  : out   string;
    constant txt                : in    string
    constant txt                : in    string
  );
  );
  procedure print2(
  procedure print2(
    constant active             : in    boolean;
    constant active             : in    boolean;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant txt                : in    string
    constant txt                : in    string
  );
  );
  procedure print2(
  procedure print2(
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant txt                : in    string
    constant txt                : in    string
  );
  );
 
 
  -- waitclks
  -- waitclks
  procedure waitclks(
  procedure waitclks(
    constant N                  : in    natural;
    constant N                  : in    natural;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
 
 
  -- waitsig
  -- waitsig
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    integer;
    signal   s                  : in    integer;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    std_logic;
    signal   s                  : in    std_logic;
    constant value              : in    std_logic;
    constant value              : in    std_logic;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    std_logic;
    signal   s                  : in    std_logic;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    std_logic_vector;
    signal   s                  : in    std_logic_vector;
    constant value              : in    std_logic_vector;
    constant value              : in    std_logic_vector;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    std_logic_vector;
    signal   s                  : in    std_logic_vector;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    unsigned;
    signal   s                  : in    unsigned;
    constant value              : in    unsigned;
    constant value              : in    unsigned;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    unsigned;
    signal   s                  : in    unsigned;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    signed;
    signal   s                  : in    signed;
    constant value              : in    signed;
    constant value              : in    signed;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    signed;
    signal   s                  : in    signed;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  );
  );
 
 
  -- check
  -- check
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    integer;
    constant actual             : in    integer;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic;
    constant actual             : in    std_logic;
    constant expected           : in    std_logic;
    constant expected           : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic;
    constant actual             : in    std_logic;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic_vector;
    constant actual             : in    std_logic_vector;
    constant expected           : in    std_logic_vector;
    constant expected           : in    std_logic_vector;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic_vector;
    constant actual             : in    std_logic_vector;
    constant expected           : in    std_logic_vector;
    constant expected           : in    std_logic_vector;
    constant mask               : in    std_logic_vector;
    constant mask               : in    std_logic_vector;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic_vector;
    constant actual             : in    std_logic_vector;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic_vector;
    constant actual             : in    std_logic_vector;
    constant expected           : in    integer;
    constant expected           : in    integer;
    constant mask               : in    std_logic_vector;
    constant mask               : in    std_logic_vector;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    unsigned;
    constant actual             : in    unsigned;
    constant expected           : in    unsigned;
    constant expected           : in    unsigned;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    unsigned;
    constant actual             : in    unsigned;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    signed;
    constant actual             : in    signed;
    constant expected           : in    signed;
    constant expected           : in    signed;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    signed;
    constant actual             : in    signed;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant expr               : in    boolean;
    constant expr               : in    boolean;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
   procedure check(
   procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant expr               : in    boolean;
    constant expr               : in    boolean;
    constant actual             : in    string;
    constant actual             : in    string;
    constant expected           : in    string;
    constant expected           : in    string;
    constant mask               : in    string;
    constant mask               : in    string;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
 
 
  -- to_ascending
  -- to_ascending
  function to_ascending(
  function to_ascending(
    constant s                  : std_logic_vector
    constant s                  : std_logic_vector
Line 402... Line 425...
    constant prefix             : string := "";
    constant prefix             : string := "";
    constant postfix            : string := ""
    constant postfix            : string := ""
  ) return string;
  ) return string;
 
 
  -- pltbutils internal procedure(s), do not call from user's code
  -- pltbutils internal procedure(s), do not call from user's code
  procedure pltbutils_sc_update(
  procedure pltbs_update(
    signal pltbutils_sc : out pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
 
  );
 
 
 
  procedure stopsim(
 
    constant timestamp          : in time
 
  );
 
 
 
  procedure pltbutils_error(
 
    constant rpt                : in string;
 
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  );
  );
 
 
  procedure startsim_msg(
  procedure startsim_msg(
    constant testcase_name      : in string;
    constant testcase_name      : in string;
    constant timestamp          : in time
    constant timestamp          : in time
Line 436... Line 470...
    constant num_errors_in_test : in integer
    constant num_errors_in_test : in integer
  );
  );
 
 
  procedure check_msg(
  procedure check_msg(
    constant rpt                : in string;
    constant rpt                : in string;
 
    constant timestamp          : in time;
    constant expr               : in boolean;
    constant expr               : in boolean;
    constant actual             : in string;
    constant actual             : in string;
    constant expected           : in string;
    constant expected           : in string;
    constant mask               : in string;
    constant mask               : in string;
    constant test_num           : in integer;
    constant test_num           : in integer;
    constant test_name          : in string;
    constant test_name          : in string;
    constant check_num          : in integer;
    constant check_num          : in integer;
    constant err_cnt_in_test    : in integer
    constant err_cnt_in_test    : in integer
  );
  );
 
 
  procedure pltbutils_error(
 
    constant rpt                : in string;
 
    signal   pltbutils_sc       : out   pltbutils_sc_t
 
  );
 
 
 
  procedure error_msg(
  procedure error_msg(
    constant rpt                : in string;
    constant rpt                : in string;
    constant timestamp          : in time;
    constant timestamp          : in time;
    constant test_num           : in integer;
    constant test_num           : in integer;
    constant test_name          : in string;
    constant test_name          : in string;
    constant err_cnt_in_test    : in integer
    constant err_cnt_in_test    : in integer
  );
  );
 
 
  procedure stopsim(
 
    constant timestamp          : in time
 
  );
 
 
 
end package pltbutils_func_pkg;
end package pltbutils_func_pkg;
 
 
package body pltbutils_func_pkg is
package body pltbutils_func_pkg is
 
 
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- startsim
  -- startsim
  --
  --
  -- procedure startsim(
  -- procedure startsim(
  --   constant testcase_name      : in    string;
  --   constant testcase_name      : in    string;
  --   signal   pltbutils_sc       : out   pltbutils_sc_t
  --   variable pltbv              : inout pltbv_t;
 
  --   signal   pltbs              : out   pltbs_t
  -- )
  -- )
  --
  --
  -- Displays a message at start of simulation message, and initializes
  -- Displays a message at start of simulation message, and initializes
  -- PlTbUtils' global status and control signal.
  -- PlTbUtils' status and control variable and -signal.
  -- Call startsim() only once.
  -- Call startsim() only once.
  --
  --
  -- Arguments:
  -- Arguments:
  --   testcase_name            Name of the test case, e.g. "tc1".
  --   testcase_name            Name of the test case, e.g. "tc1".
  --
  --
  --   pltbutils_sc             PlTbUtils' global status- and control signal.
  --   pltbv, pltbs             PlTbUtils' status- and control variable and
  --                            Must be set to pltbutils_sc.
  --                            -signal.
  --
  --
  -- NOTE:
  -- NOTE:
  -- The start-of-simulation message is not only intended to be informative
  -- The start-of-simulation message is not only intended to be informative
  -- for humans. It is also intended to be searched for by scripts,
  -- for humans. It is also intended to be searched for by scripts,
  -- e.g. for collecting results from a large number of regression tests.
  -- e.g. for collecting results from a large number of regression tests.
Line 495... Line 522...
  --
  --
  -- DO NOT MODIFY the message "--- START OF SIMULATION ---".
  -- DO NOT MODIFY the message "--- START OF SIMULATION ---".
  -- DO NOT OUTPUT AN IDENTICAL MESSAGE anywhere else.
  -- DO NOT OUTPUT AN IDENTICAL MESSAGE anywhere else.
  --
  --
  -- Example:
  -- Example:
  -- startsim("tc1", pltbutils_sc);
  -- startsim("tc1", pltbv, pltbs);
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  procedure startsim(
  procedure startsim(
    constant testcase_name      : in    string;
    constant testcase_name      : in    string;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
    variable dummy : integer;
 
    variable timestamp : time;
    variable timestamp : time;
  begin
  begin
    timestamp := now;
    timestamp := now;
 
    pltbv := C_PLTBV_INIT;
 
    printv(pltbv.testcase_name, testcase_name);
 
    pltbv.testcase_name_len := testcase_name'length;
 
    printv(pltbv.test_name, "START OF SIMULATION");
 
    pltbv.test_name_len     := 19;
 
    printv(pltbv.info, testcase_name);
 
    pltbv.info_len          := testcase_name'length;
 
    pltbs_update(pltbv, pltbs);
    if C_PLTBUTILS_USE_STD_STARTSIM_MSG then
    if C_PLTBUTILS_USE_STD_STARTSIM_MSG then
      startsim_msg(testcase_name, timestamp);
      startsim_msg(testcase_name, timestamp);
    end if;
    end if;
    if C_PLTBUTILS_USE_CUSTOM_STARTSIM_MSG then
    if C_PLTBUTILS_USE_CUSTOM_STARTSIM_MSG then
      custom_startsim_msg(testcase_name, timestamp);
      custom_startsim_msg(testcase_name, timestamp);
    end if;
    end if;
    printv(v_pltbutils_info, testcase_name);
 
    -- VHDL-2002:
 
    v_pltbutils_testcase_name.set(testcase_name);
 
    v_pltbutils_testcase_name_len.set(testcase_name'length);
 
    v_pltbutils_stop_sim.clr;
 
    v_pltbutils_test_num.clr;
 
    v_pltbutils_test_name.set("START OF SIMULATION");
 
    v_pltbutils_test_name_len.set(19);
 
    v_pltbutils_chk_cnt.clr;
 
    v_pltbutils_err_cnt.clr;
 
    v_pltbutils_chk_cnt_in_test.clr;
 
    v_pltbutils_err_cnt_in_test.clr;
 
    pltbutils_sc_update(pltbutils_sc);
 
    -- VHDL-1993:
 
    --v_pltbutils_stop_sim := '0';
 
    --v_pltbutils_test_num := 0;
 
    --printv(v_pltbutils_test_name, "START OF SIMULATION");
 
    --v_pltbutils_test_name_len := 19;
 
    --v_pltbutils_chk_cnt := 0;
 
    --v_pltbutils_err_cnt := 0;
 
    --v_pltbutils_chk_cnt_in_test := 0;
 
    --v_pltbutils_err_cnt_in_test := 0;
 
    --pltbutils_sc_update(pltbutils_sc);
 
  end procedure startsim;
  end procedure startsim;
 
 
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- endsim
  -- endsim
  --
  --
  -- procedure endsim(
  -- procedure endsim(
  --   signal   pltbutils_sc       : out pltbutils_sc_t;
  --   variable pltbv              : inout pltbv_t;
 
  --   signal   pltbs              : out   pltbs_t;
  --   constant show_success_fail  : in  boolean := false;
  --   constant show_success_fail  : in  boolean := false;
  --   constant force              : in  boolean := false
  --   constant force              : in  boolean := false
  -- )
  -- )
  --
  --
  -- Displays a message at end of simulation message, presents the simulation
  -- Displays a message at end of simulation message, presents the simulation
  -- results, and stops the simulation. 
  -- results, and stops the simulation. 
  -- Call endsim() it only once.
  -- Call endsim() it only once.
  --
  --
  -- Arguments: 
  -- Arguments: 
  --   pltbutils_sc             PlTbUtils' global status- and control signal.
  --   pltbv, pltbs             PlTbUtils' status- and control variable and
  --                            Must be set to pltbutils_sc.
  --                            -signal.
  --
  --
  --   show_success_fail        If true, endsim() shows "*** SUCCESS ***", 
  --   show_success_fail        If true, endsim() shows "*** SUCCESS ***", 
  --                            "*** FAIL ***", or "*** NO CHECKS ***".
  --                            "*** FAIL ***", or "*** NO CHECKS ***".
  --                            Optional, default is false.
  --                            Optional, default is false.
  --
  --
Line 564... Line 577...
  --                            if the normal way of stopping the simulation
  --                            if the normal way of stopping the simulation
  --                            doesn't work (see below).
  --                            doesn't work (see below).
  --                            Optional, default is false.
  --                            Optional, default is false.
  --
  --
  -- The testbench should be designed so that all clocks stop when endsim()
  -- The testbench should be designed so that all clocks stop when endsim()
  -- sets the signal stop_sim to '1'. This should stop the simulator.
  -- sets the signal pltbs.stop_sim to '1'. This should stop the simulator.
  -- In some cases, that doesn't work, then set the force argument to true, which
  -- In some cases that doesn't work, then set the force argument to true, which
  -- causes a false assert failure, which should stop the simulator.
  -- causes a false assert failure, which should stop the simulator.
  -- Scripts searching transcript logs for errors and failures, should ignore
  -- Scripts searching transcript logs for errors and failures, should ignore
  -- the failure with "--- FORCE END OF SIMULATION ---" as part of the report.
  -- the failure with "--- FORCE END OF SIMULATION ---" as part of the report.
  --
  --
  -- NOTE:
  -- NOTE:
Line 582... Line 595...
  -- DO NOT MODIFY the messages "--- END OF SIMULATION ---", 
  -- DO NOT MODIFY the messages "--- END OF SIMULATION ---", 
  -- "*** SUCCESS ***", "*** FAIL ***", "*** NO CHECKS ***".
  -- "*** SUCCESS ***", "*** FAIL ***", "*** NO CHECKS ***".
  -- DO NOT OUTPUT IDENTICAL MESSAGES anywhere else.
  -- DO NOT OUTPUT IDENTICAL MESSAGES anywhere else.
  --
  --
  -- Examples:
  -- Examples:
  -- endsim(pltbutils_sc);
  -- endsim(pltbv, pltbs);
  -- endsim(pltbutils_sc, true);
  -- endsim(pltbv, pltbs, true);
  -- endsim(pltbutils_sc, true, true);
  -- endsim(pltbv, pltbs, true, true);
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  procedure endsim(
  procedure endsim(
    signal   pltbutils_sc       : out pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant show_success_fail  : in  boolean := false;
    constant show_success_fail  : in  boolean := false;
    constant force              : in  boolean := false
    constant force              : in  boolean := false
  ) is
  ) is
    variable timestamp : time;
    variable timestamp : time;
    variable name_len  : integer;
 
  begin
  begin
    timestamp := now;
    timestamp := now;
    name_len := v_pltbutils_testcase_name_len.value; -- VHDL-2002
 
    --name_len : v_pltbutils_sc_testcase_name_len; -- VHDL-1993
 
    if C_PLTBUTILS_USE_STD_ENDSIM_MSG then
    if C_PLTBUTILS_USE_STD_ENDSIM_MSG then
      -- VHDL-2002:
      endsim_msg(pltbv.testcase_name(1 to pltbv.testcase_name_len), timestamp,
      endsim_msg(v_pltbutils_testcase_name.value(1 to name_len),
        pltbv.test_cnt, pltbv.chk_cnt, pltbv.err_cnt, show_success_fail);
        timestamp, v_pltbutils_test_cnt.value, v_pltbutils_chk_cnt.value,
 
        v_pltbutils_err_cnt.value, show_success_fail);
 
      -- VHDL-1993:
 
      --endsim_msg(v_pltbutils_testcase_name(1 to name_len),
 
      --  timestamp, v_pltbutils_test_cnt, v_pltbutils_chk_cnt,
 
      --  v_pltbutils_err_cnt, show_success_fail);
 
    end if;
    end if;
    if C_PLTBUTILS_USE_CUSTOM_ENDSIM_MSG then
    if C_PLTBUTILS_USE_CUSTOM_ENDSIM_MSG then
      -- VHDL-2002:
      custom_endsim_msg(pltbv.testcase_name(1 to pltbv.testcase_name_len), timestamp,
      custom_endsim_msg(v_pltbutils_testcase_name.value(1 to name_len),
        pltbv.test_cnt, pltbv.chk_cnt, pltbv.err_cnt, show_success_fail);
        timestamp, v_pltbutils_test_cnt.value, v_pltbutils_chk_cnt.value,
    end if;
        v_pltbutils_err_cnt.value, show_success_fail);
    pltbv.test_num      := 0;
      -- VHDL-1993:
    printv(pltbv.test_name, "END OF SIMULATION");
      --custom_endsim_msg(v_pltbutils_testcase_name(1 to name_len),
    pltbv.test_name_len := 17;
      --  timestamp, v_pltbutils_test_cnt, v_pltbutils_chk_cnt,
    pltbv.stop_sim      := '1';
      --  v_pltbutils_err_cnt, show_success_fail);
    pltbs_update(pltbv, pltbs);
    end if;
 
    printv(v_pltbutils_info, "");
 
    -- VHDL-2002:
 
    v_pltbutils_stop_sim.set('1');
 
    v_pltbutils_test_num.clr;
 
    v_pltbutils_test_name.set("END OF SIMULATION");
 
    v_pltbutils_test_name_len.set(17);
 
    -- VHDL-1993:
 
    --v_pltbutils_stop_sim := '1';
 
    --v_pltbutils_test_num := 0;
 
    --printv(v_pltbutils_test_name, "END OF SIMULATION");
 
    --v_pltbutils_test_name_len := 17;
 
    pltbutils_sc_update(pltbutils_sc);
 
    wait for C_WAIT_BEFORE_STOP_TIME;
    wait for C_WAIT_BEFORE_STOP_TIME;
    if force then
    if force then
      if C_PLTBUTILS_USE_STD_STOPSIM then
      if C_PLTBUTILS_USE_STD_STOPSIM then
        stopsim(now);
        stopsim(now);
      end if;
      end if;
Line 647... Line 639...
  -- starttest
  -- starttest
  --
  --
  -- procedure starttest(
  -- procedure starttest(
  --   constant num                : in    integer := -1;
  --   constant num                : in    integer := -1;
  --   constant name               : in    string;
  --   constant name               : in    string;
  --   signal   pltbutils_sc       : out   pltbutils_sc_t
  --   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
  -- 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
  -- be printed to the screen, and displayed in the simulator's waveform
  -- window. 
  -- window. 
Line 662... Line 655...
  --   num                      Test number. Optional, default is to increment
  --   num                      Test number. Optional, default is to increment
  --                            the current test number.
  --                            the current test number.
  --
  --
  --   name                     Test name.
  --   name                     Test name.
  --
  --
  --   pltbutils_sc             PlTbUtils' global status- and control signal.
  --   pltbv, pltbs             PlTbUtils' status- and control variable and
  --                            Must be set to pltbutils_sc.
  --                            -signal.
  --
  --
  -- If the test number is omitted, a new test number is automatically
  -- If the test number is omitted, a new test number is automatically
  -- computed by incrementing the current test number. 
  -- computed by incrementing the current test number. 
  -- Manually setting the test number may make it easier to find the test code
  -- Manually setting the test number may make it easier to find the test code
  -- in the testbench code, though.
  -- in the testbench code, though.
  --
  --
  -- Examples:
  -- Examples:
  -- starttest("Reset test", pltbutils_sc);
  -- starttest("Reset test", pltbv, pltbs);
  -- starttest(1, "Reset test", pltbutils_sc);
  -- starttest(1, "Reset test", pltbv, pltbs);
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  procedure starttest(
  procedure starttest(
    constant num                : in    integer := -1;
    constant num                : in    integer := -1;
    constant name               : in    string;
    constant name               : in    string;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
    variable timestamp : time;
    variable timestamp : time;
  begin
  begin
    timestamp := now;
    timestamp := now;
    -- VHDL-2002:
 
    if num = -1 then
    if num = -1 then
      v_pltbutils_test_num.inc;
      pltbv.test_num := pltbv.test_num + 1;
    else
    else
      v_pltbutils_test_num.set(num);
      pltbv.test_num := num;
    end if;
    end if;
    v_pltbutils_test_cnt.inc;
    printv(pltbv.test_name, name);
    v_pltbutils_test_name.set(name);
    pltbv.test_name_len := name'length;
    v_pltbutils_test_name_len.set(name'length);
    pltbv.test_cnt := pltbv.test_cnt + 1;
    v_pltbutils_err_cnt_in_test.clr;
    pltbv.chk_cnt_in_test := 0;
    pltbutils_sc_update(pltbutils_sc);
    pltbv.err_cnt_in_test := 0;
 
    pltbs_update(pltbv, pltbs);
    if C_PLTBUTILS_USE_STD_STARTTEST_MSG then
    if C_PLTBUTILS_USE_STD_STARTTEST_MSG then
      starttest_msg(v_pltbutils_test_num.value, name, timestamp);
     starttest_msg(pltbv.test_num, name, timestamp);
    end if;
    end if;
    if C_PLTBUTILS_USE_CUSTOM_STARTTEST_MSG then
    if C_PLTBUTILS_USE_CUSTOM_STARTTEST_MSG then
      custom_starttest_msg(v_pltbutils_test_num.value, name, timestamp);
     custom_starttest_msg(pltbv.test_num, name, timestamp);
    end if;
    end if;
 
 
    -- VHDL-1993:
 
    --if num = -1 then
 
    --  b_pltbutils_test_num := v_pltbutils_test_num + 1;
 
    --else
 
    --  v_pltbutils_test_num  := num;
 
    --end if;
 
    --v_pltbutils_test_cnt := v_pltbutils_test_cnt + 1;
 
    --printv(v_pltbutils_test_name, name);
 
    --v_pltbutils_test_name_len := name'length;
 
    --v_pltbutils_err_cnt_in_test := 0;
 
    --pltbutils_sc_update(pltbutils_sc);
 
    --if C_PLTBUTILS_USE_STD_STARTTEST_MSG then
 
    --  starttest_msg(v_pltbutils_test_num, name, timestamp);
 
    --end if;
 
    --if C_PLTBUTILS_USE_CUSTOM_STARTTEST_MSG then
 
    --  custom_starttest_msg(v_pltbutils_test_num, name, timestamp);
 
    --end if;
 
  end procedure starttest;
  end procedure starttest;
 
 
  procedure starttest(
  procedure starttest(
    constant name               : in    string;
    constant name               : in    string;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    starttest(-1, name, pltbutils_sc);
    starttest(-1, name, pltbv, pltbs);
  end procedure starttest;
  end procedure starttest;
 
 
  -- Depricated. Will be removed. Use starttest() instead.
 
  procedure testname(
 
    constant num                : in    integer := -1;
 
    constant name               : in    string;
 
    signal   pltbutils_sc       : out   pltbutils_sc_t
 
  ) is
 
  begin
 
    starttest(num, name, pltbutils_sc);
 
  end procedure testname;
 
 
 
  -- Depricated. Will be removed. Use starttest() instead.
 
  procedure testname(
 
    constant name               : in    string;
 
    signal   pltbutils_sc       : out   pltbutils_sc_t
 
  ) is
 
  begin
 
    testname(-1, name, pltbutils_sc);
 
  end procedure testname;
 
 
 
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- endtest
  -- endtest
  --
  --
  -- procedure endtest(
  -- procedure endtest(
  --   signal   pltbutils_sc       : out   pltbutils_sc_t
  --   variable pltbv              : inout pltbv_t;
 
  --   signal   pltbs              : out   pltbs_t
  -- ) 
  -- ) 
  --
  --
  -- Prints an end-of-test message to the screen.
  -- Prints an end-of-test message to the screen.
  --
  --
  -- Arguments: 
  -- Arguments: 
  --   pltbutils_sc             PlTbUtils' global status- and control signal.
  --   pltbv, pltbs             PlTbUtils' status- and control variable and
  --                            Must be set to pltbutils_sc.
  --                            -signal.
  --
  --
  -- Example:
  -- Example:
  -- endtest(pltbutils_sc);
  -- endtest(pltbv, pltbs);
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  procedure endtest(
  procedure endtest(
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
    variable timestamp : time;
    variable timestamp : time;
    variable v_name_len : integer;
 
  begin
  begin
    timestamp := now;
    timestamp := now;
    -- Uncommented for VHDL-2002 Protected types, otherwise commented:
 
    v_name_len := v_pltbutils_test_name_len.value; -- VHDL-2002
 
    if C_PLTBUTILS_USE_STD_ENDTEST_MSG then
    if C_PLTBUTILS_USE_STD_ENDTEST_MSG then
      endtest_msg(v_pltbutils_test_num.value, v_pltbutils_test_name.value(1 to v_name_len),
      endtest_msg(pltbv.test_num, pltbv.test_name(1 to pltbv.test_name_len),
        timestamp, v_pltbutils_chk_cnt_in_test.value, v_pltbutils_err_cnt_in_test.value);
        timestamp, pltbv.chk_cnt_in_test, pltbv.err_cnt_in_test);
    end if;
    end if;
    if C_PLTBUTILS_USE_CUSTOM_ENDTEST_MSG then
    if C_PLTBUTILS_USE_CUSTOM_ENDTEST_MSG then
      custom_endtest_msg(v_pltbutils_test_num.value, v_pltbutils_test_name.value(1 to v_name_len),
      custom_endtest_msg(pltbv.test_num, pltbv.test_name(1 to pltbv.test_name_len),
        timestamp, v_pltbutils_chk_cnt_in_test.value, v_pltbutils_err_cnt_in_test.value);
        timestamp, pltbv.chk_cnt_in_test, pltbv.err_cnt_in_test);
    end if;
    end if;
    -- Uncommented for not using VHDL-2002 Protected Types, otherwise commented:
    printv(pltbv.test_name, " ");
    --name_len := v_pltbutils_test_name_len; -- VHDL-1993
    pltbv.test_name_len := 1;
    --if C_PLTBUTILS_USE_STD_ENDTEST_MSG then
    pltbs_update(pltbv, pltbs);
    --  endtest_msg(v_pltbutils_test_num, v_pltbutils_test_name(1 to v_name_len),
 
    --    timestamp, v_pltbutils_chk_cnt_in_test, v_pltbutils_err_cnt_in_test);
 
    --end if;  
 
    --if C_PLTBUTILS_USE_CUSTOM_ENDTEST_MSG then
 
    --  custom_endtest_msg(v_pltbutils_test_num, v_pltbutils_test_name(1 to v_name_len),
 
    --    timestamp, v_pltbutils_chk_cnt_in_test, v_pltbutils_err_cnt_in_test);
 
    --end if;  
 
 
 
    printv(v_pltbutils_test_name, " ");
 
    pltbutils_sc_update(pltbutils_sc);
 
  end procedure endtest;
  end procedure endtest;
 
 
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- print printv print2
  -- print printv print2
  --
  --
Line 809... Line 756...
  --   signal   s                  : out   string;
  --   signal   s                  : out   string;
  --   constant txt                : in    string
  --   constant txt                : in    string
  -- ) 
  -- ) 
  --
  --
  -- procedure print(
  -- procedure print(
  --   signal   pltbutils_sc       : out   pltbutils_sc_t;
  --   variable pltbv              : inout pltbv_t;
 
  --   signal   pltbs              : out   pltbs_t;
  --   constant txt                : in    string
  --   constant txt                : in    string
  -- )
  -- )
  --
  --
  -- procedure print(
  -- procedure print(
  --   constant active             : in    boolean;
  --   constant active             : in    boolean;
  --   signal   pltbutils_sc       : out   pltbutils_sc_t;
  --   variable pltbv              : inout pltbv_t;
 
  --   signal   pltbs              : out   pltbs_t;
  --   constant txt                : in    string
  --   constant txt                : in    string
  -- )
  -- )
  --
  --
  -- procedure printv(
  -- procedure printv(
  --   variable s                  : out   string;
  --   variable s                  : out   string;
Line 842... Line 791...
  --   signal   s                  : out   string;
  --   signal   s                  : out   string;
  --   constant txt                : in    string
  --   constant txt                : in    string
  -- )
  -- )
  --
  --
  -- procedure print2(    
  -- procedure print2(    
  --   signal   pltbutils          : out   pltbutils_sc_t;
  --   variable pltbv              : inout pltbv_t;
 
  --   signal   pltbs              : out   pltbs_t;
  --   constant txt                : in    string
  --   constant txt                : in    string
  -- )
  -- )
  --
  --
  -- procedure print2(    
  -- procedure print2(    
  --   constant active             : in    boolean;
  --   constant active             : in    boolean;
  --   signal   pltbutils          : out   pltbutils_sc_t;
  --   variable pltbv              : inout pltbv_t;
 
  --   signal   pltbs              : out   pltbs_t;
  --   constant txt                : in    string
  --   constant txt                : in    string
  -- )
  -- )
  --
  --
  -- print() prints text messages to a signal for viewing in the simulator's
  -- print() prints text messages to a signal for viewing in the simulator's
  -- waveform window. printv() does the same thing, but to a variable instead.
  -- waveform window. printv() does the same thing, but to a variable instead.
  -- print2() prints both to a signal and to the transcript window. 
  -- print2() prints both to a signal and to the transcript window. 
  -- The type of the output can be string or pltbutils_sc_t.
  -- The type of the output can be string or pltbv_t+pltbs_t.
  -- If the type is pltbutils_sc_t, the name can be no other than pltbutils_sc.
 
  --
  --
  -- Arguments: 
  -- Arguments: 
  --   s                        Signal or variable of type string to be 
  --   s                        Signal or variable of type string to be 
  --                            printed to.
  --                            printed to.
  --
  --
  --   txt                      The text.
  --   txt                      The text.
  --
  --
  --   active                   The text is only printed if active is true.
  --   active                   The text is only printed if active is true.
  --                            Useful for debug switches, etc.
  --                            Useful for debug switches, etc.
  --
  --
  --   pltbutils_sc             PlTbUtils' global status- and control signal 
  --   pltbv, pltbs             PlTbUtils' status- and control variable and
  --                            of type pltbutils_sc_t. 
  --                            -signal.
  --                            The name must be no other than pltbutils_sc.
 
  --
  --
  -- If the string txt  is longer than the signal s, the text will be truncated.
  -- 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.
  -- If txt  is shorter, s will be padded with spaces.
  --
  --
  -- Examples:
  -- Examples:
  -- print(msg, "Hello, world"); -- Prints to signal msg
  -- print(msg, "Hello, world"); -- Prints to signal msg
  -- print(G_DEBUG, msg, "Hello, world"); -- Prints to signal msg if 
  -- print(G_DEBUG, msg, "Hello, world"); -- Prints to signal msg if 
  --                                      -- generic G_DEBUG is true
  --                                      -- generic G_DEBUG is true
  -- printv(v_msg, "Hello, world"); -- Prints to variable msg
  -- printv(v_msg, "Hello, world"); -- Prints to variable msg
  -- print(pltbutils_sc, "Hello, world"); -- Prints to "info" in waveform window
  -- print(pltbv, pltbs, "Hello, world"); -- Prints to "info" in waveform window
  -- print2(msg, "Hello, world"); -- Prints to signal and transcript window 
  -- print2(msg, "Hello, world"); -- Prints to signal and transcript window 
  -- print(pltbutils_sc, "Hello, world"); -- Prints to "info" in waveform and
  -- print2(pltbv, pltbs, "Hello, world"); -- Prints to "info" in waveform and
  --                                      -- transcript windows
  --                                      -- transcript windows
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  procedure print(
  procedure print(
    constant active             : in    boolean;
    constant active             : in    boolean;
    signal   s                  : out   string;
    signal   s                  : out   string;
Line 938... Line 887...
  ) is
  ) is
  begin
  begin
    printv(true, s, txt);
    printv(true, s, txt);
  end procedure printv;
  end procedure printv;
 
 
  -- VHDL-2002:
  -- Print to info element in pltbv/pltbs, which shows up in waveform window
  procedure printv(
 
    constant active             : in    boolean;
 
    variable s                  : inout pltbutils_p_string_t;
 
    constant txt                : in    string
 
  ) is
 
    variable j : positive := txt 'low;
 
  begin
 
    if active then
 
      s.set(txt);
 
    end if;
 
  end procedure printv;
 
 
 
  procedure printv(
 
    variable s                  : inout pltbutils_p_string_t;
 
    constant txt                : in    string
 
  ) is
 
  begin
 
    printv(true, s, txt);
 
  end procedure printv;
 
 
 
  -- Print to info element in pltbutils_sc, which shows up in waveform window
 
  procedure print(
  procedure print(
    constant active             : in    boolean;
    constant active             : in    boolean;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant txt                : in    string
    constant txt                : in    string
  ) is
  ) is
    variable j : positive := txt 'low;
    variable j : positive := txt 'low;
  begin
  begin
    if active then
    if active then
      printv(v_pltbutils_info, txt );
      printv(pltbv.info, txt);
      pltbutils_sc_update(pltbutils_sc);
      pltbv.info_len := txt'length;
 
      pltbs_update(pltbv, pltbs);
    end if;
    end if;
  end procedure print;
  end procedure print;
 
 
  procedure print(
  procedure print(
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant txt                : in    string
    constant txt                : in    string
  ) is
  ) is
  begin
  begin
    print(true, pltbutils_sc, txt);
    print(true, pltbv, pltbs, txt);
  end procedure print;
  end procedure print;
 
 
  procedure print2(
  procedure print2(
    constant active             : in    boolean;
    constant active             : in    boolean;
    signal   s                  : out   string;
    signal   s                  : out   string;
Line 1003... Line 934...
    print(true, s, txt);
    print(true, s, txt);
  end procedure print2;
  end procedure print2;
 
 
  procedure print2(
  procedure print2(
    constant active             : in    boolean;
    constant active             : in    boolean;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant txt                : in    string
    constant txt                : in    string
  ) is
  ) is
  begin
  begin
    print(pltbutils_sc, txt );
    print(active, pltbv, pltbs, txt);
    print(txt);
    print(active, txt);
  end procedure print2;
  end procedure print2;
 
 
  procedure print2(
  procedure print2(
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant txt                : in    string
    constant txt                : in    string
  ) is
  ) is
  begin
  begin
    print(true, pltbutils_sc, txt);
    print(true, pltbv, pltbs, txt);
  end procedure print2;
  end procedure print2;
 
 
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- waitclks
  -- waitclks
  --
  --
  -- procedure waitclks(
  -- procedure waitclks(
  --   constant n                  : in    natural;
  --   constant n                  : in    natural;
  --   signal   clk                : in    std_logic;
  --   signal   clk                : in    std_logic;
  --   signal   pltbutils_sc       : out   pltbutils_sc_t;
  --   variable pltbv              : inout pltbv_t;
 
  --   signal   pltbs              : out   pltbs_t;
  --   constant falling            : in    boolean := false;
  --   constant falling            : in    boolean := false;
  --   constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  --   constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  -- )
  -- )
  --
  --
  -- Waits specified amount of clock cycles of the specified clock.
  -- Waits specified amount of clock cycles of the specified clock.
Line 1039... Line 973...
  -- Arguments: 
  -- Arguments: 
  --   n                        Number of rising or falling clock edges to wait.
  --   n                        Number of rising or falling clock edges to wait.
  --
  --
  --   clk                      The clock to wait for.
  --   clk                      The clock to wait for.
  --
  --
  --   pltbutils_sc             PlTbUtils' global status- and control signal.
  --   pltbv, pltbs             PlTbUtils' status- and control variable and
  --                            Must be set to pltbutils_sc.
  --                            -signal.
  --
  --
  --   falling                  If true, waits for falling edges, otherwise
  --   falling                  If true, waits for falling edges, otherwise
  --                            rising edges. Optional, default is false.
  --                            rising edges. Optional, default is false.
  --
  --
  --   timeout                  Timeout time, in case the clock is not working.
  --   timeout                  Timeout time, in case the clock is not working.
  --                            Optional, default is C_PLTBUTILS_TIMEOUT.  
  --                            Optional, default is C_PLTBUTILS_TIMEOUT.  
  --
  --
  -- Examples:
  -- Examples:
  -- waitclks(5, sys_clk, pltbutils_sc);
  -- waitclks(5, sys_clk, pltbv, pltbs);
  -- waitclks(5, sys_clk, pltbutils_sc, true);
  -- waitclks(5, sys_clk, pltbv, pltbs true);
  -- waitclks(5, sys_clk, pltbutils_sc, true, 1 ms);
  -- waitclks(5, sys_clk, pltbv, pltbs, true, 1 ms);
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  procedure waitclks(
  procedure waitclks(
    constant n                  : in    natural;
    constant n                  : in    natural;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable i                  : natural := n;
    variable i                  : natural := n;
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
Line 1073... Line 1008...
        wait until rising_edge(clk)  for timeout / n;
        wait until rising_edge(clk)  for timeout / n;
      end if;
      end if;
      i := i - 1;
      i := i - 1;
    end loop;
    end loop;
    if now >= v_timeout_time then
    if now >= v_timeout_time then
      pltbutils_error("waitclks() timeout", pltbutils_sc);
      pltbutils_error("waitclks() timeout", pltbv, pltbs);
    end if;
    end if;
  end procedure waitclks;
  end procedure waitclks;
 
 
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- waitsig
  -- waitsig
  --
  --
  -- procedure waitsig(
  -- procedure waitsig(
  --   signal   s                  : in    integer|std_logic|std_logic_vector|unsigned|signed;
  --   signal   s                  : in    integer|std_logic|std_logic_vector|unsigned|signed;
  --   constant value              : in    integer|std_logic|std_logic_vector|unsigned|signed;
  --   constant value              : in    integer|std_logic|std_logic_vector|unsigned|signed;
  --   signal   clk                : in    std_logic;
  --   signal   clk                : in    std_logic;
  --   signal   pltbutils_sc       : out   pltbutils_sc_t;
  --   variable pltbv              : inout pltbv_t;
 
  --   signal   pltbs              : out   pltbs_t;
  --   constant falling            : in    boolean := false;
  --   constant falling            : in    boolean := false;
  --   constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  --   constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  -- )
  -- )
  --
  --
  -- Waits until a signal has reached a specified value after specified clock
  -- Waits until a signal has reached a specified value after specified clock
Line 1102... Line 1038...
  --   value                    Value to wait for.
  --   value                    Value to wait for.
  --                            Same type as data or integer.
  --                            Same type as data or integer.
  --
  --
  --   clk                      The clock.
  --   clk                      The clock.
  --
  --
  --   pltbutils_sc             PlTbUtils' global status- and control signal.
  --   pltbv, pltbs             PlTbUtils' status- and control variable and
  --                            Must be set to pltbutils_sc.
  --                            -signal.
  --
  --
  --   falling                  If true, waits for falling edges, otherwise
  --   falling                  If true, waits for falling edges, otherwise
  --                            rising edges. Optional, default is false.
  --                            rising edges. Optional, default is false.
  --
  --
  --   timeout                  Timeout time, in case the clock is not working.
  --   timeout                  Timeout time, in case the clock is not working.
  --                            Optional, default is C_PLTBUTILS_TIMEOUT.  
  --                            Optional, default is C_PLTBUTILS_TIMEOUT.  
  --
  --
  -- Examples:
  -- Examples:
  -- waitsig(wr_en, '1', sys_clk, pltbutils_sc);
  -- waitsig(wr_en, '1', sys_clk, pltbv, pltbs);
  -- waitsig(rd_en,   1, sys_clk, pltbutils_sc, true);
  -- waitsig(rd_en,   1, sys_clk, pltbv, pltbs, true);
  -- waitclks(full, '1', sys_clk, pltbutils_sc, true, 1 ms);
  -- waitclks(full, '1', sys_clk, pltbv, pltbs, true, 1 ms);
  ---------------------------------------------------------------------------- 
  ---------------------------------------------------------------------------- 
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    integer;
    signal   s                  : in    integer;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
  begin
  begin
    v_timeout_time := now + timeout;
    v_timeout_time := now + timeout;
    l1 : loop
    l1 : loop
      waitclks(1, clk, pltbutils_sc, falling, timeout);
      waitclks(1, clk, pltbv, pltbs, falling, timeout);
      exit l1 when s = value or now >= v_timeout_time;
      exit l1 when s = value or now >= v_timeout_time;
    end loop;
    end loop;
    if now >= v_timeout_time then
    if now >= v_timeout_time then
      pltbutils_error("waitsig() timeout", pltbutils_sc);
      pltbutils_error("waitsig() timeout", pltbv, pltbs);
    end if;
    end if;
  end procedure waitsig;
  end procedure waitsig;
 
 
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    std_logic;
    signal   s                  : in    std_logic;
    constant value              : in    std_logic;
    constant value              : in    std_logic;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
  begin
  begin
    v_timeout_time := now + timeout;
    v_timeout_time := now + timeout;
    l1 : loop
    l1 : loop
      waitclks(1, clk, pltbutils_sc, falling, timeout);
      waitclks(1, clk, pltbv, pltbs, falling, timeout);
      exit l1 when s = value or now >= v_timeout_time;
      exit l1 when s = value or now >= v_timeout_time;
    end loop;
    end loop;
    if now >= v_timeout_time then
    if now >= v_timeout_time then
      pltbutils_error("waitsig() timeout", pltbutils_sc);
      pltbutils_error("waitsig() timeout", pltbv, pltbs);
    end if;
    end if;
  end procedure waitsig;
  end procedure waitsig;
 
 
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    std_logic;
    signal   s                  : in    std_logic;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable v_value            : std_logic;
    variable v_value            : std_logic;
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
Line 1173... Line 1112...
      when 0      => v_value := '0';
      when 0      => v_value := '0';
      when 1      => v_value := '1';
      when 1      => v_value := '1';
      when others => v_value := 'X';
      when others => v_value := 'X';
    end case;
    end case;
    if v_value /= 'X' then
    if v_value /= 'X' then
      waitsig(s, v_value, clk,
      waitsig(s, v_value, clk, pltbv, pltbs, falling, timeout);
              pltbutils_sc, falling, timeout);
 
    else
    else
      pltbutils_error("waitsig() timeout", pltbutils_sc);
      pltbutils_error("waitsig() timeout", pltbv, pltbs);
    end if;
    end if;
  end procedure waitsig;
  end procedure waitsig;
 
 
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    std_logic_vector;
    signal   s                  : in    std_logic_vector;
    constant value              : in    std_logic_vector;
    constant value              : in    std_logic_vector;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
  begin
  begin
    v_timeout_time := now + timeout;
    v_timeout_time := now + timeout;
    l1 : loop
    l1 : loop
      waitclks(1, clk, pltbutils_sc, falling, timeout);
      waitclks(1, clk, pltbv, pltbs, falling, timeout);
      exit l1 when s = value or now >= v_timeout_time;
      exit l1 when s = value or now >= v_timeout_time;
    end loop;
    end loop;
    if now >= v_timeout_time then
    if now >= v_timeout_time then
      pltbutils_error("waitsig() timeout", pltbutils_sc);
      pltbutils_error("waitsig() timeout", pltbv, pltbs);
    end if;
    end if;
  end procedure waitsig;
  end procedure waitsig;
 
 
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    std_logic_vector;
    signal   s                  : in    std_logic_vector;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
  begin
  begin
    waitsig(s, std_logic_vector(to_unsigned(value, s'length)), clk,
    waitsig(s, std_logic_vector(to_unsigned(value, s'length)), clk,
            pltbutils_sc, falling, timeout);
            pltbv, pltbs, falling, timeout);
  end procedure waitsig;
  end procedure waitsig;
 
 
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    unsigned;
    signal   s                  : in    unsigned;
    constant value              : in    unsigned;
    constant value              : in    unsigned;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
  begin
  begin
    v_timeout_time := now + timeout;
    v_timeout_time := now + timeout;
    l1 : loop
    l1 : loop
      waitclks(1, clk, pltbutils_sc, falling, timeout);
      waitclks(1, clk, pltbv, pltbs, falling, timeout);
      exit l1 when s = value or now >= v_timeout_time;
      exit l1 when s = value or now >= v_timeout_time;
    end loop;
    end loop;
    if now >= v_timeout_time then
    if now >= v_timeout_time then
      pltbutils_error("waitsig() timeout", pltbutils_sc);
      pltbutils_error("waitsig() timeout", pltbv, pltbs);
    end if;
    end if;
  end procedure waitsig;
  end procedure waitsig;
 
 
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    unsigned;
    signal   s                  : in    unsigned;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
  begin
  begin
    waitsig(s, to_unsigned(value, s'length), clk,
    waitsig(s, to_unsigned(value, s'length), clk,
            pltbutils_sc, falling, timeout);
            pltbv, pltbs, falling, timeout);
  end procedure waitsig;
  end procedure waitsig;
 
 
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    signed;
    signal   s                  : in    signed;
    constant value              : in    signed;
    constant value              : in    signed;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
  begin
  begin
    v_timeout_time := now + timeout;
    v_timeout_time := now + timeout;
    l1 : loop
    l1 : loop
      waitclks(1, clk, pltbutils_sc, falling, timeout);
      waitclks(1, clk, pltbv, pltbs, falling, timeout);
      exit l1 when s = value or now >= v_timeout_time;
      exit l1 when s = value or now >= v_timeout_time;
    end loop;
    end loop;
    if now >= v_timeout_time then
    if now >= v_timeout_time then
      pltbutils_error("waitsig() timeout", pltbutils_sc);
      pltbutils_error("waitsig() timeout", pltbv, pltbs);
    end if;
    end if;
  end procedure waitsig;
  end procedure waitsig;
 
 
  procedure waitsig(
  procedure waitsig(
    signal   s                  : in    signed;
    signal   s                  : in    signed;
    constant value              : in    integer;
    constant value              : in    integer;
    signal   clk                : in    std_logic;
    signal   clk                : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t;
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t;
    constant falling            : in    boolean := false;
    constant falling            : in    boolean := false;
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
    constant timeout            : in    time    := C_PLTBUTILS_TIMEOUT
  ) is
  ) is
    variable v_timeout_time     : time;
    variable v_timeout_time     : time;
  begin
  begin
    waitsig(s, to_signed(value, s'length), clk,
    waitsig(s, to_signed(value, s'length), clk,
            pltbutils_sc, falling, timeout);
            pltbv, pltbs, falling, timeout);
  end procedure waitsig;
  end procedure waitsig;
 
 
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- check
  -- check
  --
  --
  -- procedure check(
  -- procedure check(
  --  constant rpt              : in    string;
  --  constant rpt              : in    string;
  --  constant actual           : in    integer|std_logic|std_logic_vector|unsigned|signed;
  --  constant actual           : in    integer|std_logic|std_logic_vector|unsigned|signed;
  --  constant expected         : in    integer|std_logic|std_logic_vector|unsigned|signed;
  --  constant expected         : in    integer|std_logic|std_logic_vector|unsigned|signed;
  --  signal   pltbutils_sc     : out   pltbutils_sc_t
  --   variable pltbv           : inout pltbv_t;
 
  --   signal   pltbs           : out   pltbs_t
  --  )
  --  )
  --
  --
  -- procedure check(
  -- procedure check(
  --  constant rpt              : in    string;
  --  constant rpt              : in    string;
  --  constant actual           : in    std_logic_vector;
  --  constant actual           : in    std_logic_vector;
  --  constant expected         : in    std_logic_vector;
  --  constant expected         : in    std_logic_vector;
  --  constant mask             : in    std_logic_vector;
  --  constant mask             : in    std_logic_vector;
  --  signal   pltbutils_sc     : out   pltbutils_sc_t
  --   variable pltbv           : inout pltbv_t;
 
  --   signal   pltbs           : out   pltbs_t
  --  )
  --  )
  --
  --
  -- procedure check(
  -- procedure check(
  --   constant rpt            : in    string;
  --   constant rpt            : in    string;
  --   constant expr           : in    boolean;
  --   constant expr           : in    boolean;
  --   signal   pltbutils_sc   : out   pltbutils_sc_t
  --   variable pltbv           : inout pltbv_t;
 
  --   signal   pltbs           : out   pltbs_t
  -- )
  -- )
  --
  --
  -- Checks that the value of a signal or variable is equal to expected.
  -- 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.
  -- If not equal, displays an error message and increments the error counter.
  --
  --
Line 1335... Line 1282...
  --
  --
  --   expr                     boolean expression for checking.
  --   expr                     boolean expression for checking.
  --                            This makes it possible to check any kind of
  --                            This makes it possible to check any kind of
  --                            expresion, not just equality.
  --                            expresion, not just equality.
  -- 
  -- 
  --   pltbutils_sc             PlTbUtils' global status- and control signal.
  --   pltbv, pltbs             PlTbUtils' status- and control variable and
  --                            Must be set to the name pltbutils_sc.
  --                            -signal.
  --
  --
  -- Examples:
  -- Examples:
  -- check("dat_o after reset", dat_o, 0, pltbutils_sc);
  -- check("dat_o after reset", dat_o, 0, pltbv, pltbs);
  -- -- With mask:
  -- -- With mask:
  -- check("Status field in reg_o after start", reg_o, x"01", x"03", pltbutils_sc);
  -- check("Status field in reg_o after start", reg_o, x"01", x"03", pltbv, pltbs);
  -- -- Boolean expression:
  -- -- Boolean expression:
  -- check("Counter after data burst", cnt_o > 10, pltbutils_sc);
  -- check("Counter after data burst", cnt_o > 10, pltbv, pltbs);
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- check integer
  -- check integer
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    integer;
    constant actual             : in    integer;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, actual = expected, str(actual), str(expected), "", pltbutils_sc);
    check(rpt, actual = expected, str(actual), str(expected), "", pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check std_logic
  -- check std_logic
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic;
    constant actual             : in    std_logic;
    constant expected           : in    std_logic;
    constant expected           : in    std_logic;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, actual = expected, str(actual), str(expected), "", pltbutils_sc);
    check(rpt, actual = expected, str(actual), str(expected), "", pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check std_logic against integer
  -- check std_logic against integer
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic;
    constant actual             : in    std_logic;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
   -- variable v_expected : std_logic;
 
    --variable equal : boolean;   
 
  begin
  begin
    check(rpt, ((actual = '0' and expected = 0) or (actual = '1' and expected = 1)),
    check(rpt, ((actual = '0' and expected = 0) or (actual = '1' and expected = 1)),
          str(actual), str(expected), "", pltbutils_sc);
          str(actual), str(expected), "", pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check std_logic_vector
  -- check std_logic_vector
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic_vector;
    constant actual             : in    std_logic_vector;
    constant expected           : in    std_logic_vector;
    constant expected           : in    std_logic_vector;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, actual = expected, hxstr(actual, "0x"), hxstr(expected, "0x"), "", pltbutils_sc);
    check(rpt, actual = expected, hxstr(actual, "0x"), hxstr(expected, "0x"), "", pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check std_logic_vector with mask
  -- check std_logic_vector with mask
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic_vector;
    constant actual             : in    std_logic_vector;
    constant expected           : in    std_logic_vector;
    constant expected           : in    std_logic_vector;
    constant mask               : in    std_logic_vector;
    constant mask               : in    std_logic_vector;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, (actual and mask) = (expected and mask),
    check(rpt, (actual and mask) = (expected and mask),
          hxstr(actual, "0x"), hxstr(expected, "0x"), hxstr(mask, "0x"), pltbutils_sc);
          hxstr(actual, "0x"), hxstr(expected, "0x"), hxstr(mask, "0x"), pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check std_logic_vector against integer
  -- check std_logic_vector against integer
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic_vector;
    constant actual             : in    std_logic_vector;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, actual, std_logic_vector(to_signed(expected, actual'length)), pltbutils_sc);
    check(rpt, actual, std_logic_vector(to_signed(expected, actual'length)), pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check std_logic_vector with mask against integer
  -- check std_logic_vector with mask against integer
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    std_logic_vector;
    constant actual             : in    std_logic_vector;
    constant expected           : in    integer;
    constant expected           : in    integer;
    constant mask               : in    std_logic_vector;
    constant mask               : in    std_logic_vector;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, actual, std_logic_vector(to_signed(expected, actual'length)), mask, pltbutils_sc);
    check(rpt, actual, std_logic_vector(to_signed(expected, actual'length)), mask, pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check unsigned
  -- check unsigned
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    unsigned;
    constant actual             : in    unsigned;
    constant expected           : in    unsigned;
    constant expected           : in    unsigned;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, actual = expected, hxstr(actual, "0x"), hxstr(expected, "0x"), "", pltbutils_sc);
    check(rpt, actual = expected, hxstr(actual, "0x"), hxstr(expected, "0x"), "", pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check unsigned against integer
  -- check unsigned against integer
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    unsigned;
    constant actual             : in    unsigned;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, actual, to_unsigned(expected, actual'length), pltbutils_sc);
    check(rpt, actual, to_unsigned(expected, actual'length), pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check signed
  -- check signed
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    signed;
    constant actual             : in    signed;
    constant expected           : in    signed;
    constant expected           : in    signed;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, actual = expected, hxstr(actual, "0x"), hxstr(expected, "0x"), "", pltbutils_sc);
    check(rpt, actual = expected, hxstr(actual, "0x"), hxstr(expected, "0x"), "", pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check signed against integer
  -- check signed against integer
  -- TODO: find the bug reported by tb_pltbutils when expected  is negative (-1):
  -- TODO: find the bug reported by tb_pltbutils when expected  is negative (-1):
  --       ** Error: (vsim-86) numstd_conv_unsigned_nu: NATURAL arg value is negative (-1)
  --       ** Error: (vsim-86) numstd_conv_unsigned_nu: NATURAL arg value is negative (-1)
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant actual             : in    signed;
    constant actual             : in    signed;
    constant expected           : in    integer;
    constant expected           : in    integer;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, actual, to_signed(expected, actual'length), pltbutils_sc);
    check(rpt, actual, to_signed(expected, actual'length), pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  -- check with boolean expression
  -- check with boolean expression
  -- Check signal or variable with a boolean expression as argument C_EXPR.
  -- Check signal or variable with a boolean expression as argument C_EXPR.
  -- This allowes any kind of check.
  -- This allowes any kind of check.
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant expr               : in    boolean;
    constant expr               : in    boolean;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
  begin
  begin
    check(rpt, expr, "", "", "", pltbutils_sc);
    check(rpt, expr, "", "", "", pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  procedure check(
  procedure check(
    constant rpt                : in    string;
    constant rpt                : in    string;
    constant expr               : in    boolean;
    constant expr               : in    boolean;
    constant actual             : in    string;
    constant actual             : in    string;
    constant expected           : in    string;
    constant expected           : in    string;
    constant mask               : in    string;
    constant mask               : in    string;
    signal   pltbutils_sc       : out   pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
  ) is
  ) is
    variable v_test_name_len    : integer := 1;
    variable timestamp          : time;
    variable actual_str         : string(1 to 32) := (others => ' ');
 
    variable actual_str_len     : integer := 1;
 
    variable expected_str       : string(1 to 32) := (others => ' ');
 
    variable expected_str_len   : integer := 1;
 
    variable mask_str           : string(1 to 32) := (others => ' ');
 
    variable mask_str_len       : integer := 1;
 
  begin
  begin
    v_pltbutils_chk_cnt.inc; -- VHDL-2002
    timestamp := now;
    --v_pltbutils_chk_cnt := v_pltbutils_chk_cnt + 1; -- VHDL-1993
    pltbv.chk_cnt := pltbv.chk_cnt + 1;
 
    pltbv.chk_cnt_in_test := pltbv.chk_cnt_in_test + 1;
    if not expr then
    if not expr then
      v_pltbutils_err_cnt.inc; -- VHDL-2002
      pltbv.err_cnt := pltbv.err_cnt + 1;
      v_pltbutils_err_cnt_in_test.inc; -- VHDL-2002
      pltbv.err_cnt_in_test := pltbv.err_cnt_in_test + 1;
      --v_pltbutils_err_cnt := v_pltbutils_err_cnt + 1; -- VHDL-1993
 
      --v_pltbutils_err_cnt_in_test := v_pltbutils_err_cnt_in_test + 1; -- VHDL-1993
 
    end if;
    end if;
    v_test_name_len := v_pltbutils_test_name_len.value;
    pltbs_update(pltbv, pltbs);
    if C_PLTBUTILS_USE_STD_CHECK_MSG then
    if C_PLTBUTILS_USE_STD_CHECK_MSG then
      check_msg(rpt, expr, actual, expected, mask, v_pltbutils_test_num.value,
      check_msg(rpt, timestamp, expr, actual, expected, mask, pltbv.test_num,
        v_pltbutils_test_name.value(1 to v_test_name_len), v_pltbutils_chk_cnt.value,
        pltbv.test_name(1 to pltbv.test_name_len), pltbv.chk_cnt, pltbv.err_cnt_in_test);
        v_pltbutils_err_cnt_in_test.value); -- VHDL-2002
 
      --check_msg(rpt, actual, expected, mask, v_pltbutils_test_num,
 
      --  v_pltbutils_test_name(1 to v_test_name_len), v_pltbutils_chk_cnt,
 
      --  v_pltbutils_err_cnt_in_test); -- VHDL-2002
 
    end if;
    end if;
    if C_PLTBUTILS_USE_CUSTOM_CHECK_MSG then
    if C_PLTBUTILS_USE_CUSTOM_CHECK_MSG then
      -- VHDL-2002:
      custom_check_msg(rpt, timestamp, expr, actual, expected, mask, pltbv.test_num,
      custom_check_msg(rpt, expr, actual, expected, mask, v_pltbutils_test_num.value,
        pltbv.test_name(1 to pltbv.test_name_len), pltbv.chk_cnt, pltbv.err_cnt_in_test);
        v_pltbutils_test_name.value(1 to v_test_name_len), v_pltbutils_chk_cnt.value,
 
        v_pltbutils_err_cnt_in_test.value);
 
      -- VHDL-1993:
 
      --custom_check_msg(rpt, actual, expected, mask, v_pltbutils_test_num,
 
      --  v_pltbutils_test_name(1 to v_test_name_len), v_pltbutils_chk_cnt,
 
      --  v_pltbutils_err_cnt_in_test);
 
    end if;
    end if;
    pltbutils_sc_update(pltbutils_sc);
    pltbs_update(pltbv, pltbs);
  end procedure check;
  end procedure check;
 
 
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- to_ascending
  -- to_ascending
  --
  --
Line 1699... Line 1640...
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  -- pltbutils internal procedure(s), called from other pltbutils procedures.
  -- pltbutils internal procedure(s), called from other pltbutils procedures.
  -- Do not to call this/these from user's code.
  -- Do not to call this/these from user's code.
  -- This/these procedures are undocumented in the specification on purpose.
  -- This/these procedures are undocumented in the specification on purpose.
  ----------------------------------------------------------------------------
  ----------------------------------------------------------------------------
  procedure pltbutils_sc_update(
  procedure pltbs_update(
              signal pltbutils_sc : out pltbutils_sc_t
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
 
  ) is
 
  begin
 
    pltbs.test_num  <= pltbv.test_num;
 
    print(pltbs.test_name, pltbv.test_name);
 
    print(pltbs.info, pltbv.info);
 
    pltbs.chk_cnt   <= pltbv.chk_cnt;
 
    pltbs.err_cnt   <= pltbv.err_cnt;
 
    pltbs.stop_sim  <= pltbv.stop_sim;
 
  end procedure pltbs_update;
 
 
 
  procedure pltbutils_error(
 
    constant rpt                : in string;
 
    variable pltbv              : inout pltbv_t;
 
    signal   pltbs              : out   pltbs_t
 
  ) is
 
  begin
 
    pltbv.err_cnt := pltbv.err_cnt + 1;
 
    pltbv.err_cnt_in_test := pltbv.err_cnt_in_test + 1;
 
    pltbs_update(pltbv, pltbs);
 
    if C_PLTBUTILS_USE_STD_ERROR_MSG then
 
      error_msg(rpt, now, pltbv.test_num,
 
        pltbv.test_name(1 to pltbv.test_name_len), pltbv.err_cnt_in_test);
 
    end if;
 
    if C_PLTBUTILS_USE_CUSTOM_ERROR_MSG then
 
      custom_error_msg(rpt, now, pltbv.test_num,
 
        pltbv.test_name(1 to pltbv.test_name_len), pltbv.err_cnt_in_test);
 
    end if;
 
  end procedure pltbutils_error;
 
 
 
  procedure stopsim(
 
    constant timestamp          : in time
            ) is
            ) is
  begin
  begin
    -- VHDL-2002:
    assert false
    pltbutils_sc.test_num   <= v_pltbutils_test_num.value;
    report "--- FORCE END OF SIMULATION ---" &
    print(pltbutils_sc.test_name, v_pltbutils_test_name.value);
           " (ignore this false failure message, it's not a real failure)"
    print(pltbutils_sc.info, v_pltbutils_info.value);
    severity failure;
    pltbutils_sc.chk_cnt    <= v_pltbutils_chk_cnt.value;
  end procedure stopsim;
    pltbutils_sc.err_cnt    <= v_pltbutils_err_cnt.value;
 
    pltbutils_sc.stop_sim   <= v_pltbutils_stop_sim.value;
 
    -- VHDL-1993:
 
    --pltbutils_sc.test_num   <= v_pltbutils_test_num;
 
    --print(pltbutils_sc.test_name, v_pltbutils_test_name);
 
    --print(pltbutils_sc.info, v_pltbutils_info);
 
    --pltbutils_sc.chk_cnt    <= v_pltbutils_chk_cnt;
 
    --pltbutils_sc.err_cnt    <= v_pltbutils_err_cnt;
 
    --pltbutils_sc.stop_sim   <= v_pltbutils_stop_sim;
 
  end procedure pltbutils_sc_update;
 
 
 
  procedure startsim_msg(
  procedure startsim_msg(
    constant testcase_name      : in string;
    constant testcase_name      : in string;
    constant timestamp          : in time
    constant timestamp          : in time
  ) is
  ) is
Line 1786... Line 1749...
    print("Done with test " & str(test_num) & ": " & test_name & " (" & time'image(timestamp) & ")");
    print("Done with test " & str(test_num) & ": " & test_name & " (" & time'image(timestamp) & ")");
  end procedure endtest_msg;
  end procedure endtest_msg;
 
 
  procedure check_msg(
  procedure check_msg(
    constant rpt                : in string;
    constant rpt                : in string;
 
    constant timestamp          : in time;
    constant expr               : in boolean;
    constant expr               : in boolean;
    constant actual             : in string;
    constant actual             : in string;
    constant expected           : in string;
    constant expected           : in string;
    constant mask               : in string;
    constant mask               : in string;
    constant test_num           : in integer;
    constant test_num           : in integer;
Line 1827... Line 1791...
               "  in test " & str(test_num) & " " & test_name
               "  in test " & str(test_num) & " " & test_name
        severity error;
        severity error;
    end if;
    end if;
  end procedure check_msg;
  end procedure check_msg;
 
 
  procedure pltbutils_error(
 
    constant rpt                : in string;
 
    signal   pltbutils_sc       : out   pltbutils_sc_t
 
  ) is
 
  begin
 
    -- VHDL-2002:
 
    v_pltbutils_err_cnt.inc;
 
    if C_PLTBUTILS_USE_STD_ERROR_MSG then
 
      error_msg(rpt, now,
 
        v_pltbutils_test_num.value,
 
        v_pltbutils_test_name.value(1 to v_pltbutils_test_name_len.value),
 
        v_pltbutils_err_cnt_in_test.value);
 
    end if;
 
    if C_PLTBUTILS_USE_CUSTOM_ERROR_MSG then
 
      custom_error_msg(rpt, now,
 
        v_pltbutils_test_num.value,
 
        v_pltbutils_test_name.value(1 to v_pltbutils_test_name_len.value),
 
        v_pltbutils_err_cnt_in_test.value);
 
    end if;
 
    -- VHDL-1993:
 
    --v_pltbutils_err_cnt := v_pltbutils_err_cnt + 1;
 
    --if C_PLTBUTILS_USE_STD_ERROR_MSG then
 
    --  error_msg(rpt, now, 
 
    --    v_pltbutils_test_num, 
 
    --    v_pltbutils_test_name(1 to v_pltbutils_test_name_len),
 
    --    v_pltbutils_err_cnt_in_test);
 
    --end if;
 
    --if C_PLTBUTILS_USE_CUSTOM_ERROR_MSG then
 
    --  custom_error_msg(rpt, now, 
 
    --    v_pltbutils_test_num, 
 
    --    v_pltbutils_test_name(1 to v_pltbutils_test_name_len),
 
    --    v_pltbutils_err_cnt_in_test);
 
    --end if;
 
    pltbutils_sc_update(pltbutils_sc);
 
  end procedure pltbutils_error;
 
 
 
  procedure error_msg(
  procedure error_msg(
    constant rpt                : in string;
    constant rpt                : in string;
    constant timestamp          : in time;
    constant timestamp          : in time;
    constant test_num           : in integer;
    constant test_num           : in integer;
    constant test_name          : in string;
    constant test_name          : in string;
Line 1876... Line 1804...
    assert false
    assert false
    report rpt & " in test " & str(test_num) & ": " & test_name
    report rpt & " in test " & str(test_num) & ": " & test_name
    severity error;
    severity error;
  end procedure error_msg;
  end procedure error_msg;
 
 
  procedure stopsim(
 
    constant timestamp          : in time
 
  ) is
 
  begin
 
    assert false
 
    report "--- FORCE END OF SIMULATION ---" &
 
           " (ignore this false failure message, it's not a real failure)"
 
    severity failure;
 
  end procedure stopsim;
 
 
 
end package body pltbutils_func_pkg;
end package body pltbutils_func_pkg;
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.