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

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [rtf65002_itagmem.v] - Blame information for rev 30

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_itagmem(wclk, wr, adr, rclk, pc, hit0, hit1);
24
input wclk;
25
input wr;
26
input [33:0] adr;
27
input rclk;
28
input [31:0] pc;
29
output hit0;
30
output hit1;
31
 
32
wire [31:0] pcp8 = pc + 32'd8;
33
wire [31:0] tag0;
34
wire [31:0] tag1;
35
reg [31:0] rpc;
36
reg [31:0] rpcp8;
37
 
38
always @(posedge rclk)
39
        rpc <= pc;
40
always @(posedge rclk)
41
        rpcp8 <= pcp8;
42
 
43
syncRam1kx32_1rw1r ram0 (
44
        .wrst(1'b0),
45
        .wclk(wclk),
46
        .wce(adr[3:2]==2'b11),
47
        .we(wr),
48
        .wsel(4'hF),
49
        .wadr(adr[13:4]),
50
        .i(adr[31:0]),
51
        .wo(),
52
 
53
        .rrst(1'b0),
54
        .rclk(rclk),
55
        .rce(1'b1),
56
        .radr(pc[13:4]),
57
        .o(tag0)
58
);
59
 
60
syncRam1kx32_1rw1r ram1 (
61
        .wrst(1'b0),
62
        .wclk(wclk),
63
        .wce(adr[3:2]==2'b11),
64
        .we(wr),
65
        .wsel(4'hF),
66
        .wadr(adr[13:4]),
67
        .i(adr[31:0]),
68
        .wo(),
69
 
70
        .rrst(1'b0),
71
        .rclk(rclk),
72
        .rce(1'b1),
73
        .radr(pcp8[13:4]),
74
        .o(tag1)
75
);
76
 
77
assign hit0 = tag0[31:14]==rpc[31:14] && tag0[0];
78
assign hit1 = tag1[31:14]==rpcp8[31:14] && tag1[0];
79
 
80
endmodule

powered by: WebSVN 2.1.0

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