source: XOpenSparcT1/trunk/T1-CPU/ifu/sparc_ifu_swpla.v @ 6

Revision 6, 3.7 KB checked in by pntsvt00, 13 years ago (diff)

versione iniziale opensparc

Line 
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T1 Processor File: sparc_ifu_swpla.v
4// Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
5// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
6//
7// The above named program is free software; you can redistribute it and/or
8// modify it under the terms of the GNU General Public
9// License version 2 as published by the Free Software Foundation.
10//
11// The above named program is distributed in the hope that it will be
12// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14// General Public License for more details.
15//
16// You should have received a copy of the GNU General Public
17// License along with this work; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19//
20// ========== Copyright Header End ============================================
21////////////////////////////////////////////////////////////////////////
22/*
23//  Module Name: sparc_ifu_lfsr5
24//  Description:       
25//  The IFQ is the icache input queue.  This communicates between the
26//  IFU and the outside world.  It handles icache misses and
27//  invalidate requests from the crossbar. 
28*/
29////////////////////////////////////////////////////////////////////////
30
31module sparc_ifu_swpla(/*AUTOARG*/
32   // Outputs
33   out, 
34   // Inputs
35   in
36   );
37
38   input [31:0]  in;
39   output        out;
40
41   wire [31:0]   in;
42   reg           out;
43   
44
45   always @ (in)
46     begin
47              if (in[31:30] == 2'b01)            // call
48                out = 1'b1;
49              else if (in[31:30] == 2'b00)       // branch, sethi, nop
50                begin
51                   if (in[24:22] == 3'b100) // nop/sethi
52                     out = 1'b0;
53                   else // branch
54                     out = 1'b1;
55                end // if (in[31:30] == 2'b00)
56              else if (in[31:30] == 2'b10)        // arith, shift, mem#, mov
57                begin
58                   if (in[24:23] == 2'b11)  // wrpr, vis, save, jmpl
59                     out = 1'b1;
60                   else if (in[24] == 1'b0) // arith
61                     begin
62                              if (in[22] == 1'b0) // alu op
63                                out = 1'b0;
64                              else if ((in[22] == 1'b1) && (in[20:19] == 2'b00))
65                                // subc or addc
66                                out = 1'b0;
67                              else // mul, div
68                                out = 1'b1;
69                     end // if (in[24] == 1'b0)
70                   else // if (in[24:23] == 2'b10)  shft, mov, rdpr, tag
71                     begin
72                              if (in[22:19] == 4'h4) // mulscc
73                                out = 1'b1;
74                              else if (in[22] == 1'b0)  // shft, tag
75                                out = 1'b0;
76                              else if  ((in[22:19] == 4'hc) ||  (in[22:19] == 4'hf)) // mov
77                                out = 1'b0;
78//                            else if (in[22:19] == 4'ha)  // rdpr
79//                              out = 1'b0;
80                              else // rdsr, mem#, popc, flushw, rdpr
81                                out = 1'b1;
82                     end // if ((in[24] == 1'b1) && (in[23] == 1'b0))
83                end // if (in[31:30] == 2'b10)
84              else // ld st
85                begin
86//                 if (in[24] & in[22] & in[21] & ~in[20] & in[19]) // prefetch
87//                   out = 1'b0;
88             if (in[24] | in[23] | ~in[21]) // fp, alt space or ld
89                     out = 1'b1;
90//                 else if (in[24]) // FP and CAS
91//                   out = 1'b1;
92//                 else if (in[23] & in[20] & in[19]) // stda
93//                   out = 1'b1;
94                   else if ((~in[23]) && (in[22:19] == 4'he))  // stx
95                     out = 1'b0;
96                   else if (in[22:21] == 2'b01) // other st
97                     out = 1'b0;
98                   else // other atomic
99                     out = 1'b1;
100                end // else: !if(in[31:30] == 2'b10)
101     end // always @ (in)
102
103   sink #(32) s0(.in (in));
104   
105endmodule // sparc_ifu_swpla
106
107
Note: See TracBrowser for help on using the repository browser.