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

Subversion Repositories pltbutils

[/] [pltbutils/] [trunk/] [templates/] [vhdl/] [template1/] [tb_template1.vhd] - Diff between revs 97 and 101

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

Rev 97 Rev 101
Line 23... Line 23...
----                                                              ----
----                                                              ----
---- Author(s):                                                   ----
---- Author(s):                                                   ----
---- - Per Larsson, pela.opencores@gmail.com                      ----
---- - Per Larsson, pela.opencores@gmail.com                      ----
----                                                              ----
----                                                              ----
----------------------------------------------------------------------
----------------------------------------------------------------------
----                                                              ----
 
---- Copyright (C) 2013-2014 Authors and OPENCORES.ORG            ----
 
----                                                              ----
 
---- This source file may be used and distributed without         ----
 
---- restriction provided that this copyright statement is not    ----
 
---- removed from the file and that any derivative work contains  ----
 
---- the original copyright notice and the associated disclaimer. ----
 
----                                                              ----
 
---- This source file is free software; you can redistribute it   ----
 
---- and/or modify it under the terms of the GNU Lesser General   ----
 
---- Public License as published by the Free Software Foundation; ----
 
---- either version 2.1 of the License, or (at your option) any   ----
 
---- later version.                                               ----
 
----                                                              ----
 
---- This source is distributed in the hope that it will be       ----
 
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
 
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
 
---- PURPOSE. See the GNU Lesser General Public License for more  ----
 
---- details.                                                     ----
 
----                                                              ----
 
---- You should have received a copy of the GNU Lesser General    ----
 
---- Public License along with this source; if not, download it   ----
 
---- from http://www.opencores.org/lgpl.shtml                     ----
 
----                                                              ----
 
----------------------------------------------------------------------
 
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
use std.textio.all;
use std.textio.all;
use work.txt_util.all;
use work.txt_util.all;
use work.pltbutils_func_pkg.all;
use work.pltbutils_func_pkg.all;
use work.pltbutils_comp_pkg.all;
use work.pltbutils_comp_pkg.all;
-- < Template info: add more libraries here, if needed >
-- < Template info: add more libraries here, if needed >
 
 
entity tb_template1 is
entity tb_template1 is
  generic (
  generic (
    -- < Template info: add generics here if needed, or remove the generic block >    
     G_CLK_PERIOD  : time := 10 ns; -- < Template info: change value if needed >
 
     G_SKIPTESTS   : std_logic_vector := (
 
                       '0', -- Dummy
 
                       '0', -- Test 1
 
                       '0'  -- Test 2
 
                           -- ... etc
 
                     );
 
    -- < Template info: add more generics here if needed >    
  );
  );
end entity tb_template1;
end entity tb_template1;
 
 
architecture bhv of tb_template1 is
architecture bhv of tb_template1 is
 
 
Line 98... Line 81...
 
 
  -- Testcase process 
  -- Testcase process 
  p_tc1 : process
  p_tc1 : process
    variable pltbv  : pltbv_t := C_PLTBV_INIT;
    variable pltbv  : pltbv_t := C_PLTBV_INIT;
  begin
  begin
    startsim("tc1", pltbv, pltbs);
    startsim("tc1", G_SKIPTESTS, pltbv, pltbs);
    rst         <= '1'; -- Template example
    rst         <= '1'; -- Template example
    -- < Template info: initialize other DUT stimuli here. >
    -- < Template info: initialize other DUT stimuli here. >
 
 
    starttest(1, "Reset test", pltbv, pltbs); -- Template example
    starttest(1, "Reset test", pltbv, pltbs); -- Template example
 
    if is_test_active(pltbv) then
    waitclks(2, clk, pltbv, pltbs); -- Template example
    waitclks(2, clk, pltbv, pltbs); -- Template example
    check("template_signal during reset", template_signal, 0, pltbv, pltbs); -- Template example
    check("template_signal during reset", template_signal, 0, pltbv, pltbs); -- Template example
    -- < Template info: check other DUT outputs here. 
    -- < Template info: check other DUT outputs here. 
    rst  <= '0'; -- Template example
    rst  <= '0'; -- Template example
 
    end if; -- is_test_active
    endtest(pltbv, pltbs);
    endtest(pltbv, pltbs);
 
 
    starttest(2, "Template test", pltbv, pltbs);
    starttest(2, "Template test", pltbv, pltbs);
 
    if is_test_active(pltbv) then
    -- < Template info: set all relevant DUT inputs here. >
    -- < Template info: set all relevant DUT inputs here. >
    waitclks(2, clk, pltbv, pltbs); -- Template example
    waitclks(2, clk, pltbv, pltbs); -- Template example
    -- < Template info: check all relevant DUT outputs here. >
    -- < Template info: check all relevant DUT outputs here. >
 
    end if; -- is_test_active
    endtest(pltbv, pltbs);
    endtest(pltbv, pltbs);
 
 
    -- < Template info: add more tests here. >
    -- < Template info: add more tests here. >
 
 
    endsim(pltbv, pltbs, true);
    endsim(pltbv, pltbs, true);
    wait;
    wait;
  end process p_tc1;
  end process p_tc1;

powered by: WebSVN 2.1.0

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