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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [sparc/] [proc.vhd] - Blame information for rev 6

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

Line No. Rev Author Line
1 2 tarookumic
 
2
 
3
 
4
 
5
----------------------------------------------------------------------------
6
--  This file is a part of the LEON VHDL model
7
--  Copyright (C) 1999  European Space Agency (ESA)
8
--
9
--  This library is free software; you can redistribute it and/or
10
--  modify it under the terms of the GNU Lesser General Public
11
--  License as published by the Free Software Foundation; either
12
--  version 2 of the License, or (at your option) any later version.
13
--
14
--  See the file COPYING.LGPL for the full details of the license.
15
 
16
 
17
-----------------------------------------------------------------------------
18
-- Entity:      proc
19
-- File:        proc.vhd
20
-- Author:      Jiri Gaisler - ESA/ESTEC
21
-- Description: This unit contains the integer unit, cache memory,
22
--              clock/reset generation and (optinally) FPU.
23
------------------------------------------------------------------------------
24
 
25
library IEEE;
26
use IEEE.std_logic_1164.all;
27
use work.leon_target.all;
28
use work.leon_config.all;
29
use work.mmuconfig.all;
30
use work.leon_iface.all;
31
use work.amba.all;
32
use work.fpulib.all;
33
use work.tech_map.all;
34
 
35
entity proc is
36
  port (
37
    rst    : in  std_logic;
38
    clk    : in  clk_type;                      -- main clock
39
    clkn   : in  clk_type;                      -- inverted main clock
40
    apbi   : in  apb_slv_in_type;
41
    apbo   : out apb_slv_out_type;
42
    ahbi   : in  ahb_mst_in_type;
43
    ahbo   : out ahb_mst_out_type;
44
    ahbsi  : in  ahb_slv_in_type;
45
    iui    : in  iu_in_type;
46
    iuo    : out iu_out_type
47
  );
48
end;
49
 
50
architecture rtl of proc is
51
 
52
component iu
53
port (
54
    rst    : in  std_logic;
55
    clk    : in  clk_type;
56
    holdn  : in  std_logic;
57
    ici    : out icache_in_type;                -- icache input
58
    ico    : in  icache_out_type;               -- icache output
59
    dci    : out dcache_in_type;                -- dcache input
60
    dco    : in  dcache_out_type;               -- dcache output
61
    fpui   : out fpu_in_type;                   -- FPU input
62
    fpuo   : in  fpu_out_type;                  -- FPU output
63
    iui    : in  iu_in_type;                    -- system input
64
    iuo    : out iu_out_type;                   -- system output
65
    rfi    : out rf_in_type;                    -- register-file input
66
    rfo    : in rf_out_type;                    -- register-file output
67
    cpi    : out cp_in_type;                    -- CP input
68
    cpo    : in  cp_out_type;                   -- CP output
69
    fpi    : out cp_in_type;                    -- FP input
70
    fpo    : in  cp_out_type                    -- FP output
71
);
72
end component;
73
 
74
component cache
75
  port (
76
    rst   : in  std_logic;
77
    clk   : in  clk_type;
78
    ici   : in  icache_in_type;
79
    ico   : out icache_out_type;
80
    dci   : in  dcache_in_type;
81
    dco   : out dcache_out_type;
82
    iuo   : in  iu_out_type;
83
    apbi  : in  apb_slv_in_type;
84
    apbo  : out apb_slv_out_type;
85
    ahbi  : in  ahb_mst_in_type;
86
    ahbo  : out ahb_mst_out_type;
87
    ahbsi : in  ahb_slv_in_type;
88
    crami : out cram_in_type;
89
    cramo : in  cram_out_type;
90
    fpuholdn : in  std_logic
91
  );
92
end component;
93
 
94
component mmu_cache
95
  port (
96
    rst   : in  std_logic;
97
    clk   : in  clk_type;
98
    ici   : in  icache_in_type;
99
    ico   : out icache_out_type;
100
    dci   : in  dcache_in_type;
101
    dco   : out dcache_out_type;
102
    iuo   : in  iu_out_type;
103
    apbi  : in  apb_slv_in_type;
104
    apbo  : out apb_slv_out_type;
105
    ahbi  : in  ahb_mst_in_type;
106
    ahbo  : out ahb_mst_out_type;
107
    ahbsi : in  ahb_slv_in_type;
108
    crami : out cram_in_type;
109
    cramo : in  cram_out_type;
110
    fpuholdn : in  std_logic
111
  );
