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

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [rtl/] [verilog/] [Raptor64_dcache_ram.v] - Blame information for rev 50

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 robfinch
// ============================================================================
2
// (C) 2012 Robert Finch
3
// All Rights Reserved.
4
// robfinch<remove>@opencores.org
5
//
6
// Raptor64.v - dcache_ram
7
//  - 64 bit CPU data cache ram
8
//
9
// This source file is free software: you can redistribute it and/or modify 
10
// it under the terms of the GNU Lesser General Public License as published 
11
// by the Free Software Foundation, either version 3 of the License, or     
12
// (at your option) any later version.                                      
13
//                                                                          
14
// This source file is distributed in the hope that it will be useful,      
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
17
// GNU General Public License for more details.                             
18
//                                                                          
19
// You should have received a copy of the GNU General Public License        
20
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
21
//                                                                          
22
// ============================================================================
23
//
24 48 robfinch
module Raptor64_dcache_ram(wclk,wr,sel,wadr,i,rclk,radr,o);
25
input wclk;
26 3 robfinch
input wr;
27 48 robfinch
input [7:0] sel;
28
input [14:3] wadr;
29
input [63:0] i;
30
input rclk;
31
input [14:3] radr;
32 3 robfinch
output [63:0] o;
33
 
34 48 robfinch
reg [63:0] mem [0:4095];
35
reg [14:3] rradr;
36 3 robfinch
 
37 48 robfinch
always @(posedge wclk)
38
        if (wr) begin
39
                if (sel[0]) mem[wadr][ 7: 0] <= i[ 7: 0];
40
                if (sel[1]) mem[wadr][15: 8] <= i[15: 8];
41
                if (sel[2]) mem[wadr][23:16] <= i[23:16];
42
                if (sel[3]) mem[wadr][31:24] <= i[31:24];
43
                if (sel[4]) mem[wadr][39:32] <= i[39:32];
44
                if (sel[5]) mem[wadr][47:40] <= i[47:40];
45
                if (sel[6]) mem[wadr][55:48] <= i[55:48];
46
                if (sel[7]) mem[wadr][63:56] <= i[63:56];
47
        end
48
 
49
always @(posedge rclk)
50
        rradr <= radr[14:3];
51
 
52
assign o = mem[rradr];
53
 
54 50 robfinch
endmodule
55 3 robfinch
 

powered by: WebSVN 2.1.0

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