OpenCores
URL https://opencores.org/ocsvn/lzrw1-compressor-core/lzrw1-compressor-core/trunk

Subversion Repositories lzrw1-compressor-core

[/] [lzrw1-compressor-core/] [trunk/] [hw/] [testbench/] [HastTb.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 habicht
--/**************************************************************************************************************
2
--*
3
--*    L Z R W 1   E N C O D E R   C O R E
4
--*
5
--*  A high throughput loss less data compression core.
6
--* 
7
--* Copyright 2012-2013   Lukas Schrittwieser (LS)
8
--*
9
--*    This program is free software: you can redistribute it and/or modify
10
--*    it under the terms of the GNU General Public License as published by
11
--*    the Free Software Foundation, either version 2 of the License, or
12
--*    (at your option) any later version.
13
--*
14
--*    This program is distributed in the hope that it will be useful,
15
--*    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
--*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
--*    GNU General Public License for more details.
18
--*
19
--*    You should have received a copy of the GNU General Public License
20
--*    along with this program; if not, write to the Free Software
21
--*    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22
--*    Or see <http://www.gnu.org/licenses/>
23
--*
24
--***************************************************************************************************************
25
--*
26
--* Change Log:
27
--*
28
--* Version 1.0 - 2012/6/17 - LS
29
--*   started file
30
--*
31
--* Version 1.0 - 2013/4/5 - LS
32
--*   release
33
--*
34
--***************************************************************************************************************
35
--*
36
--* Naming convention:  http://dz.ee.ethz.ch/en/information/hdl-help/vhdl-naming-conventions.html
37
--*
38
--***************************************************************************************************************
39
--*
40
--* Test bench for entity hashTable
41
--*
42
--***************************************************************************************************************
43
 
44
library ieee;
45
use ieee.std_logic_1164.all;
46
 
47
-------------------------------------------------------------------------------
48
 
49
entity HashTable_tb is
50
 
51
end HashTable_tb;
52
 
53
-------------------------------------------------------------------------------
54
 
55
architecture tb of HashTable_tb is
56
 
57
  component HashTable
58
    generic (
59
      entryBitWidth : integer);
60
    port (
61
      ClkxCI      : in  std_logic;
62
      RstxRI      : in  std_logic;
63
      NewEntryxDI : in  std_logic_vector(entryBitWidth-1 downto 0);
64
      EnWrxSI     : in  std_logic;
65
      Key0xDI     : in  std_logic_vector(7 downto 0);
66
      Key1xDI     : in  std_logic_vector(7 downto 0);
67
      Key2xDI     : in  std_logic_vector(7 downto 0);
68
      OldEntryxDO : out std_logic_vector(entryBitWidth-1 downto 0));
69
  end component;
70
 
71
  -- component generics
72
  constant entryBitWidth : integer := 12;
73
 
74
  -- component ports
75
  signal ClkxCI      : std_logic;
76
  signal RstxRI      : std_logic                                  := '1';
77
  signal NewEntryxDI : std_logic_vector(entryBitWidth-1 downto 0) := (others => '0');
78
  signal EnWrxSI     : std_logic                                  := '0';
79
  signal Key0xDI     : std_logic_vector(7 downto 0)               := (others => '0');
80
  signal Key1xDI     : std_logic_vector(7 downto 0)               := (others => '0');
81
  signal Key2xDI     : std_logic_vector(7 downto 0)               := (others => '0');
82
  signal OldEntryxDO : std_logic_vector(entryBitWidth-1 downto 0);
83
 
84
  -- clock
85
  signal Clk : std_logic := '1';
86
 
87
begin  -- tb
88
 
89
  -- component instantiation
90
  DUT : HashTable
91
    generic map (
92
      entryBitWidth => entryBitWidth)
93
    port map (
94
      ClkxCI      => ClkxCI,
95
      RstxRI      => RstxRI,
96
      NewEntryxDI => NewEntryxDI,
97
      EnWrxSI     => EnWrxSI,
98
      Key0xDI     => Key0xDI,
99
      Key1xDI     => Key1xDI,
100
      Key2xDI     => Key2xDI,
101
      OldEntryxDO => OldEntryxDO);
102
 
103
  -- clock generation
104
  Clk    <= not Clk after 10 ns;
105
  ClkxCI <= Clk;
106
 
107
 
108
  -- waveform generation
109
  WaveGen_Proc : process
110
  begin
111
    -- insert signal assignments here
112
    wait until Clk = '1';
113
    Key0xDI     <= x"10";
114
    Key1xDI     <= x"32";
115
    Key2xDI     <= x"54";
116
    NewEntryxDI <= x"210";
117
    EnWrxSI     <= '1';
118
    wait until Clk'event and Clk = '1';
119
 
120
    Key0xDI     <= x"00";
121
    Key1xDI     <= x"00";
122
    Key2xDI     <= x"00";
123
    NewEntryxDI <= x"000";
124
    EnWrxSI     <= '1';
125
    wait until Clk'event and Clk = '1';
126
 
127
    Key0xDI     <= x"10";
128
    Key1xDI     <= x"32";
129
    Key2xDI     <= x"54";
130
    NewEntryxDI <= x"fff";
131
    EnWrxSI     <= '0';
132
    wait until Clk'event and Clk = '1';
133
 
134
    Key0xDI     <= x"00";
135
    Key1xDI     <= x"00";
136
    Key2xDI     <= x"00";
137
    NewEntryxDI <= x"111";
138
    EnWrxSI     <= '0';
139
    wait until Clk'event and Clk = '1';
140
 
141
    Key0xDI     <= x"10";
142
    Key1xDI     <= x"32";
143
    Key2xDI     <= x"54";
144
    NewEntryxDI <= x"fff";
145
    EnWrxSI     <= '1';
146
    wait until Clk'event and Clk = '1';
147
 
148
    Key0xDI     <= x"10";
149
    Key1xDI     <= x"32";
150
    Key2xDI     <= x"54";
151
    NewEntryxDI <= x"000";
152
    EnWrxSI     <= '0';
153
    wait until Clk'event and Clk = '1';
154
 
155
    wait;
156
  end process WaveGen_Proc;
157
 
158
 
159
 
160
end tb;
161
 
162
-------------------------------------------------------------------------------
163
 
164
configuration HashTable_tb_tb_cfg of HashTable_tb is
165
  for tb
166
  end for;
167
end HashTable_tb_tb_cfg;
168
 
169
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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