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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [rtl/] [verilog/] [aeMB2_exec.v] - Blame information for rev 209

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 134 sybreon
/* $Id: aeMB2_exec.v,v 1.4 2008-04-26 17:57:43 sybreon Exp $
2 118 sybreon
**
3
** AEMB2 EDK 6.2 COMPATIBLE CORE
4
** Copyright (C) 2004-2008 Shawn Tan <shawn.tan@aeste.net>
5
**
6
** This file is part of AEMB.
7
**
8
** AEMB is free software: you can redistribute it and/or modify it
9
** under the terms of the GNU Lesser General Public License as
10
** published by the Free Software Foundation, either version 3 of the
11
** License, or (at your option) any later version.
12
**
13
** AEMB is distributed in the hope that it will be useful, but WITHOUT
14
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
16
** Public License for more details.
17
**
18
** You should have received a copy of the GNU Lesser General Public
19
** License along with AEMB. If not, see <http:**www.gnu.org/licenses/>.
20
*/
21
 
22
/**
23
 * Execution Units Wrapper
24
 * @file aeMB2_exec.v
25
 
26
 * Collection of all the execution units.
27
 
28
 */
29
 
30 134 sybreon
// 382@130
31
 
32 118 sybreon
module aeMB2_exec (/*AUTOARG*/
33
   // Outputs
34
   sfr_mx, mul_mx, msr_ex, mem_ex, bsf_mx, bpc_ex, alu_mx, alu_ex,
35 202 sybreon
   exc_ill,
36 118 sybreon
   // Inputs
37 209 sybreon
   rpc_ex, rd_of, ra_of, opd_of, opc_of, opb_of, opa_of, imm_of, grst,
38
   gpha, gclk, exc_dwb, dena
39 118 sybreon
   );
40
   parameter AEMB_IWB = 32;
41
   parameter AEMB_DWB = 32;
42
   parameter AEMB_MUL = 1;
43
   parameter AEMB_BSF = 1;
44 132 sybreon
   parameter AEMB_HTX = 1;
45 202 sybreon
 
46 118 sybreon
   /*AUTOOUTPUT*/
47
   // Beginning of automatic outputs (from unused autoinst outputs)
48
   output [31:0] alu_ex;                 // From intu0 of aeMB2_intu.v
49
   output [31:0] alu_mx;                 // From intu0 of aeMB2_intu.v
50
   output [31:2]        bpc_ex;                 // From intu0 of aeMB2_intu.v
51
   output [31:0] bsf_mx;                 // From bsft0 of aeMB2_bsft.v
52
   output [31:2]        mem_ex;                 // From intu0 of aeMB2_intu.v
53 205 sybreon
   output [9:0]          msr_ex;                 // From intu0 of aeMB2_intu.v
54 118 sybreon
   output [31:0] mul_mx;                 // From mult0 of aeMB2_mult.v
55
   output [31:0] sfr_mx;                 // From intu0 of aeMB2_intu.v
56
   // End of automatics
57
   /*AUTOINPUT*/
58
   // Beginning of automatic inputs (from unused autoinst inputs)
59
   input                dena;                   // To bsft0 of aeMB2_bsft.v, ...
60 209 sybreon
   input [1:0]           exc_dwb;                // To intu0 of aeMB2_intu.v
61 118 sybreon
   input                gclk;                   // To bsft0 of aeMB2_bsft.v, ...
62
   input                gpha;                   // To bsft0 of aeMB2_bsft.v, ...
63
   input                grst;                   // To bsft0 of aeMB2_bsft.v, ...
64
   input [15:0]          imm_of;                 // To bsft0 of aeMB2_bsft.v, ...
65
   input [31:0]          opa_of;                 // To bsft0 of aeMB2_bsft.v, ...
66
   input [31:0]          opb_of;                 // To bsft0 of aeMB2_bsft.v, ...
67
   input [5:0]           opc_of;                 // To bsft0 of aeMB2_bsft.v, ...
68
   input [31:0]          opd_of;                 // To intu0 of aeMB2_intu.v
69
   input [4:0]           ra_of;                  // To intu0 of aeMB2_intu.v
70
   input [4:0]           rd_of;                  // To intu0 of aeMB2_intu.v
71 209 sybreon
   input [31:2]         rpc_ex;                 // To intu0 of aeMB2_intu.v
72 118 sybreon
   // End of automatics
73
   /*AUTOWIRE*/
74
 
75 202 sybreon
 
76
   output               exc_ill;
