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

Subversion Repositories xucpu

[/] [xucpu/] [trunk/] [VHDL/] [qctrl/] [t_qctrl.vhdl] - Blame information for rev 31

Go to most recent revision | 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 t_qctrl IS
28
END t_qctrl;
29
 
30
ARCHITECTURE behavior OF t_qctrl IS
31
 
32
  -- Component Declaration for the Unit Under Test (UUT)
33
 
34
  COMPONENT qctrl
35
    PORT(
36
      CLK : IN  STD_LOGIC;
37
      RST : IN  STD_LOGIC;
38
      WR  : IN  STD_LOGIC;
39
      SH  : IN  STD_LOGIC;
40
      EN  : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
41
      SEL : OUT STD_LOGIC_VECTOR(2 DOWNTO 0)
42
      );
43
  END COMPONENT;
44
 
45
 
46
  --Inputs
47
  SIGNAL CLK : STD_LOGIC := '0';
48
  SIGNAL RST : STD_LOGIC := '0';
49
  SIGNAL WR  : STD_LOGIC := '0';
50
  SIGNAL SH  : STD_LOGIC := '0';
51
 
52
  --Outputs
53
  SIGNAL EN  : STD_LOGIC_VECTOR(3 DOWNTO 0);
54
  SIGNAL SEL : STD_LOGIC_VECTOR(2 DOWNTO 0);
55
 
56
  -- Clock period definitions
57
  CONSTANT CLK_period : TIME := 5.2 ns;
58
 
59
BEGIN
60
 
61
  -- Instantiate the Unit Under Test (UUT)
62
  uut : qctrl PORT MAP (
63
    CLK => CLK,
64
    RST => RST,
65
    WR  => WR,
66
    SH  => SH,
67
    EN  => EN,
68
    SEL => SEL
69
    );
70
 
71
  -- Clock process definitions
72
  CLK_process : PROCESS
73
  BEGIN
74
    CLK <= '0';
75
    WAIT FOR CLK_period/2;
76
    CLK <= '1';
77
    WAIT FOR CLK_period/2;
78
  END PROCESS;
79
 
80
 
81
  -- Stimulus process
82
  stim_proc : PROCESS
83
  BEGIN
84
 
85
    RST <= '1';
86
 
87
    WAIT FOR CLK_period*8;
88
 
89
    RST <= '0';
90
    WR  <= '1';
91
 
92
    WAIT FOR CLK_period*8;
93
 
94
    WR <= '0';
95
    RST <= '1';
96
 
97
    WAIT FOR CLK_period * 4;
98
 
99
    RST <= '0';
100
 
101
    WAIT FOR CLK_period + 0.1ns;
102
 
103
    WR <= '1';
104
    WAIT FOR CLK_period;
105
 
106
    WR <= '0';
107
    WAIT FOR CLK_period;
108
 
109
    WR <= '1';
110
    WAIT FOR CLK_period;
111
 
112
    WR <= '0';
113
    WAIT FOR CLK_period;
114
    WR <= '1';
115
    WAIT FOR CLK_period;
116
 
117
    WR <= '0';
118
    WAIT FOR CLK_period;
119
 
120
    WR <= '1';
121
    WAIT FOR CLK_period;
122
 
123
    WR <= '0';
124
    WAIT FOR CLK_period;
125
 
126
    WAIT;
127
  END PROCESS;
128
 
129
END;

powered by: WebSVN 2.1.0

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