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

Subversion Repositories t400

[/] [t400/] [trunk/] [rtl/] [vhdl/] [t400_skip.vhd] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 arniml
-------------------------------------------------------------------------------
2
--
3
-- The skip unit.
4
-- Skip conditions are checked here and communicated to the decoder unit.
5
--
6 36 arniml
-- $Id: t400_skip.vhd,v 1.2 2006-05-20 02:47:52 arniml Exp $
7 2 arniml
--
8
-- Copyright (c) 2006 Arnim Laeuger (arniml@opencores.org)
9
--
10
-- All rights reserved
11
--
12
-- Redistribution and use in source and synthezised forms, with or without
13
-- modification, are permitted provided that the following conditions are met:
14
--
15
-- Redistributions of source code must retain the above copyright notice,
16
-- this list of conditions and the following disclaimer.
17
--
18
-- Redistributions in synthesized form must reproduce the above copyright
19
-- notice, this list of conditions and the following disclaimer in the
20
-- documentation and/or other materials provided with the distribution.
21
--
22
-- Neither the name of the author nor the names of other contributors may
23
-- be used to endorse or promote products derived from this software without
24
-- specific prior written permission.
25
--
26
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
28
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
30
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
-- POSSIBILITY OF SUCH DAMAGE.
37
--
38
-- Please report bugs to the author, but before you do so, please
39
-- make sure that this is not a derivative work and that
40
-- you have the latest version of this file.
41
--
42
-- The latest version of this file can be found at:
43
--      http://www.opencores.org/cvsweb.shtml/t400/
44
--
45
-------------------------------------------------------------------------------
46
 
47
library ieee;
48
use ieee.std_logic_1164.all;
49
 
50
use work.t400_pack.all;
51
 
52
entity t400_skip is
53
 
54
  port (
55
    ck_i       : in  std_logic;
56
    ck_en_i    : in  boolean;
57
    por_i      : in  boolean;
58
    res_i      : in  boolean;
59
    op_i       : in  skip_op_t;
60
    dec_data_i : in  dec_data_t;
61
    carry_i    : in  std_logic;
62
    c_i        : in  std_logic;
63
    bd_i       : in  dw_t;
64
    is_lbi_i   : in  boolean;
65
    a_i        : in  dw_t;
66
    m_i        : in  dw_t;
67
    g_i        : in  dw_t;
68 36 arniml
    tim_c_i    : in  boolean;
69 2 arniml
    skip_o     : out boolean;
70
    skip_lbi_o : out boolean
71
  );
72
 
73
end t400_skip;
74
 
75
 
76
library ieee;
77
use ieee.numeric_std.all;
78
 
79
architecture rtl of t400_skip is
80
 
81
  signal skip_q,
82
         skip_next_q : boolean;
83
  signal skip_lbi_q  : boolean;
84
 
85
begin
86
 
87
  -----------------------------------------------------------------------------
88
  -- Process skip
89
  --
90
  -- Purpose:
91
  --   Implements the skip logic.
92
  --
93
  skip: process (ck_i, por_i)
94
  begin
95
    if por_i then
96
      skip_next_q <= false;
97
      skip_q      <= false;
98
      skip_lbi_q  <= false;
99
 
100
    elsif ck_i'event and ck_i = '1' then
101
      if    res_i then
102
        -- synchronous reset upon external reset event
103
        skip_next_q    <= false;
104
        skip_q         <= false;
105
        skip_lbi_q     <= false;
106
 
107
      elsif ck_en_i then
108
        if ck_en_i then
109
          case op_i is
110
            -- update skip information ----------------------------------------
111
            when SKIP_UPDATE =>
112
              skip_q       <= skip_next_q;
113
              -- also reset skip_next flag
114
              skip_next_q  <= false;
115
 
116
              -- reset skip-on-lbi flag when this was not an LBI
117
              if not is_lbi_i then
118
                skip_lbi_q <= false;
119
              end if;
120
 
121
            -- skip always ----------------------------------------------------
122
            when SKIP_NOW =>
123
              skip_next_q <= true;
124
 
125
            -- skip on carry --------------------------------------------------
126
            when SKIP_CARRY =>
127
              skip_next_q <= carry_i = '1';
128
 
129
            -- skip on C ------------------------------------------------------
130
            when SKIP_C =>
131
              skip_next_q <= c_i = '1';
132
 
133
            -- skip on BD underflow ------------------------------------------
134
            when SKIP_BD_UFLOW =>
135
              skip_next_q <= unsigned(bd_i) = 15;
136
 
137
            -- skip on BD overflow -------------------------------------------
138
            when SKIP_BD_OFLOW =>
139
              skip_next_q <= unsigned(bd_i) = 0;
140
 
141
            -- skip on LBI instruction ----------------------------------------
142
            when SKIP_LBI =>
143
              skip_lbi_q  <= true;
144
 
145
            -- skip on A and M equal ------------------------------------------
146
            when SKIP_A_M =>
147
              skip_next_q <= unsigned(a_i) = unsigned(m_i);
148
 
149
            -- skip on G zero -------------------------------------------------
150
            when SKIP_G_ZERO =>
151
              skip_next_q <= unsigned(g_i) = 0;
152
 
153
            -- skip on G bit --------------------------------------------------
154
            when SKIP_G_BIT =>
155
              skip_next_q <= unsigned(g_i and dec_data_i(dw_range_t)) = 0;
156
 
157
            -- skip on M bit --------------------------------------------------
158
            when SKIP_M_BIT =>
159
              skip_next_q <= unsigned(m_i and dec_data_i(dw_range_t)) = 0;
160
 
161
            -- skip on timer carry --------------------------------------------
162
            when SKIP_TIMER =>
163 36 arniml
              skip_next_q <= tim_c_i;
164 2 arniml
              null;
165
 
166
            when others =>
167
              null;
168
          end case;
169
        end if;
170
      end if;
171
    end if;
172
  end process skip;
173
  --
174
  -----------------------------------------------------------------------------
175
 
176
 
177
  -----------------------------------------------------------------------------
178
  -- Output mapping
179
  -----------------------------------------------------------------------------
180
  skip_o     <= skip_q;
181
  skip_lbi_o <= skip_lbi_q;
182
 
183
end rtl;
184
 
185
 
186
-------------------------------------------------------------------------------
187
-- File History:
188
--
189
-- $Log: not supported by cvs2svn $
190 36 arniml
-- Revision 1.1.1.1  2006/05/06 01:56:45  arniml
191
-- import from local CVS repository, LOC_CVS_0_1
192
--
193 2 arniml
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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