77
 
78
   reg                  exc_ill; // illegal instruction exception
79
 
80
   //TODO: OPTIMISE!
81
   wire                 wILL =
82 203 sybreon
                        ((opc_of[5:4] == 2'o1) & opc_of[2]) | // illegal extended arithmetic
83 206 sybreon
                        (&opc_of[5:4] & &opc_of[1:0]); // illegal LD/ST
84 202 sybreon
                        //(opc_of == 6'o23) | (opc_of == 6'o24) | (opc_of == 6'o25) | (opc_of == 6'o26) | opc_of == 6'o27) |
85
                        //(opc_of == 6'o32) | (opc_of == 6'o34) | (opc_of == 6'o35) | (opc_of == 6'o36) | opc_of == 6'o37) |
86 203 sybreon
                        //(opc_of == 6'o63) | (opc_of == 6'o67) | (opc_of == 6'o73) | (opc_of == 6'o77); // illegal load/store
87 202 sybreon
 
88
   always @(posedge gclk)
89
     if (grst) begin
90
        /*AUTORESET*/
91
        // Beginning of autoreset for uninitialized flops
92
        exc_ill <= 1'h0;
93
        // End of automatics
94
     end else if (dena) begin
95
        exc_ill <= #1 wILL;
96
     end
97
 
98 118 sybreon
   aeMB2_bsft
99
     #(/*AUTOINSTPARAM*/
100
       // Parameters
101
       .AEMB_BSF                        (AEMB_BSF))
102
   bsft0
103
     (/*AUTOINST*/
104
      // Outputs
105
      .bsf_mx                           (bsf_mx[31:0]),
106
      // Inputs
107
      .opa_of                           (opa_of[31:0]),
108
      .opb_of                           (opb_of[31:0]),
109
      .opc_of                           (opc_of[5:0]),
110
      .imm_of                           (imm_of[10:9]),
111
      .gclk                             (gclk),
112
      .grst                             (grst),
113
      .dena                             (dena),
114 202 sybreon
      .gpha                             (gpha));
115 118 sybreon
 
116
   aeMB2_mult
117
     #(/*AUTOINSTPARAM*/
118
       // Parameters
119
       .AEMB_MUL                        (AEMB_MUL))
120
   mult0
121
     (/*AUTOINST*/
122
      // Outputs
123
      .mul_mx                           (mul_mx[31:0]),
124
      // Inputs
125
      .opa_of                           (opa_of[31:0]),
126
      .opb_of                           (opb_of[31:0]),
127
      .opc_of                           (opc_of[5:0]),
128
      .gclk                             (gclk),
129
      .grst                             (grst),
130
      .dena                             (dena),
131 202 sybreon
      .gpha                             (gpha));
132 118 sybreon
 
133
   aeMB2_intu
134
     #(/*AUTOINSTPARAM*/
135
       // Parameters
136
       .AEMB_DWB                        (AEMB_DWB),
137 131 sybreon
       .AEMB_IWB                        (AEMB_IWB),
138
       .AEMB_HTX                        (AEMB_HTX))
139 118 sybreon
   intu0
140
     (/*AUTOINST*/
141
      // Outputs
142
      .mem_ex                           (mem_ex[31:2]),
143
      .bpc_ex                           (bpc_ex[31:2]),
144
      .alu_ex                           (alu_ex[31:0]),
145
      .alu_mx                           (alu_mx[31:0]),
146 205 sybreon
      .msr_ex                           (msr_ex[9:0]),
147 118 sybreon
      .sfr_mx                           (sfr_mx[31:0]),
148
      // Inputs
149 209 sybreon
      .exc_dwb                          (exc_dwb[1:0]),
150
      .exc_ill                          (exc_ill),
151
      .rpc_ex                           (rpc_ex[31:2]),
152 118 sybreon
      .opc_of                           (opc_of[5:0]),
153
      .opa_of                           (opa_of[31:0]),
154
      .opb_of                           (opb_of[31:0]),
155
      .opd_of                           (opd_of[31:0]),
156
      .imm_of                           (imm_of[15:0]),
157
      .rd_of                            (rd_of[4:0]),
158
      .ra_of                            (ra_of[4:0]),
159
      .gclk                             (gclk),
160
      .grst                             (grst),
161
      .dena                             (dena),
162 202 sybreon
      .gpha                             (gpha));
163 118 sybreon
 
164
endmodule // aeMB2_exec

powered by: WebSVN 2.1.0

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