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

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64/] [rtl/] [bench/] [soc/] [bootrom.v] - Blame information for rev 46

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 46 robfinch
// ============================================================================
2
//        __
3
//   \\__/ o\    (C) 2012-2018  Robert Finch, Waterloo
4
//    \  __ /    All rights reserved.
5
//     \/_//     robfinch<remove>@opencores.org
6
//       ||
7
//
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 bootrom(rst_i, clk_i, cti_i, cs_i, cyc_i, stb_i, ack_o, adr_i, dat_o);
25
parameter WID=64;
26
//parameter FNAME = "c:\\cores5\\FT64\\trunk\\software\\boot\\boot.ve0";
27
input rst_i;
28
input clk_i;
29
input [2:0] cti_i;
30
input cs_i;
31
input cyc_i;
32
input stb_i;
33
output ack_o;
34
input [17:0] adr_i;
35
output [WID-1:0] dat_o;
36
reg [WID-1:0] dat_o;
37
 
38
integer n;
39
 
40
reg [WID-1:0] rommem [32767:0];
41
reg [14:0] radr;
42
reg [2:0] cnt;
43
 
44
initial begin
45
`include "c:\\cores5\\FT64\\trunk\\software\\boot\\boottc.ve0";
46
end
47
 
48
wire cs = cs_i && cyc_i && stb_i;
49
 
50
reg rdy,rdy1,rdy2;
51
always @(posedge clk_i)
52
begin
53
        rdy1 <= cs;
54
        rdy <= rdy1 & cs & cnt!=3'b100;
55
end
56
assign ack_o = cs ? rdy : 1'b0;
57
 
58
 
59
wire pe_cs;
60
edge_det u1(.rst(rst_i), .clk(clk_i), .ce(1'b1), .i(cs), .pe(pe_cs), .ne(), .ee() );
61
 
62
reg [14:0] ctr;
63
always @(posedge clk_i)
64
        if (pe_cs) begin
65
                if (cti_i==3'b000)
66
                        ctr[1:0] <= adr_i[4:3];
67
                else
68
                ctr[1:0] <= adr_i[4:3] + 2'd1;
69
                ctr[14:2] <= adr_i[17:5];
70
                cnt <= 3'b00;
71
    end
72
        else if (cs && cnt!=3'b11 && cti_i != 3'b000) begin
73
                ctr[1:0] <= ctr[1:0] + 2'd1;
74
                cnt <= cnt + 3'd1;
75
        end
76
 
77
always @(posedge clk_i)
78
        radr <= pe_cs ? adr_i[17:3] : ctr;
79
 
80
//assign dat_o = cs ? {smemH[radr],smemG[radr],smemF[radr],smemE[radr],
81
//                              smemD[radr],smemC[radr],smemB[radr],smemA[radr]} : 64'd0;
82
 
83
always @(posedge clk_i)
84
        dat_o <= rommem[radr];
85
 
86
endmodule

powered by: WebSVN 2.1.0

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