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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [rtl/] [verilog/] [aeMB2_xslif.v] - Blame information for rev 191

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 147 sybreon
/* $Id: aeMB2_xslif.v,v 1.7 2008-04-27 16:41:46 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
 * Accelerator Interface
23
 * @file aeMB2_xslif.v
24
 
25 131 sybreon
 * This sets up the Wishbone control signals for the XSL bus
26
   interface. This is a non optional bus interface. Bus transactions
27
   are independent of the pipeline.
28 118 sybreon
 
29
 */
30
 
31
module aeMB2_xslif (/*AUTOARG*/
32
   // Outputs
33
   xwb_adr_o, xwb_dat_o, xwb_sel_o, xwb_tag_o, xwb_stb_o, xwb_cyc_o,
34
   xwb_wre_o, xwb_fb, xwb_mx,
35
   // Inputs
36
   xwb_dat_i, xwb_ack_i, imm_of, opc_of, opa_of, gclk, grst, dena,
37
   gpha
38
   );
39 131 sybreon
   parameter AEMB_XSL = 1; ///< implement XSEL bus (ignored)
40 118 sybreon
   parameter AEMB_XWB = 3; ///< XSEL bus width
41
 
42
   // XWB control signals   
43 131 sybreon
   output [AEMB_XWB-1:2] xwb_adr_o;
44 118 sybreon
   output [31:0]          xwb_dat_o;
45
   output [3:0]   xwb_sel_o;
46
   output                xwb_tag_o;
47
   output                xwb_stb_o,
48
                         xwb_cyc_o,
49
                         xwb_wre_o;
50
   input [31:0]   xwb_dat_i;
51
   input                 xwb_ack_i;
52
 
53
   // INTERNAL
54
   output                xwb_fb;
55
   output [31:0]          xwb_mx;
56
   input [15:0]   imm_of;
57
   input [5:0]            opc_of;
58
   input [31:0]   opa_of;
59
 
60
   // SYS signals
61
   input                 gclk,
62
                         grst,
63
                         dena,
64
                         gpha;
65
 
66
   /*AUTOREG*/
67
   // Beginning of automatic regs (for this module's undeclared outputs)
68 131 sybreon
   reg [AEMB_XWB-1:2]   xwb_adr_o;
69 118 sybreon
   reg [31:0]            xwb_dat_o;
70
   reg [31:0]            xwb_mx;
71 131 sybreon
   reg                  xwb_stb_o;
72 120 sybreon
   reg                  xwb_tag_o;
73
   reg                  xwb_wre_o;
74 118 sybreon
   // End of automatics
75 120 sybreon
 
76 131 sybreon
   // FIXME: perform NGET/NPUT non-blocking operations
77
   assign               xwb_fb = (xwb_stb_o ~^ xwb_ack_i);
78
 
79 118 sybreon
   // XSEL bus
80 134 sybreon
   reg [31:0]            xwb_lat;
81
 
82 118 sybreon
   always @(posedge gclk)
83
     if (grst) begin
84
        /*AUTORESET*/
85
        // Beginning of autoreset for uninitialized flops
86 131 sybreon
        xwb_adr_o <= {(1+(AEMB_XWB-1)-(2)){1'b0}};
87 118 sybreon
        xwb_dat_o <= 32'h0;
88 131 sybreon
        xwb_mx <= 32'h0;
89 120 sybreon
        xwb_tag_o <= 1'h0;
90
        xwb_wre_o <= 1'h0;
91 118 sybreon
        // End of automatics
92 131 sybreon
     end else if (dena) begin
93 118 sybreon
 
94 131 sybreon
        xwb_adr_o <= #1 imm_of[11:0]; // FSLx    
95
        xwb_wre_o <= #1 imm_of[15]; // PUT
96
        xwb_tag_o <= #1 imm_of[13]; // cGET/cPUT        
97 118 sybreon
 
98 134 sybreon
        xwb_dat_o <= #1 opa_of; // Latch output
99 131 sybreon
 
100 147 sybreon
        xwb_mx <= #1 (xwb_ack_i) ?
101
                  xwb_dat_i : // stalled from XWB
102
                  xwb_lat; // Latch earlier
103 118 sybreon
 
104
     end // if (dena)
105
 
106 131 sybreon
   assign xwb_sel_o = 4'hF;
107 120 sybreon
 
108
   // Independent on pipeline
109
   reg                  xBLK;
110
 
111 118 sybreon
   always @(posedge gclk)
112
     if (grst) begin
113
        /*AUTORESET*/
114
        // Beginning of autoreset for uninitialized flops
115 131 sybreon
        xwb_lat <= 32'h0;
116 120 sybreon
        // End of automatics
117 147 sybreon
     end else if (xwb_ack_i) begin
118 131 sybreon
        xwb_lat <= #1 xwb_dat_i;
119
     end
120 120 sybreon
 
121
   always @(posedge gclk)
122
     if (grst) begin
123
        /*AUTORESET*/
124
        // Beginning of autoreset for uninitialized flops
125
        xBLK <= 1'h0;
126 131 sybreon
        xwb_stb_o <= 1'h0;
127 118 sybreon
        // End of automatics
128 147 sybreon
     end else if (xwb_fb) begin
129 131 sybreon
        xBLK <= #1 imm_of[14]; // nGET/nPUT     
130 140 sybreon
        xwb_stb_o <= #1 (dena) ? !opc_of[5] & opc_of[4] & opc_of[3] & opc_of[1] : // GET/PUT
131 120 sybreon
                     (xwb_stb_o & !xwb_ack_i);
132 118 sybreon
     end
133 120 sybreon
 
134
   assign xwb_cyc_o = xwb_stb_o;
135 131 sybreon
   //assign xwb_stb_o = (AEMB_XSL[0]) ? xSTB : 1'bX;   
136 118 sybreon
 
137 131 sybreon
endmodule // aeMB2_xslif
138 118 sybreon
 
139 131 sybreon
/*
140
 $Log: not supported by cvs2svn $
141 147 sybreon
 Revision 1.6  2008/04/27 16:04:12  sybreon
142
 Fixed minor typos.
143
 
144 140 sybreon
 Revision 1.5  2008/04/26 17:57:43  sybreon
145
 Minor performance improvements.
146
 
147 134 sybreon
 Revision 1.4  2008/04/26 01:09:06  sybreon
148
 Passes basic tests. Minor documentation changes to make it compatible with iverilog pre-processor.
149
 
150 131 sybreon
 Revision 1.3  2008/04/21 12:11:38  sybreon
151
 Passes arithmetic tests with single thread.
152
 
153
 Revision 1.2  2008/04/20 16:34:32  sybreon
154
 Basic version with some features left out.
155
 
156
 Revision 1.1  2008/04/18 00:21:52  sybreon
157
 Initial import.
158
*/

powered by: WebSVN 2.1.0

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