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

Subversion Repositories xucpu

[/] [xucpu/] [trunk/] [VHDL/] [queue_2/] [test_queue.vhdl] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 lcdsgmtr
-- Copyright 2015, Jürgen Defurne
2
--
3
-- This file is part of the Experimental Unstable CPU System.
4
--
5
-- The Experimental Unstable CPU System Is free software: you can redistribute
6
-- it and/or modify it under the terms of the GNU Lesser General Public License
7
-- as published by the Free Software Foundation, either version 3 of the
8
-- License, or (at your option) any later version.
9
--
10
-- The Experimental Unstable CPU System is distributed in the hope that it will
11
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
13
-- General Public License for more details.
14
--
15
-- You should have received a copy of the GNU Lesser General Public License
16
-- along with Experimental Unstable CPU System. If not, see
17
-- http://www.gnu.org/licenses/lgpl.txt.
18
 
19
 
20
LIBRARY ieee;
21
USE ieee.std_logic_1164.ALL;
22
 
23
-- Uncomment the following library declaration if using
24
-- arithmetic functions with Signed or Unsigned values
25
--USE ieee.numeric_std.ALL;
26
 
27
ENTITY test_queue IS
28
END test_queue;
29
 
30
ARCHITECTURE behavior OF test_queue IS
31
 
32
  -- Component Declaration for the Unit Under Test (UUT)
33
 
34
  COMPONENT queue
35
    GENERIC (
36
      w_data : NATURAL := 16);
37
    PORT(
38
      d    : IN  STD_LOGIC_VECTOR(7 DOWNTO 0);
39
      q    : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
40
      clk  : IN  STD_LOGIC;
41
      we   : IN  STD_LOGIC;
42
      sh   : IN  STD_LOGIC;
43
      full : OUT STD_LOGIC;
44
      rst  : IN  STD_LOGIC
45
      );
46
  END COMPONENT;
47
 
48
 
49
  --Inputs
50
  SIGNAL data_in : STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
51
  SIGNAL clock   : STD_LOGIC                    := '0';
52
  SIGNAL wr      : STD_LOGIC                    := '0';
53
  SIGNAL sh      : STD_LOGIC                    := '0';
54
  SIGNAL reset   : STD_LOGIC                    := '0';
55
 
56
  --Outputs
57
  SIGNAL data_out : STD_LOGIC_VECTOR(7 DOWNTO 0);
58
  SIGNAL full     : STD_LOGIC;
59
 
60
  -- Clock period definitions
61
  CONSTANT clock_period : TIME := 5.2 ns;
62
 
63
BEGIN
64
 
65
  -- Instantiate the Unit Under Test (UUT)
66
  uut : queue
67
    GENERIC MAP (
68
      w_data => 8)
69
    PORT MAP (
70
      d    => data_in,
71
      q    => data_out,
72
      clk  => clock,
73
      we   => wr,
74
      sh   => sh,
75
      full => full,
76
      rst  => reset
77
      );
78
 
79
  -- Clock process definitions
80
  clock_process : PROCESS
81
  BEGIN
82
    clock <= '0';
83
    WAIT FOR clock_period/2;
84
    clock <= '1';
85
    WAIT FOR clock_period/2;
86
  END PROCESS;
87
 
88
 
89
  -- Stimulus process
90
  stim_proc : PROCESS
91
  BEGIN
92
 
93
    reset <= '1';
94
    WAIT FOR 10 * clock_period;
95
    reset <= '0';
96
 
97
    WAIT FOR clock_period*10;
98
 
99
    wr <= '1';
100
 
101
    data_in <= X"00";
102
    WAIT FOR clock_period;
103
 
104
    data_in <= X"11";
105
    WAIT FOR clock_period;
106
 
107
    data_in <= X"22";
108
    WAIT FOR clock_period;
109
 
110
    data_in <= X"33";
111
    WAIT FOR clock_period;
112
 
113
    data_in <= X"44";
114
    WAIT FOR clock_period;
115
 
116
    data_in <= X"55";
117
    WAIT FOR clock_period;
118
 
119
    data_in <= X"66";
120
    WAIT FOR clock_period;
121
 
122
    data_in <= X"77";
123
    WAIT FOR clock_period;
124
 
125
    wr <= '0';
126
    WAIT FOR clock_period;
127
 
128
    data_in <= X"00";
129
    sh      <= '1';
130
    WAIT FOR clock_period * 8;
131
 
132
    data_in <= X"11";
133
    wr      <= '1';
134
    sh      <= '1';
135
    WAIT FOR clock_period;
136
 
137
    data_in <= X"22";
138
    wr      <= '1';
139
    sh      <= '0';
140
    WAIT FOR clock_period;
141
 
142
    data_in <= X"33";
143
    wr      <= '1';
144
    sh      <= '0';
145
    WAIT FOR clock_period;
146
 
147
    data_in <= X"33";
148
    wr      <= '1';
149
    sh      <= '1';
150
    WAIT FOR clock_period;
151
 
152
    WAIT FOR clock_period * 8;
153
 
154
    WAIT;
155
  END PROCESS;
156
 
157
END;

powered by: WebSVN 2.1.0

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