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

Subversion Repositories rf6809

[/] [rf6809/] [trunk/] [rtl/] [noc/] [lib/] [BusError.v] - Blame information for rev 19

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 robfinch
`timescale 1ns / 1ps
2
// ============================================================================
3
//        __
4
//   \\__/ o\    (C) 2013-2018  Robert Finch, Waterloo
5
//    \  __ /    All rights reserved.
6
//     \/_//     robfinch<remove>@finitron.ca
7
//       ||
8
//
9
// BusError.v
10
// - generate a bus timeout error if a cycle has been active without an ack
11
//   for too long of a time.
12
//
13
// This source file is free software: you can redistribute it and/or modify 
14
// it under the terms of the GNU Lesser General Public License as published 
15
// by the Free Software Foundation, either version 3 of the License, or     
16
// (at your option) any later version.                                      
17
//                                                                          
18
// This source file is distributed in the hope that it will be useful,      
19
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
20
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
21
// GNU General Public License for more details.                             
22
//                                                                          
23
// You should have received a copy of the GNU General Public License        
24
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
25
//
26
// ============================================================================
27
//
28
module BusError(rst_i, clk_i, cyc_i, ack_i, stb_i, adr_i, err_o);
29
parameter pTO=28'd50000;
30
input rst_i;
31
input clk_i;
32
input cyc_i;
33
input ack_i;
34
input stb_i;
35
input [31:0] adr_i;
36
output err_o;
37
reg err_o;
38
 
39
reg [27:0] tocnt;
40
 
41
always @(posedge clk_i)
42
if (rst_i) begin
43
        err_o <= 1'b0;
44
        tocnt <= 28'd1;
45
end
46
else begin
47
        err_o <= 1'b0;
48
        // If there is no bus cycle active, or if the bus cycle
49
        // has been acknowledged, reset the timeout count.
50
        if (ack_i || !cyc_i) begin
51
                tocnt <= 28'd1;
52
                err_o <= 1'b0;
53
        end
54
        else if (tocnt < pTO)
55
                tocnt <= tocnt + 28'd1;
56
        else if (cyc_i && stb_i && (adr_i[31:4]==28'hFFDCFFE)) begin    // conflist with configrec ?
57
                tocnt <= 28'd1;
58
                err_o <= 1'b0;
59
        end
60
        else
61
                err_o <= 1'b1;
62
end
63
 
64
endmodule

powered by: WebSVN 2.1.0

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