OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [src_processor/] [aeMB/] [verilog/] [src/] [aeMB2_xslif.v] - Blame information for rev 16

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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