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

Subversion Repositories altor32

[/] [altor32/] [trunk/] [rtl/] [soc/] [dmem_mux3.v] - Blame information for rev 32

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 32 ultra_embe
//-----------------------------------------------------------------
2
//                           AltOR32 
3
//                Alternative Lightweight OpenRisc 
4
//                            V2.0
5
//                     Ultra-Embedded.com
6
//                   Copyright 2011 - 2013
7
//
8
//               Email: admin@ultra-embedded.com
9
//
10
//                       License: LGPL
11
//-----------------------------------------------------------------
12
//
13
// Copyright (C) 2011 - 2013 Ultra-Embedded.com
14
//
15
// This source file may be used and distributed without         
16
// restriction provided that this copyright statement is not    
17
// removed from the file and that any derivative work contains  
18
// the original copyright notice and the associated disclaimer. 
19
//
20
// This source file is free software; you can redistribute it   
21
// and/or modify it under the terms of the GNU Lesser General   
22
// Public License as published by the Free Software Foundation; 
23
// either version 2.1 of the License, or (at your option) any   
24
// later version.
25
//
26
// This source is distributed in the hope that it will be       
27
// useful, but WITHOUT ANY WARRANTY; without even the implied   
28
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      
29
// PURPOSE.  See the GNU Lesser General Public License for more 
30
// details.
31
//
32
// You should have received a copy of the GNU Lesser General    
33
// Public License along with this source; if not, write to the 
34
// Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
35
// Boston, MA  02111-1307  USA
36
//-----------------------------------------------------------------
37 27 ultra_embe
 
38
//-----------------------------------------------------------------
39
// Module:
40
//-----------------------------------------------------------------
41
module dmem_mux3
42
(
43
    // Outputs
44 32 ultra_embe
    output reg [31:0] out0_addr_o,
45
    output reg [31:0] out0_data_o,
46
    input [31:0]      out0_data_i,
47
    output reg [3:0]  out0_sel_o,
48
    output reg        out0_we_o,
49
    output reg        out0_stb_o,
50
    output reg        out0_cyc_o,
51
    output reg [2:0]  out0_cti_o,
52
    input             out0_ack_i,
53
    input             out0_stall_i,
54 27 ultra_embe
 
55 32 ultra_embe
    output reg [31:0] out1_addr_o,
56
    output reg [31:0] out1_data_o,
57
    input [31:0]      out1_data_i,
58
    output reg [3:0]  out1_sel_o,
59
    output reg        out1_we_o,
60
    output reg        out1_stb_o,
61
    output reg        out1_cyc_o,
62
    output reg [2:0]  out1_cti_o,
63
    input             out1_ack_i,
64
    input             out1_stall_i,
65
 
66
    output reg [31:0] out2_addr_o,
67
    output reg [31:0] out2_data_o,
68
    input [31:0]      out2_data_i,
69
    output reg [3:0]  out2_sel_o,
70
    output reg        out2_we_o,
71
    output reg        out2_stb_o,
72
    output reg        out2_cyc_o,
73
    output reg [2:0]  out2_cti_o,
74
    input             out2_ack_i,
75
    input             out2_stall_i,
76
 
77 27 ultra_embe
    // Input
78 32 ultra_embe
    input [31:0]      mem_addr_i,
79
    input [31:0]      mem_data_i,
80
    output reg[31:0]  mem_data_o,
81
    input [3:0]       mem_sel_i,
82
    input             mem_we_i,
83
    input             mem_stb_i,
84
    input             mem_cyc_i,
85
    input [2:0]       mem_cti_i,
86
    output reg        mem_ack_o,
87
    output reg        mem_stall_o
88 27 ultra_embe
);
89
 
90
//-----------------------------------------------------------------
91
// Params
92
//-----------------------------------------------------------------
93
parameter           ADDR_MUX_START      = 28;
94
 
95
//-----------------------------------------------------------------
96 32 ultra_embe
// Request
97 27 ultra_embe
//-----------------------------------------------------------------
98 32 ultra_embe
always @ *
99 27 ultra_embe
begin
100
 
101
   out0_addr_o      = 32'h00000000;
