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

Subversion Repositories pltbutils

[/] [pltbutils/] [trunk/] [templates/] [vhdl/] [template2/] [tb_template2.vhd] - Blame information for rev 101

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 pela
----------------------------------------------------------------------
2
----                                                              ----
3 76 pela
---- PlTbUtils Testbench Template 2                               ----
4 2 pela
----                                                              ----
5
---- This file is part of the PlTbUtils project                   ----
6
---- http://opencores.org/project,pltbutils                       ----
7
----                                                              ----
8
---- Description:                                                 ----
9
---- PlTbUtils is a collection of functions, procedures and       ----
10
---- components for easily creating stimuli and checking response ----
11
---- in automatic self-checking testbenches.                      ----
12
----                                                              ----
13
---- This file is a template, which can be used as a base when    ----
14
---- testbenches which use PlTbUtils.                             ----
15
---- Copy this file to your preferred location and rename the     ----
16
---- copied file and its contents, by replacing the word          ---- 
17
---- "template" with a name for your design.                      ----
18
---- Also remove informative comments enclosed in < ... > .       ----
19
----                                                              ----
20
----                                                              ----
21
---- To Do:                                                       ----
22
---- -                                                            ----
23
----                                                              ----
24
---- Author(s):                                                   ----
25 97 pela
---- - Per Larsson, pela.opencores@gmail.com                      ----
26 2 pela
----                                                              ----
27
----------------------------------------------------------------------
28 101 pela
 
29 2 pela
library ieee;
30
use ieee.std_logic_1164.all;
31
use std.textio.all;
32
use work.txt_util.all;
33
use work.pltbutils_func_pkg.all;
34
use work.pltbutils_comp_pkg.all;
35
-- < Template info: add more libraries here, if needed >
36
 
37 76 pela
entity tb_template2 is
38 2 pela
  generic (
39 101 pela
    G_CLK_PERIOD  : time := 10 ns; -- < Template info: change value if needed >
40
    G_SKIPTESTS   : std_logic_vector := (
41
                      '0', -- Dummy
42
                      '0', -- Test 1
43
                      '0'  -- Test 2
44
                           -- ... etc
45
                    );
46
    -- < Template info: add more generics here if needed >    
47 2 pela
  );
48 76 pela
end entity tb_template2;
49 2 pela
 
50 76 pela
architecture bhv of tb_template2 is
51 2 pela
 
52
  -- Simulation status- and control signals
53 42 pela
  -- for accessing .stop_sim and for viewing in waveform window
54
  signal pltbs          : pltbs_t := C_PLTBS_INIT;
55 2 pela
 
56
  -- DUT stimuli and response signals
57
  signal clk            : std_logic;
58
  signal rst            : std_logic;
59
  -- < Template info: add more DUT stimuli and response signals here. >
60
 
61
begin
62
 
63
  dut0 : entity work.template
64
    generic map (
65
      -- < Template info: add DUT generics here, if any. >      
66
    )
67
    port map (
68
      clk_i             => clk, -- Template example
69
      rst_i             => rst, -- Template example
70
      -- < Template info: add more DUT ports here. >
71
    );
72
 
73
  clkgen0 : pltbutils_clkgen
74
    generic map(
75
      G_PERIOD          => G_CLK_PERIOD
76
    )
77
    port map(
78
      clk_o             => clk,
79 42 pela
      stop_sim_i        => pltbs.stop_sim
80 2 pela
    );
81
 
82 76 pela
  tc0 : entity work.tc_template2
83 2 pela
    generic map (
84 101 pela
      G_SKIPTESTS       => G_SKIPTESTS
85
      -- < Template info: add more generics for testcase component here, if needed. >
86 2 pela
    )
87
    port map(
88
      clk               => clk, -- Template example
89
      rst               => rst, -- Template example
90
      -- < Template info: add more ports for testcase component here. >
91
    );
92
 
93
end architecture bhv;

powered by: WebSVN 2.1.0

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