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

Subversion Repositories dma_axi

[/] [dma_axi/] [trunk/] [src/] [dma_axi32/] [dma_axi32_core0_wdt.v] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 eyalhoc
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  Author: Eyal Hochberg                                      ////
4
////          eyal@provartec.com                                 ////
5
////                                                             ////
6
////  Downloaded from: http://www.opencores.org                  ////
7
/////////////////////////////////////////////////////////////////////
8
////                                                             ////
9
//// Copyright (C) 2010 Provartec LTD                            ////
10
//// www.provartec.com                                           ////
11
//// info@provartec.com                                          ////
12
////                                                             ////
13
//// This source file may be used and distributed without        ////
14
//// restriction provided that this copyright statement is not   ////
15
//// removed from the file and that any derivative work contains ////
16
//// the original copyright notice and the associated disclaimer.////
17
////                                                             ////
18
//// This source file is free software; you can redistribute it  ////
19
//// and/or modify it under the terms of the GNU Lesser General  ////
20
//// Public License as published by the Free Software Foundation.////
21
////                                                             ////
22
//// This source is distributed in the hope that it will be      ////
23
//// useful, but WITHOUT ANY WARRANTY; without even the implied  ////
24
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR     ////
25
//// PURPOSE.  See the GNU Lesser General Public License for more////
26
//// details. http://www.gnu.org/licenses/lgpl.html              ////
27
////                                                             ////
28
/////////////////////////////////////////////////////////////////////
29 2 eyalhoc
//---------------------------------------------------------
30
//-- File generated by RobustVerilog parser
31
//-- Version: 1.0
32
//-- Invoked Fri Mar 25 23:34:50 2011
33
//--
34
//-- Source file: dma_core_wdt.v
35
//---------------------------------------------------------
36
 
37
 
38
 
39
module dma_axi32_core0_wdt(clk,reset,ch_active,rd_burst_start,rd_ch_num,wr_burst_start,wr_ch_num,wdt_timeout,wdt_ch_num);
40
 
41
 
42
   input               clk;
43
   input               reset;
44
 
45
   input [7:0]               ch_active;
46
   input               rd_burst_start;
47
   input [2:0]               rd_ch_num;
48
   input               wr_burst_start;
49
   input [2:0]               wr_ch_num;
50
 
51
   output               wdt_timeout;
52
   output [2:0]           wdt_ch_num;
53
 
54
 
55
 
56
   reg [`WDT_BITS-1:0]           counter;
57
   reg [2:0]               wdt_ch_num;
58
   wire               current_ch_active;
59
   wire               current_burst_start;
60
   wire               advance;
61
   wire               idle;
62
 
63
 
64
 
65
   assign               idle = ch_active == 8'd0;
66
 
67
   assign               current_ch_active = ch_active[wdt_ch_num];
68
 
69
   assign               current_burst_start =
70
                  (rd_burst_start & (rd_ch_num == wdt_ch_num)) |
71
                (wr_burst_start & (wr_ch_num == wdt_ch_num));
72
 
73
   assign               advance = (!current_ch_active) | current_burst_start | wdt_timeout;
74
 
75
 
76
   always @(posedge clk or posedge reset)
77
     if (reset)
78
       wdt_ch_num <= #1 3'd0;
79
     else if (advance)
80
       wdt_ch_num <= #1 wdt_ch_num + 1'b1;
81
 
82
 
83
 
84
 
85
   assign               wdt_timeout = (counter == 'd0);
86
 
87
 
88
   always @(posedge clk or posedge reset)
89
     if (reset)
90
       counter <= #1 {`WDT_BITS{1'b1}};
91
     else if (advance | idle)
92
       counter <= #1 {`WDT_BITS{1'b1}};
93
     else
94
       counter <= #1 counter - 1'b1;
95
 
96
 
97
endmodule
98
 
99
 
100
 
101
 
102
 
103
 

powered by: WebSVN 2.1.0

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