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

Subversion Repositories lzrw1-compressor-core

[/] [lzrw1-compressor-core/] [trunk/] [hw/] [testbench/] [InputFIFOTb.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/7/22 - LS
29
--*   started file
30
--*
31
--* Version 1.0 - 2013/04/05 - LS
32
--*   released
33
--*
34
--***************************************************************************************************************
35
--*
36
--* Naming convention:  http://dz.ee.ethz.ch/en/information/hdl-help/vhdl-naming-conventions.html
37
--*
38
--***************************************************************************************************************
39
--*
40
--* Simple testbench for manual signal inspection of inputFIFO.vhd
41
--*
42
--***************************************************************************************************************
43
 
44
library ieee;
45
use ieee.std_logic_1164.all;
46
 
47
-------------------------------------------------------------------------------
48
 
49
entity InputFIFO_tb is
50
 
51
end InputFIFO_tb;
52
 
53
-------------------------------------------------------------------------------
54
 
55
architecture tb of InputFIFO_tb is
56
 
57
  component InputFIFO
58
    port (
59
      ClkxCI        : in  std_logic;
60
      RstxRI        : in  std_logic;
61
      DInxDI        : in  std_logic_vector(31 downto 0);
62
      WExSI         : in  std_logic;
63
      StopOutputxSI : in  std_logic;
64
      BusyxSO       : out std_logic;
65
      DOutxDO       : out std_logic_vector(7 downto 0);
66
      OutStrobexSO  : out std_logic;
67
      LengthxDO     : out integer range 0 to 2048);
68
  end component;
69
 
70
  -- component ports
71
  signal ClkxCI        : std_logic;
72
  signal RstxRI        : std_logic                     := '1';
73
  signal DInxDI        : std_logic_vector(31 downto 0) := (others => '0');
74
  signal WExSI         : std_logic                     := '0';
75
  signal StopOutputxSI : std_logic                     := '0';
76
  signal BusyxSO       : std_logic;
77
  signal DOutxDO       : std_logic_vector(7 downto 0);
78
  signal OutStrobexSO  : std_logic;
79
  signal LengthxDO     : integer range 0 to 2048;
80
 
81
  -- clock
82
  signal Clk : std_logic := '1';
83
 
84
begin  -- tb
85
 
86
  -- component instantiation
87
  DUT : InputFIFO
88
    port map (
89
      ClkxCI        => ClkxCI,
90
      RstxRI        => RstxRI,
91
      DInxDI        => DInxDI,
92
      WExSI         => WExSI,
93
      StopOutputxSI => StopOutputxSI,
94
      BusyxSO       => BusyxSO,
95
      DOutxDO       => DOutxDO,
96
      OutStrobexSO  => OutStrobexSO,
97
      LengthxDO     => LengthxDO);
98
 
99
  -- clock generation
100
  Clk    <= not Clk after 10 ns;
101
  ClkxCI <= Clk;
102
 
103
  -- waveform generation
104
  WaveGen_Proc : process
105
  begin
106
    wait for 10 ns;
107
 
108
    RstxRI <= '0';
109
 
110
    wait until ClkxCI'event and ClkxCI = '1';
111
    DInxDI        <= x"03020100";
112
    WExSI         <= '1';
113
    StopOutputxSI <= '1';
114
    wait until ClkxCI'event and ClkxCI = '1';
115
    DInxDI        <= x"07060504";
116
    WExSI         <= '1';
117
    wait until ClkxCI'event and ClkxCI = '1';
118
    DInxDI        <= x"0b0a0908";
119
    WExSI         <= '1';
120
    wait until ClkxCI'event and ClkxCI = '1';
121
    DInxDI        <= x"0f0e0d0c";
122
    WExSI         <= '1';
123
    wait until ClkxCI'event and ClkxCI = '1';
124
    DInxDI        <= x"00000000";
125
    WExSI         <= '0';
126
 
127
    -- tell DUT to send one byte every second cycle
128
    for i in 0 to 15 loop
129
      wait until ClkxCI'event and ClkxCI = '1';
130
      StopOutputxSI <= '0';
131
      wait until ClkxCI'event and ClkxCI = '1';
132
      StopOutputxSI <= '1';
133
    end loop;
134
 
135
    wait;
136
  end process WaveGen_Proc;
137
 
138
 
139
 
140
end tb;
141
 
142
-------------------------------------------------------------------------------
143
 
144
configuration InputFIFO_tb_tb_cfg of InputFIFO_tb is
145
  for tb
146
  end for;
147
end InputFIFO_tb_tb_cfg;
148
 
149
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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