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

Subversion Repositories aemb

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

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
   output [7:0]          msr_ex;                 // From intu0 of aeMB2_intu.v
54
   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
                        //(opc_of == 6'o23) | (opc_of == 6'o24) | (opc_of == 6'o25) | (opc_of == 6'o26) | opc_of == 6'o27) |
81
                        //(opc_of == 6'o32) | (opc_of == 6'o34) | (opc_of == 6'o35) | (opc_of == 6'o36) | opc_of == 6'o37) |
82
                        (opc_of == 6'o63) | (opc_of == 6'o67) | (opc_of == 6'o73) | (opc_of == 6'o77); // illegal load/store
83
 
84
   always @(posedge gclk)
85
     if (grst) begin
86
        /*AUTORESET*/
87
        // Beginning of autoreset for uninitialized flops
88
        exc_ill <= 1'h0;
89
        // End of automatics
90
     end else if (dena) begin
91
        exc_ill <= #1 wILL;
92
     end
93
 
94 118 sybreon
   aeMB2_bsft
95
     #(/*AUTOINSTPARAM*/
96
       // Parameters
97
       .AEMB_BSF                        (AEMB_BSF))
98
   bsft0
99
     (/*AUTOINST*/
100
      // Outputs
101
      .bsf_mx                           (bsf_mx[31:0]),
102
      // Inputs
103
      .opa_of                           (opa_of[31:0]),
104
      .opb_of                           (opb_of[31:0]),
105
      .opc_of                           (opc_of[5:0]),
106
      .imm_of                           (imm_of[10:9]),
107
      .gclk                             (gclk),
108
      .grst                             (grst),
109
      .dena                             (dena),
110 202 sybreon
      .gpha                             (gpha));
111 118 sybreon
 
112
   aeMB2_mult
113
     #(/*AUTOINSTPARAM*/
114
       // Parameters
115
       .AEMB_MUL                        (AEMB_MUL))
116
   mult0
117
     (/*AUTOINST*/
118
      // Outputs
119
      .mul_mx                           (mul_mx[31:0]),
120
      // Inputs
121
      .opa_of                           (opa_of[31:0]),
122
      .opb_of                           (opb_of[31:0]),
123
      .opc_of                           (opc_of[5:0]),
124
      .gclk                             (gclk),
125
      .grst                             (grst),
126
      .dena                             (dena),
127 202 sybreon
      .gpha                             (gpha));
128 118 sybreon
 
129
   aeMB2_intu
130
     #(/*AUTOINSTPARAM*/
131
       // Parameters
132
       .AEMB_DWB                        (AEMB_DWB),
133 131 sybreon
       .AEMB_IWB                        (AEMB_IWB),
134
       .AEMB_HTX                        (AEMB_HTX))
135 118 sybreon
   intu0
136
     (/*AUTOINST*/
137
      // Outputs
138
      .mem_ex                           (mem_ex[31:2]),
139
      .bpc_ex                           (bpc_ex[31:2]),
140
      .alu_ex                           (alu_ex[31:0]),
141
      .alu_mx                           (alu_mx[31:0]),
142
      .msr_ex                           (msr_ex[7:0]),
143
      .sfr_mx                           (sfr_mx[31:0]),
144
      // Inputs
145
      .opc_of                           (opc_of[5:0]),
146
      .opa_of                           (opa_of[31:0]),
147
      .opb_of                           (opb_of[31:0]),
148
      .opd_of                           (opd_of[31:0]),
149
      .imm_of                           (imm_of[15:0]),
150
      .rd_of                            (rd_of[4:0]),
151
      .ra_of                            (ra_of[4:0]),
152
      .gclk                             (gclk),
153
      .grst                             (grst),
154
      .dena                             (dena),
155 202 sybreon
      .gpha                             (gpha));
156 118 sybreon
 
157
endmodule // aeMB2_exec

powered by: WebSVN 2.1.0

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