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

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [rtl/] [verilog/] [Raptor64_icache_ram_x32.v] - Blame information for rev 3

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 - icache_ram
7
//  - 64 bit CPU instruction 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
module Raptor64_icache_ram_x32(clk, icaccess, ack_i, adr_i, dat_i, pc, insn);
25
input clk;
26
input icaccess;
27
input ack_i;
28
input [12:0] adr_i;
29
input [31:0] dat_i;
30
input [63:0] pc;
31
output [41:0] insn;
32
reg [41:0] insn;
33
 
34
wire [127:0] insnbundle;
35
 
36
syncRam512x32_1rw1r u1
37
(
38
        .wrst(1'b0),
39
        .wclk(clk),
40
        .wce(icaccess && adr_i[3:2]==2'b00),
41
        .we(ack_i),
42
        .wadr(adr_i[12:4]),
43
        .i(dat_i),
44
        .wo(),
45
 
46
        .rrst(1'b0),
47
        .rclk(~clk),
48
        .rce(1'b1),
49
        .radr(pc[12:4]),
50
        .o(insnbundle[31:0])
51
);
52
syncRam512x32_1rw1r u2
53
(
54
        .wrst(1'b0),
55
        .wclk(clk),
56
        .wce(icaccess && adr_i[3:2]==2'b01),
57
        .we(ack_i),
58
        .wadr(adr_i[12:4]),
59
        .i(dat_i),
60
        .wo(),
61
 
62
        .rrst(1'b0),
63
        .rclk(~clk),
64
        .rce(1'b1),
65
        .radr(pc[12:4]),
66
        .o(insnbundle[63:32])
67
);
68
syncRam512x32_1rw1r u3
69
(
70
        .wrst(1'b0),
71
        .wclk(clk),
72
        .wce(icaccess && adr_i[3:2]==2'b10),
73
        .we(ack_i),
74
        .wadr(adr_i[12:4]),
75
        .i(dat_i),
76
        .wo(),
77
 
78
        .rrst(1'b0),
79
        .rclk(~clk),
80
        .rce(1'b1),
81
        .radr(pc[12:4]),
82
        .o(insnbundle[95:64])
83
);
84
syncRam512x32_1rw1r u4
85
(
86
        .wrst(1'b0),
87
        .wclk(clk),
88
        .wce(icaccess && adr_i[3:2]==2'b11),
89
        .we(ack_i),
90
        .wadr(adr_i[12:4]),
91
        .i(dat_i),
92
        .wo(),
93
 
94
        .rrst(1'b0),
95
        .rclk(~clk),
96
        .rce(1'b1),
97
        .radr(pc[12:4]),
98
        .o(insnbundle[127:96])
99
);
100
 
101
always @(pc or insnbundle)
102
        case(pc[3:2])
103
        2'd0:   insn <= insnbundle[ 41: 0];
104
        2'd1:   insn <= insnbundle[ 83:42];
105
        2'd2:   insn <= insnbundle[125:84];
106
        2'd3:   insn <= 42'h3EFFFFFFFFF;        // NOP instruction
107
        endcase
108
 
109
endmodule

powered by: WebSVN 2.1.0

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