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

Subversion Repositories aemb

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

Go to most recent revision | 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
   rd_of, ra_of, opd_of, opc_of, opb_of, opa_of, imm_of, grst, gpha,
38
   gclk, dena
39
   );
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
   input                gclk;                   // To bsft0 of aeMB2_bsft.v, ...
61
   input                gpha;                   // To bsft0 of aeMB2_bsft.v, ...
62
   input                grst;                   // To bsft0 of aeMB2_bsft.v, ...
63
   input [15:0]          imm_of;                 // To bsft0 of aeMB2_bsft.v, ...
64
   input [31:0]          opa_of;                 // To bsft0 of aeMB2_bsft.v, ...
65
   input [31:0]          opb_of;                 // To bsft0 of aeMB2_bsft.v, ...
66
   input [5:0]           opc_of;                 // To bsft0 of aeMB2_bsft.v, ...
67
   input [31:0]          opd_of;                 // To intu0 of aeMB2_intu.v
68
   input [4:0]           ra_of;                  // To intu0 of aeMB2_intu.v
69
   input [4:0]           rd_of;                  // To intu0 of aeMB2_intu.v
70
   // End of automatics
71
   /*AUTOWIRE*/
72
 
73 202 sybreon
 
74
   output               exc_ill;
75
 
76
   reg                  exc_ill; // illegal instruction exception
77
 
78
   //TODO: OPTIMISE!
79
   wire                 wILL =
80 203 sybreon
                        ((opc_of[5:4] == 2'o1) & opc_of[2]) | // illegal extended arithmetic
81 206 sybreon
                        (&opc_of[5:4] & &opc_of[1:0]); // illegal LD/ST
82 202 sybreon
                        //(opc_of == 6'o23) | (opc_of == 6'o24) | (opc_of == 6'o25) | (opc_of == 6'o26) | opc_of == 6'o27) |
83
                        //(opc_of == 6'o32) | (opc_of == 6'o34) | (opc_of == 6'o35) | (opc_of == 6'o36) | opc_of == 6'o37) |
84 203 sybreon
                        //(opc_of == 6'o63) | (opc_of == 6'o67) | (opc_of == 6'o73) | (opc_of == 6'o77); // illegal load/store
85 202 sybreon
 
86
   always @(posedge gclk)
87
     if (grst) begin
88
        /*AUTORESET*/
89
        // Beginning of autoreset for uninitialized flops
90
        exc_ill <= 1'h0;
91
        // End of automatics
92
     end else if (dena) begin
93
        exc_ill <= #1 wILL;
94
     end
95
 
96 118 sybreon
   aeMB2_bsft
97
     #(/*AUTOINSTPARAM*/
98
       // Parameters
99
       .AEMB_BSF                        (AEMB_BSF))
100
   bsft0
101
     (/*AUTOINST*/
102
      // Outputs
103
      .bsf_mx                           (bsf_mx[31:0]),
104
      // Inputs
105
      .opa_of                           (opa_of[31:0]),
106
      .opb_of                           (opb_of[31:0]),
107
      .opc_of                           (opc_of[5:0]),
108
      .imm_of                           (imm_of[10:9]),
109
      .gclk                             (gclk),
110
      .grst                             (grst),
111
      .dena                             (dena),
112 202 sybreon
      .gpha                             (gpha));
113 118 sybreon
 
114
   aeMB2_mult
115
     #(/*AUTOINSTPARAM*/
116
       // Parameters
117
       .AEMB_MUL                        (AEMB_MUL))
118
   mult0
119
     (/*AUTOINST*/
120
      // Outputs
121
      .mul_mx                           (mul_mx[31:0]),
122
      // Inputs
123
      .opa_of                           (opa_of[31:0]),
124
      .opb_of                           (opb_of[31:0]),
125
      .opc_of                           (opc_of[5:0]),
126
      .gclk                             (gclk),
127
      .grst                             (grst),
128
      .dena                             (dena),
129 202 sybreon
      .gpha                             (gpha));
130 118 sybreon
 
131
   aeMB2_intu
132
     #(/*AUTOINSTPARAM*/
133
       // Parameters
134
       .AEMB_DWB                        (AEMB_DWB),
135 131 sybreon
       .AEMB_IWB                        (AEMB_IWB),
136
       .AEMB_HTX                        (AEMB_HTX))
137 118 sybreon
   intu0
138
     (/*AUTOINST*/
139
      // Outputs
140
      .mem_ex                           (mem_ex[31:2]),
141
      .bpc_ex                           (bpc_ex[31:2]),
142
      .alu_ex                           (alu_ex[31:0]),
143
      .alu_mx                           (alu_mx[31:0]),
144 205 sybreon
      .msr_ex                           (msr_ex[9:0]),
145 118 sybreon
      .sfr_mx                           (sfr_mx[31:0]),
146
      // Inputs
147
      .opc_of                           (opc_of[5:0]),
148
      .opa_of                           (opa_of[31:0]),
149
      .opb_of                           (opb_of[31:0]),
150
      .opd_of                           (opd_of[31:0]),
151
      .imm_of                           (imm_of[15:0]),
152
      .rd_of                            (rd_of[4:0]),
153
      .ra_of                            (ra_of[4:0]),
154
      .gclk                             (gclk),
155
      .grst                             (grst),
156
      .dena                             (dena),
157 202 sybreon
      .gpha                             (gpha));
158 118 sybreon
 
159
endmodule // aeMB2_exec

powered by: WebSVN 2.1.0

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