102
   out0_data_o      = 32'h00000000;
103 32 ultra_embe
   out0_sel_o       = 4'b0000;
104
   out0_we_o        = 1'b0;
105
   out0_stb_o       = 1'b0;
106
   out0_cyc_o       = 1'b0;
107
   out0_cti_o       = 3'b0;
108 27 ultra_embe
   out1_addr_o      = 32'h00000000;
109
   out1_data_o      = 32'h00000000;
110 32 ultra_embe
   out1_sel_o       = 4'b0000;
111
   out1_we_o        = 1'b0;
112
   out1_stb_o       = 1'b0;
113
   out1_cyc_o       = 1'b0;
114
   out1_cti_o       = 3'b0;
115 27 ultra_embe
   out2_addr_o      = 32'h00000000;
116
   out2_data_o      = 32'h00000000;
117 32 ultra_embe
   out2_sel_o       = 4'b0000;
118
   out2_we_o        = 1'b0;
119
   out2_stb_o       = 1'b0;
120
   out2_cyc_o       = 1'b0;
121
   out2_cti_o       = 3'b0;
122 27 ultra_embe
 
123
   case (mem_addr_i[ADDR_MUX_START+2-1:ADDR_MUX_START])
124
 
125
   2'd0:
126
   begin
127
       out0_addr_o      = mem_addr_i;
128
       out0_data_o      = mem_data_i;
129 32 ultra_embe
       out0_sel_o       = mem_sel_i;
130
       out0_we_o        = mem_we_i;
131
       out0_stb_o       = mem_stb_i;
132
       out0_cyc_o       = mem_cyc_i;
133
       out0_cti_o       = mem_cti_i;
134 27 ultra_embe
   end
135
   2'd1:
136
   begin
137
       out1_addr_o      = mem_addr_i;
138
       out1_data_o      = mem_data_i;
139 32 ultra_embe
       out1_sel_o       = mem_sel_i;
140
       out1_we_o        = mem_we_i;
141
       out1_stb_o       = mem_stb_i;
142
       out1_cyc_o       = mem_cyc_i;
143
       out1_cti_o       = mem_cti_i;
144 27 ultra_embe
   end
145
   2'd2:
146
   begin
147
       out2_addr_o      = mem_addr_i;
148
       out2_data_o      = mem_data_i;
149 32 ultra_embe
       out2_sel_o       = mem_sel_i;
150
       out2_we_o        = mem_we_i;
151
       out2_stb_o       = mem_stb_i;
152
       out2_cyc_o       = mem_cyc_i;
153
       out2_cti_o       = mem_cti_i;
154 27 ultra_embe
   end
155
 
156
   default :
157
      ;
158
   endcase
159
end
160
 
161
//-----------------------------------------------------------------
162 32 ultra_embe
// Response
163 27 ultra_embe
//-----------------------------------------------------------------
164
always @ *
165
begin
166
   case (mem_addr_i[ADDR_MUX_START+2-1:ADDR_MUX_START])
167
 
168
    2'd0:
169
    begin
170
       mem_data_o   = out0_data_i;
171 32 ultra_embe
       mem_stall_o  = out0_stall_i;
172 27 ultra_embe
       mem_ack_o    = out0_ack_i;
173
    end
174
    2'd1:
175
    begin
176
       mem_data_o   = out1_data_i;
177 32 ultra_embe
       mem_stall_o  = out1_stall_i;
178 27 ultra_embe
       mem_ack_o    = out1_ack_i;
179
    end
180
    2'd2:
181
    begin
182
       mem_data_o   = out2_data_i;
183 32 ultra_embe
       mem_stall_o  = out2_stall_i;
184 27 ultra_embe
       mem_ack_o    = out2_ack_i;
185
    end
186
 
187
   default :
188
   begin
189
       mem_data_o   = 32'h00000000;
190 32 ultra_embe
       mem_stall_o  = 1'b0;
191 27 ultra_embe
       mem_ack_o    = 1'b0;
192
   end
193
   endcase
194
end
195
 
196
endmodule

powered by: WebSVN 2.1.0

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