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

Subversion Repositories edge

[/] [edge/] [trunk/] [HW/] [Verilog/] [reset_logic.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 heshamelma
//////////////////////////////////////////////////////////////////
2
//                                                              //
3
//  Reset logic for Edge core                                   //
4
//                                                              //
5
//  This file is part of the Edge project                       //
6
//  http://www.opencores.org/project,edge                       //
7
//                                                              //
8
//  Description                                                 //
9
//  Handling reset logic for Edge core jump to PC = 0           //               
10
//                                                              //
11
//  Author(s):                                                  //
12
//      - Hesham AL-Matary, heshamelmatary@gmail.com            //
13
//                                                              //
14
//////////////////////////////////////////////////////////////////
15
//                                                              //
16
// Copyright (C) 2014 Authors and OPENCORES.ORG                 //
17
//                                                              //
18
// This source file may be used and distributed without         //
19
// restriction provided that this copyright statement is not    //
20
// removed from the file and that any derivative work contains  //
21
// the original copyright notice and the associated disclaimer. //
22
//                                                              //
23
// This source file is free software; you can redistribute it   //
24
// and/or modify it under the terms of the GNU Lesser General   //
25
// Public License as published by the Free Software Foundation; //
26
// either version 2.1 of the License, or (at your option) any   //
27
// later version.                                               //
28
//                                                              //
29
// This source is distributed in the hope that it will be       //
30
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
31
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
32
// PURPOSE.  See the GNU Lesser General Public License for more //
33
// details.                                                     //
34
//                                                              //
35
// You should have received a copy of the GNU Lesser General    //
36
// Public License along with this source; if not, download it   //
37
// from http://www.opencores.org/lgpl.shtml                     //
38
//                                                              //
39
//////////////////////////////////////////////////////////////////
40
 
41
module reset_logic
42
#
43
(
44
  parameter RESET_AFTER = 1 // Produce 0 signal after #RESET_AFTER clock cycles
45
)
46
(
47
  input reset_interrupt,
48
  input clk,
49
  output reset
50
);
51
 
52
reg[1:0] counter = 0;
53
reg res_buffer = 1;
54
 
55
always @(posedge clk)
56
begin
57
  /* Reset after specified clock cycles */
58
  /*counter = counter + 1;
59
  if(counter == RESET_AFTER + 1)
60
    res_buffer = 0;
61
  */
62
    //res_buffer = 0;
63
 
64
  /* Only reset when reset button/signal pushed */
65
  if(reset_interrupt == 0)
66
    res_buffer = 0;
67
  else if(reset_interrupt == 1)
68
    res_buffer = 1;
69
 
70
end
71
 
72
assign reset = res_buffer;
73
 
74
endmodule

powered by: WebSVN 2.1.0

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