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

Subversion Repositories pltbutils

[/] [pltbutils/] [branches/] [dev0007/] [examples/] [vhdl/] [tb_example2/] [tb_example2.vhd] - Blame information for rev 65

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 pela
----------------------------------------------------------------------
2
----                                                              ----
3 65 pela
---- PlTbUtils Testbench Example 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 an example which demonstrates how PlTbUtils     ----
14
---- can be used.                                                 ----
15
----                                                              ----
16
----                                                              ----
17
---- To Do:                                                       ----
18
---- -                                                            ----
19
----                                                              ----
20
---- Author(s):                                                   ----
21
---- - Per Larsson, pela@opencores.org                            ----
22
----                                                              ----
23
----------------------------------------------------------------------
24
----                                                              ----
25 39 pela
---- Copyright (C) 2013-2014 Authors and OPENCORES.ORG            ----
26 2 pela
----                                                              ----
27
---- This source file may be used and distributed without         ----
28
---- restriction provided that this copyright statement is not    ----
29
---- removed from the file and that any derivative work contains  ----
30
---- the original copyright notice and the associated disclaimer. ----
31
----                                                              ----
32
---- This source file is free software; you can redistribute it   ----
33
---- and/or modify it under the terms of the GNU Lesser General   ----
34
---- Public License as published by the Free Software Foundation; ----
35
---- either version 2.1 of the License, or (at your option) any   ----
36
---- later version.                                               ----
37
----                                                              ----
38
---- This source is distributed in the hope that it will be       ----
39
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
40
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
41
---- PURPOSE. See the GNU Lesser General Public License for more  ----
42
---- details.                                                     ----
43
----                                                              ----
44
---- You should have received a copy of the GNU Lesser General    ----
45
---- Public License along with this source; if not, download it   ----
46
---- from http://www.opencores.org/lgpl.shtml                     ----
47
----                                                              ----
48
----------------------------------------------------------------------
49
library ieee;
50
use ieee.std_logic_1164.all;
51
use work.pltbutils_func_pkg.all;
52
use work.pltbutils_comp_pkg.all;
53
 
54 65 pela
entity tb_example2 is
55 2 pela
  generic (
56
    G_WIDTH             : integer := 8;
57
    G_CLK_PERIOD        : time := 10 ns;
58
    G_DISABLE_BUGS      : integer range 0 to 1 := 0
59
  );
60 65 pela
end entity tb_example2;
61 2 pela
 
62 65 pela
architecture bhv of tb_example2 is
63 2 pela
 
64
  -- Simulation status- and control signals
65 39 pela
  -- for accessing .stop_sim and for viewing in waveform window
66
  signal pltbs          : pltbs_t := C_PLTBS_INIT;
67 2 pela
 
68
  -- DUT stimuli and response signals
69
  signal clk            : std_logic;
70
  signal rst            : std_logic;
71
  signal carry_in       : std_logic;
72
  signal x              : std_logic_vector(G_WIDTH-1 downto 0);
73
  signal y              : std_logic_vector(G_WIDTH-1 downto 0);
74
  signal sum            : std_logic_vector(G_WIDTH-1 downto 0);
75
  signal carry_out      : std_logic;
76
 
77
begin
78
 
79
  dut0 : entity work.dut_example
80
    generic map (
81
      G_WIDTH           => G_WIDTH,
82
      G_DISABLE_BUGS    => G_DISABLE_BUGS
83
    )
84
    port map (
85
      clk_i             => clk,
86
      rst_i             => rst,
87
      carry_i           => carry_in,
88
      x_i               => x,
89
      y_i               => y,
90
      sum_o             => sum,
91
      carry_o           => carry_out
92
    );
93
 
94
  clkgen0 : pltbutils_clkgen
95
    generic map(
96
      G_PERIOD          => G_CLK_PERIOD
97
    )
98
    port map(
99
      clk_o             => clk,
100 39 pela
      stop_sim_i        => pltbs.stop_sim
101 2 pela
    );
102
 
103 65 pela
  tc0 : entity work.tc_example2
104 2 pela
    generic map (
105 15 pela
      G_WIDTH           => G_WIDTH,
106
      G_DISABLE_BUGS    => G_DISABLE_BUGS
107 2 pela
    )
108
    port map(
109 39 pela
      pltbs             => pltbs,
110 2 pela
      clk               => clk,
111
      rst               => rst,
112
      carry_in          => carry_in,
113
      x                 => x,
114
      y                 => y,
115
      sum               => sum,
116
      carry_out         => carry_out
117
    );
118
 
119
end architecture bhv;

powered by: WebSVN 2.1.0

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