112
end component;
113
 
114
component cp
115
port (
116
    rst    : in  std_logic;                     -- Reset
117
    clk    : in  clk_type;                      -- main clock   
118
    iuclk  : in  clk_type;                      -- gated IU clock
119
    holdn  : in  std_logic;                     -- pipeline hold
120
    cpi    : in  cp_in_type;
121
    cpo    : out cp_out_type
122
  );
123
end component;
124
 
125
component cachemem
126
  port (
127
        clk   : in  clk_type;
128
        crami : in  cram_in_type;
129
        cramo : out cram_out_type
130
  );
131
end component;
132
 
133
signal ici : icache_in_type;
134
signal ico : icache_out_type;
135
signal dci : dcache_in_type;
136
signal dco : dcache_out_type;
137
 
138
signal fpui : fpu_in_type;
139
signal fpuo : fpu_out_type;
140
signal cpi, fpi : cp_in_type;
141
signal cpo, fpo : cp_out_type;
142
signal holdn, pholdn, xholdn : std_logic;
143
signal iuol : iu_out_type;
144
signal rfi : rf_in_type;                        -- register-file input
145
signal rfo : rf_out_type;                       -- register-file output
146
signal crami : cram_in_type;
147
signal cramo : cram_out_type;
148
 
149
 
150
 
151
begin
152
 
153
  holdn <= ico.hold and dco.hold and fpui.fpuholdn and cpo.holdn and fpo.holdn;
154
  pholdn <= fpui.fpuholdn and cpo.holdn and fpo.holdn;
155
  xholdn <= cpo.holdn and dco.hold and ico.hold;
156
  iuo <= iuol;
157
 
158
-- integer unit and register file
159
 
160
  iu0 : iu  port map (rst, clk, holdn, ici, ico, dci, dco, fpui, fpuo,
161
        iui, iuol, rfi, rfo, cpi, cpo, fpi, fpo);
162
 
163
  rf0 : regfile_iu generic map (RFIMPTYPE, RABITS, RDBITS, IREGNUM)
164
       port map (rst, clk, clkn, rfi, rfo);
165
 
166
-- cache controller and memories
167
 
168
  cx : if not M_EN generate
169
    c0 : cache port map (rst, clk, ici, ico, dci, dco, iuol,
170
        apbi, apbo, ahbi, ahbo, ahbsi, crami, cramo, pholdn);
171
  end generate;
172
 
173
  m0 : if M_EN generate
174
    c0 : mmu_cache port map (rst, clk, ici, ico, dci, dco, iuol,
175
        apbi, apbo, ahbi, ahbo, ahbsi, crami, cramo, pholdn);
176
  end generate;
177
 
178
  cmem0 : cachemem port map (clk, crami, cramo);
179
 
180
-- serial floating-point co-processor (optional)
181
 
182
  fpsopt : if (FPIFTYPE = serial) generate
183
    fpu0 : fpu_core port map (clk, fpui, fpuo); -- Meiko/LTH serial
184
  end generate;
185
 
186
-- parallel floating-point co-processor (optional)
187
 
188
  fppopt : if (FPIFTYPE = parallel) generate
189
    fpc0 : if (FPCORE = grfpu) generate -- GR FPU/FPC
190
      grfpc0 : grfpc port map (rst, clk, holdn, xholdn, fpi, fpo);
191
    end generate;
192
    fp1eu0 : if (FPCORE /= grfpu) generate      -- Meiko/LTH parallel
193
      fp0 : fp1eu port map (rst, clk, holdn, xholdn, fpi, fpo);
194
    end generate;
195
  end generate;
196
 
197
  nofpc : if (FPIFTYPE /= parallel)  generate
198
    fpo.holdn <= '1';
199
    fpo.ldlock <= '0';
200
    fpo.ccv <= '1';
201
  end generate;
202
 
203
-- co-processor (optional)
204
 
205
  cpopt : if CPEN generate
206
    cp0 : fp1eu port map (rst, clk, holdn, xholdn, cpi, cpo);
207
  end generate;
208
 
209
  nocp : if not CPEN generate
210
    cpo.holdn <= '1';
211
    cpo.ldlock <= '0';
212
  end generate;
213
end ;
214
 

powered by: WebSVN 2.1.0

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