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

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [lib/] [gaisler/] [leon3/] [proc3.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
------------------------------------------------------------------------------
2
--  This file is a part of the GRLIB VHDL IP LIBRARY
3
--  Copyright (C) 2003, Gaisler Research
4
--
5
--  This program is free software; you can redistribute it and/or modify
6
--  it under the terms of the GNU General Public License as published by
7
--  the Free Software Foundation; either version 2 of the License, or
8
--  (at your option) any later version.
9
--
10
--  This program is distributed in the hope that it will be useful,
11
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
--  GNU General Public License for more details.
14
--
15
--  You should have received a copy of the GNU General Public License
16
--  along with this program; if not, write to the Free Software
17
--  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
18
-----------------------------------------------------------------------------
19
-- Entity:      proc3
20
-- File:        proc3.vhd
21
-- Author:      Jiri Gaisler Gaisler Research
22
-- Description: LEON3 processor core with pipeline, mul/div & cache control
23
------------------------------------------------------------------------------
24
 
25
library ieee;
26
use ieee.std_logic_1164.all;
27
 
28
library grlib;
29
use grlib.amba.all;
30
use grlib.stdlib.all;
31
library techmap;
32
use techmap.gencomp.all;
33
 
34
library gaisler;
35
use gaisler.leon3.all;
36
use gaisler.libiu.all;
37
use gaisler.libcache.all;
38
use gaisler.arith.all;
39
--library fpu;
40
--use fpu.libfpu.all;
41
 
42
entity proc3 is
43
  generic (
44
    hindex    : integer               := 0;
45
    fabtech   : integer range 0 to NTECH  := 0;
46
    memtech   : integer range 0 to NTECH  := 0;
47
    nwindows  : integer range 2 to 32 := 8;
48
    dsu       : integer range 0 to 1  := 0;
49
    fpu       : integer range 0 to 15 := 0;
50
    v8        : integer range 0 to 63 := 0;
51
    cp        : integer range 0 to 1  := 0;
52
    mac       : integer range 0 to 1  := 0;
53
    pclow     : integer range 0 to 2  := 2;
54
    notag     : integer range 0 to 1  := 0;
55
    nwp       : integer range 0 to 4  := 0;
56
    icen      : integer range 0 to 1  := 0;
57
    irepl     : integer range 0 to 2  := 2;
58
    isets     : integer range 1 to 4  := 1;
59
    ilinesize : integer range 4 to 8  := 4;
60
    isetsize  : integer range 1 to 256 := 1;
61
    isetlock  : integer range 0 to 1  := 0;
62
    dcen      : integer range 0 to 1  := 0;
63
    drepl     : integer range 0 to 2  := 2;
64
    dsets     : integer range 1 to 4  := 1;
65
    dlinesize : integer range 4 to 8  := 4;
66
    dsetsize  : integer range 1 to 256 := 1;
67
    dsetlock  : integer range 0 to 1  := 0;
68
    dsnoop    : integer range 0 to 6  := 0;
69
    ilram      : integer range 0 to 1 := 0;
70
    ilramsize  : integer range 1 to 512 := 1;
71
    ilramstart : integer range 0 to 255 := 16#8e#;
72
    dlram      : integer range 0 to 1 := 0;
73
    dlramsize  : integer range 1 to 512 := 1;
74
    dlramstart : integer range 0 to 255 := 16#8f#;
75
    mmuen     : integer range 0 to 1  := 0;
76
    itlbnum   : integer range 2 to 64 := 8;
77
    dtlbnum   : integer range 2 to 64 := 8;
78
    tlb_type  : integer range 0 to 3 := 1;
79
    tlb_rep   : integer range 0 to 1 := 0;
80
    lddel     : integer range 1 to 2 := 2;
81
    disas     : integer range 0 to 2  := 0;
82
    tbuf      : integer range 0 to 64 := 0;
83
    pwd      : integer range 0 to 2 := 0;
84
    svt      : integer range 0 to 1 := 0;   -- single-vector trapping
85
    rstaddr  : integer              := 0;
86
    smp      : integer range 0 to 15 := 0;  -- support SMP systems
87
    cached   : integer := 0;
88
    clk2x    : integer := 0;
89
    scantest : integer := 0
90
  );
91
  port (
92
    clk    : in  std_ulogic;
93
    rstn   : in  std_ulogic;
94
    holdn  : out std_ulogic;
95
    ahbi   : in  ahb_mst_in_type;
96
    ahbo   : out ahb_mst_out_type;
97
    ahbsi  : in  ahb_slv_in_type;
98
    ahbso  : in  ahb_slv_out_vector;
99
    rfi    : out iregfile_in_type;
100
    rfo    : in  iregfile_out_type;
101
    crami  : out cram_in_type;
102
    cramo  : in  cram_out_type;
103
    tbi    : out tracebuf_in_type;
104
    tbo    : in  tracebuf_out_type;
105
    fpi    : out fpc_in_type;
106
    fpo    : in  fpc_out_type;
107
    cpi    : out fpc_in_type;
108
    cpo    : in  fpc_out_type;
109
    irqi   : in  l3_irq_in_type;
110
    irqo   : out l3_irq_out_type;
111
    dbgi   : in  l3_debug_in_type;
112
    dbgo   : out l3_debug_out_type;
113
         iack_o : out std_logic;
114
    hclk, sclk   : in std_ulogic;
115
    hclken   : in std_ulogic
116
  );
117
end;
118
 
119
architecture rtl of proc3 is
120
 
121
 
122
constant IRFWT    : integer := regfile_3p_write_through(memtech);
123
 
124
signal ici : icache_in_type;
125
signal ico : icache_out_type;
126
signal dci : dcache_in_type;
127
signal dco : dcache_out_type;
128
 
129
signal holdnx, pholdn : std_logic;
130
signal muli  : mul32_in_type;
131
signal mulo  : mul32_out_type;
132
signal divi  : div32_in_type;
133
signal divo  : div32_out_type;
134
 
135
 
136
begin
137
 
138
  holdnx <= ico.hold and dco.hold; holdn <= holdnx;
139
  pholdn <= fpo.holdn;
140
 
141
 
142
-- integer unit 
143
 
144
--     iu0 : iu3  
145
--       generic map (nwindows, isets, dsets, fpu, v8, cp, mac, dsu, nwp, pclow,
146
--       0, hindex, lddel, IRFWT, disas, tbuf, pwd, svt, rstaddr, smp, fabtech, clk2x)
147
--       port map (clk, rstn, holdnx, ici, ico, dci, dco, rfi, rfo, irqi, irqo, 
148
--                 dbgi, dbgo, muli, mulo, divi, divo, fpo, fpi, cpo, cpi, tbo, tbi, sclk);
149
 
150
                mips : top
151
                        port map (clk=>clk ,rst=>rstn, din=>dco.data ,zz_ins_i=>ico.data,qa=>rfo.data1,hold=>holdnx,imds=>ico.mds,dmds=>dco.mds,qb=>rfo.data2,rdaddra_o=>rfi.raddr1,
152
                        rdaddrb_o=>rfi.raddr2,wb_we_o1=>rfi.wren,wb_din_o=>rfi.wdata,wb_addr_o1=> rfi.waddr,pc_next=>ici.rpc,zz_pc_o1=>ici.fpc,
153
                        iack_o=>iack_o,iflush=>ici.flush,iflushl=>ici.flushl,ifline=>ici.fline,dflush=>dci.flush,dflushl=>dci.flushl,read1=>rfi.ren1,
154
                        read2=>rfi.ren2,alu_ur=>dci.maddress,dmem_data_ur=>dci.edata,size=>dci.size,dmem_ctl_ur(0)=>dci.dsuen,
155
                        dmem_ctl_ur(3)=>dci.read,dmem_ctl_ur(2)=>dci.enaddr,dmem_ctl_ur(1)=>dci.write,dmem_ctl_ur(4)=>dci.lock,
156
                        inull=>ici.inull,asi_code=>dci.asi,nullify=>dci.nullify,esu=>dci.esu,msu=>dci.msu,
157
                        intack=>dci.intack,eenaddr=>dci.eenaddr,eaddr=>dci.eaddress,iset=>ico.set,dset=>dco.set,rbranch=>ici.rbranch,
158
                        fbranch=>ici.fbranch);
159
 
160
 
161
-- multiply and divide units 
162
-- Actel FPGAs cannot use inferred mul due to bug in synplify 8.9 and 9.0
163
 
164
  mgen : if v8 /= 0 generate
165
   mgen2 : if (fabtech = axcel) or (fabtech = apa3) generate
166
    mul0 : mul32 generic map (0, v8/16, (v8 mod 4)/2, mac)
167
            port map (rstn, clk, holdnx, muli, mulo);
168
   end generate;
169
   mgen3 : if not ((fabtech = axcel) or (fabtech = apa3)) generate
170
    mul0 : mul32 generic map (is_fpga(fabtech), v8/16, (v8 mod 4)/2, mac)
171
            port map (rstn, clk, holdnx, muli, mulo);
172
   end generate;
173
    div0 : div32 port map (rstn, clk, holdnx, divi, divo);
174
  end generate;
175
  nomgen : if v8 = 0 generate
176
    divo <= ('0', '0', "0000", zero32);
177
    mulo <= ('0', '0', "0000", zero32&zero32);
178
  end generate;
179
 
180
-- cache controller
181
 
182
  m0 : if mmuen = 0 generate
183
    c0 : cache
184
      generic map (hindex, dsu, icen, irepl, isets, ilinesize, isetsize,
185
        isetlock, dcen, drepl, dsets, dlinesize, dsetsize,  dsetlock, dsnoop,
186
        ilram, ilramsize, ilramstart, dlram, dlramsize, dlramstart, cached,
187
        clk2x, memtech, scantest)
188
      port map ( rstn, clk, ici, ico, dci, dco, ahbi, ahbo, ahbsi, ahbso, crami, cramo, pholdn, hclk, sclk, hclken);
189
  end generate;
190
  m1 : if mmuen = 1 generate
191
    c0mmu : mmu_cache
192
       generic map (hindex=>hindex, memtech=>memtech, dsu=>dsu, icen=>icen, irepl=>irepl,
193
          isets=>isets, ilinesize=>ilinesize, isetsize=>isetsize, isetlock=>isetlock,
194
          dcen=>dcen, drepl=>drepl, dsets=>dsets, dlinesize=>dlinesize, dsetsize=>dsetsize,
195
          dsetlock=>dsetlock, dsnoop=>dsnoop, itlbnum=>itlbnum, dtlbnum=>dtlbnum,
196
          tlb_type=>tlb_type, tlb_rep=>tlb_rep, cached => cached, clk2x => clk2x,
197
          scantest => scantest)
198
       port map ( rstn, clk, ici, ico, dci, dco,
199
          ahbi, ahbo, ahbsi, ahbso, crami, cramo, pholdn, hclk, sclk, hclken);
200
  end generate;
201
 
202
end;

powered by: WebSVN 2.1.0

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