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

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [rtf65002_icachemem.v] - Blame information for rev 32

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

Line No. Rev Author Line
1 30 robfinch
// ============================================================================
2
//        __
3
//   \\__/ o\    (C) 2013  Robert Finch, Stratford
4
//    \  __ /    All rights reserved.
5
//     \/_//     robfinch<remove>@opencores.org
6
//       ||
7
//
8
// This source file is free software: you can redistribute it and/or modify 
9
// it under the terms of the GNU Lesser General Public License as published 
10
// by the Free Software Foundation, either version 3 of the License, or     
11
// (at your option) any later version.                                      
12
//                                                                          
13
// This source file is distributed in the hope that it will be useful,      
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
16
// GNU General Public License for more details.                             
17
//                                                                          
18
// You should have received a copy of the GNU General Public License        
19
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
20
//                                                                          
21
// ============================================================================
22
//
23
module rtf65002_icachemem(wclk, wr, adr, dat, rclk, pc, insn);
24
input wclk;
25
input wr;
26
input [33:0] adr;
27
input [31:0] dat;
28
input rclk;
29
input [31:0] pc;
30
output reg [63:0] insn;
31
 
32
wire [63:0] insn0;
33
wire [63:0] insn1;
34
wire [31:0] pcp8 = pc + 32'd8;
35
reg [31:0] rpc;
36
 
37
always @(posedge rclk)
38
        rpc <= pc;
39
 
40
// memL and memH combined allow a 64 bit read
41
syncRam2kx32_1rw1r ramL0
42
(
43
        .wrst(1'b0),
44
        .wclk(wclk),
45
        .wce(~adr[2]),
46
        .we(wr),
47
        .wsel(4'hF),
48
        .wadr(adr[13:3]),
49
        .i(dat),
50
        .wo(),
51
        .rrst(1'b0),
52
        .rclk(rclk),
53
        .rce(1'b1),
54
        .radr(pc[13:3]),
55
        .o(insn0[31:0])
56
);
57
 
58
syncRam2kx32_1rw1r ramH0
59
(
60
        .wrst(1'b0),
61
        .wclk(wclk),
62
        .wce(adr[2]),
63
        .we(wr),
64
        .wsel(4'hF),
65
        .wadr(adr[13:3]),
66
        .i(dat),
67
        .wo(),
68
        .rrst(1'b0),
69
        .rclk(rclk),
70
        .rce(1'b1),
71
        .radr(pc[13:3]),
72
        .o(insn0[63:32])
73
);
74
 
75
syncRam2kx32_1rw1r ramL1
76
(
77
        .wrst(1'b0),
78
        .wclk(wclk),
79
        .wce(~adr[2]),
80
        .we(wr),
81
        .wsel(4'hF),
82
        .wadr(adr[13:3]),
83
        .i(dat),
84
        .wo(),
85
        .rrst(1'b0),
86
        .rclk(rclk),
87
        .rce(1'b1),
88
        .radr(pcp8[13:3]),
89
        .o(insn1[31:0])
90
);
91
 
92
syncRam2kx32_1rw1r ramH1
93
(
94
        .wrst(1'b0),
95
        .wclk(wclk),
96
        .wce(adr[2]),
97
        .we(wr),
98
        .wsel(4'hF),
99
        .wadr(adr[13:3]),
100
        .i(dat),
101
        .wo(),
102
        .rrst(1'b0),
103
        .rclk(rclk),
104
        .rce(1'b1),
105
        .radr(pcp8[13:3]),
106
        .o(insn1[63:32])
107
);
108
 
109
always @(rpc or insn0 or insn1)
110
case(rpc[2:0])
111
3'd0:   insn <= insn0[63:0];
112
3'd1:   insn <= {insn1[7:0],insn0[63:8]};
113
3'd2:   insn <= {insn1[15:0],insn0[63:16]};
114
3'd3:   insn <= {insn1[23:0],insn0[63:24]};
115
3'd4:   insn <= {insn1[31:0],insn0[63:32]};
116
3'd5:   insn <= {insn1[39:0],insn0[63:40]};
117
3'd6:   insn <= {insn1[47:0],insn0[63:48]};
118
3'd7:   insn <= {insn1[55:0],insn0[63:56]};
119
endcase
120
endmodule

powered by: WebSVN 2.1.0

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