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

Subversion Repositories aemb

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 140 sybreon
/* $Id: aeMB2_xslif.v,v 1.6 2008-04-27 16:04:12 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 134 sybreon
        xwb_mx <= #1 (xwb_ack_i) ? xwb_dat_i : xwb_lat; // Latch input
101 118 sybreon
 
102
     end // if (dena)
103
 
104 131 sybreon
   assign xwb_sel_o = 4'hF;
105 120 sybreon
 
106
   // Independent on pipeline
107
   reg                  xBLK;
108
 
109 118 sybreon
   always @(posedge gclk)
110
     if (grst) begin
111
        /*AUTORESET*/
112
        // Beginning of autoreset for uninitialized flops
113 131 sybreon
        xwb_lat <= 32'h0;
114 120 sybreon
        // End of automatics
115 131 sybreon
     end else if (xwb_stb_o) begin
116
        xwb_lat <= #1 xwb_dat_i;
117
     end
118 120 sybreon
 
119
   always @(posedge gclk)
120
     if (grst) begin
121
        /*AUTORESET*/
122
        // Beginning of autoreset for uninitialized flops
123
        xBLK <= 1'h0;
124 131 sybreon
        xwb_stb_o <= 1'h0;
125 118 sybreon
        // End of automatics
126 140 sybreon
     end else if (dena) begin
127 131 sybreon
        xBLK <= #1 imm_of[14]; // nGET/nPUT     
128 140 sybreon
        xwb_stb_o <= #1 (dena) ? !opc_of[5] & opc_of[4] & opc_of[3] & opc_of[1] : // GET/PUT
129 120 sybreon
                     (xwb_stb_o & !xwb_ack_i);
130 118 sybreon
     end
131 120 sybreon
 
132
   assign xwb_cyc_o = xwb_stb_o;
133 131 sybreon
   //assign xwb_stb_o = (AEMB_XSL[0]) ? xSTB : 1'bX;   
134 118 sybreon
 
135 131 sybreon
endmodule // aeMB2_xslif
136 118 sybreon
 
137 131 sybreon
/*
138
 $Log: not supported by cvs2svn $
139 140 sybreon
 Revision 1.5  2008/04/26 17:57:43  sybreon
140
 Minor performance improvements.
141
 
142 134 sybreon
 Revision 1.4  2008/04/26 01:09:06  sybreon
143
 Passes basic tests. Minor documentation changes to make it compatible with iverilog pre-processor.
144
 
145 131 sybreon
 Revision 1.3  2008/04/21 12:11:38  sybreon
146
 Passes arithmetic tests with single thread.
147
 
148
 Revision 1.2  2008/04/20 16:34:32  sybreon
149
 Basic version with some features left out.
150
 
151
 Revision 1.1  2008/04/18 00:21:52  sybreon
152
 Initial import.
153
*/

powered by: WebSVN 2.1.0

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