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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64/] [rtl/] [common/] [FT64_mpu.v] - Blame information for rev 43

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 43 robfinch
`timescale 1ns / 1ps
2
// ============================================================================
3
//        __
4
//   \\__/ o\    (C) 2017-2018  Robert Finch, Waterloo
5
//    \  __ /    All rights reserved.
6
//     \/_//     robfinch<remove>@finitron.ca
7
//       ||
8
//
9
//      FT64_MPU.v
10
//              
11
//
12
// This source file is free software: you can redistribute it and/or modify 
13
// it under the terms of the GNU Lesser General Public License as published 
14
// by the Free Software Foundation, either version 3 of the License, or     
15
// (at your option) any later version.                                      
16
//                                                                          
17
// This source file is distributed in the hope that it will be useful,      
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
20
// GNU General Public License for more details.                             
21
//                                                                          
22
// You should have received a copy of the GNU General Public License        
23
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
24
//                                                                          
25
//
26
// ============================================================================
27
//
28
module FT64_mpu(hartid_i,rst_i, clk4x_i, clk_i,irq_i,vec_i,cti_o,bte_o,cyc_o,stb_o,ack_i,err_i,we_o,sel_o,adr_o,dat_o,dat_i);
29
input [63:0] hartid_i;
30
input rst_i;
31
input clk4x_i;
32
input clk_i;
33
input [2:0] irq_i;
34
input [8:0] vec_i;
35
output [2:0] cti_o;
36
output [1:0] bte_o;
37
output cyc_o;
38
output stb_o;
39
input ack_i;
40
input err_i;
41
output we_o;
42
output [7:0] sel_o;
43
output [31:0] adr_o;
44
output [63:0] dat_o;
45
input [63:0] dat_i;
46
 
47
wire cyc,stb,we;
48
wire [31:0] adr;
49
reg [63:0] dati;
50
wire mmu_ack;
51
wire [31:0] mmu_dato;
52
wire ack;
53
wire [2:0] ol;
54
wire [31:0] pcr;
55
wire [63:0] pcr2;
56
wire icl;           // instruction cache load
57
wire exv,rdv,wrv;
58
 
59
FT64_mmu ummu1
60
(
61
    .rst_i(rst_i),
62
    .clk_i(clk_i),
63
    .ol_i(ol),
64
    .pcr_i(pcr),
65
    .pcr2_i(pcr2),
66
    .mapen_i(pcr[31]),
67
    .s_ex_i(icl),
68
    .s_cyc_i(cyc),
69
    .s_stb_i(stb),
70
    .s_ack_o(mmu_ack),
71
    .s_wr_i(we_o),
72
    .s_adr_i(adr),
73
    .s_dat_i(dat_o[31:0]),
74
    .s_dat_o(mmu_dato),
75
    .cyc_o(cyc_o),
76
    .stb_o(stb_o),
77
    .pea_o(adr_o),
78
    .exv_o(exv),
79
    .rdv_o(rdv),
80
    .wrv_o(wrv)
81
);
82
 
83
always @*
84
case(mmu_ack)
85
1'b1:       dati <= {2{mmu_dato}};
86
default:    dati <= dat_i;
87
endcase
88
 
89
assign ack = ack_i|mmu_ack;
90
 
91
FT64 ucpu1
92
(
93
    .hartid(hartid_i),
94
    .rst(rst_i),
95
    .clk(clk_i),
96
    .clk4x(clk4x_i),
97
    .irq_i(irq_i),
98
    .vec_i(vec_i),
99
    .cti_o(cti_o),
100
    .bte_o(bte_o),
101
    .cyc_o(cyc),
102
    .stb_o(stb),
103
    .ack_i(ack),
104
    .err_i(err_i),
105
    .we_o(we_o),
106
    .sel_o(sel_o),
107
    .adr_o(adr),
108
    .dat_o(dat_o),
109
    .dat_i(dati),
110
    .ol_o(ol),
111
    .pcr_o(pcr),
112
    .pcr2_o(pcr2),
113
    .icl_o(icl),
114
    .exv_i(exv),
115
    .rdv_i(rdv),
116
    .wrv_i(wrv)
117
);
118
 
119
endmodule

powered by: WebSVN 2.1.0

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