1 |
2 |
MichaelA |
////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
//
|
3 |
|
|
// Copyright 2008-2013 by Michael A. Morris, dba M. A. Morris & Associates
|
4 |
|
|
//
|
5 |
|
|
// All rights reserved. The source code contained herein is publicly released
|
6 |
|
|
// under the terms and conditions of the GNU Lesser Public License. No part of
|
7 |
|
|
// this source code may be reproduced or transmitted in any form or by any
|
8 |
|
|
// means, electronic or mechanical, including photocopying, recording, or any
|
9 |
|
|
// information storage and retrieval system in violation of the license under
|
10 |
|
|
// which the source code is released.
|
11 |
|
|
//
|
12 |
|
|
// The source code contained herein is free; it may be redistributed and/or
|
13 |
|
|
// modified in accordance with the terms of the GNU Lesser General Public
|
14 |
|
|
// License as published by the Free Software Foundation; either version 2.1 of
|
15 |
|
|
// the GNU Lesser General Public License, or any later version.
|
16 |
|
|
//
|
17 |
|
|
// The source code contained herein is freely released WITHOUT ANY WARRANTY;
|
18 |
|
|
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
19 |
|
|
// PARTICULAR PURPOSE. (Refer to the GNU Lesser General Public License for
|
20 |
|
|
// more details.)
|
21 |
|
|
//
|
22 |
|
|
// A copy of the GNU Lesser General Public License should have been received
|
23 |
|
|
// along with the source code contained herein; if not, a copy can be obtained
|
24 |
|
|
// by writing to:
|
25 |
|
|
//
|
26 |
|
|
// Free Software Foundation, Inc.
|
27 |
|
|
// 51 Franklin Street, Fifth Floor
|
28 |
|
|
// Boston, MA 02110-1301 USA
|
29 |
|
|
//
|
30 |
|
|
// Further, no use of this source code is permitted in any form or means
|
31 |
|
|
// without inclusion of this banner prominently in any derived works.
|
32 |
|
|
//
|
33 |
|
|
// Michael A. Morris
|
34 |
|
|
// Huntsville, AL
|
35 |
|
|
//
|
36 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
37 |
|
|
|
38 |
|
|
`timescale 1ns / 1ps
|
39 |
|
|
|
40 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
41 |
|
|
// Company: M. A. Morris & Associates
|
42 |
|
|
// Engineer: Michael A. Morris
|
43 |
|
|
//
|
44 |
|
|
// Create Date: 03/01/2008
|
45 |
|
|
// Design Name: USB MBP HDL
|
46 |
|
|
// Module Name: fedet.v
|
47 |
|
|
// Project Name: 4020 HAWK ZAOM Upgrade
|
48 |
|
|
// Target Devices: XC2S150-5PQ208I
|
49 |
|
|
// Tool versions: ISE 8.2i
|
50 |
|
|
//
|
51 |
|
|
// Description: Multi-stage synchronizer with falling edge detection
|
52 |
|
|
//
|
53 |
|
|
// Dependencies: None
|
54 |
|
|
//
|
55 |
|
|
// Revision History:
|
56 |
|
|
//
|
57 |
|
|
// 0.01 08C01 MAM File Created
|
58 |
|
|
//
|
59 |
|
|
// Additional Comments:
|
60 |
|
|
//
|
61 |
|
|
///////////////////////////////////////////////////////////////////////////////
|
62 |
|
|
|
63 |
|
|
module fedet(rst, clk, din, pls);
|
64 |
|
|
|
65 |
|
|
///////////////////////////////////////////////////////////////////////////////
|
66 |
|
|
//
|
67 |
|
|
// Module Port Declarations
|
68 |
|
|
//
|
69 |
|
|
|
70 |
|
|
input rst;
|
71 |
|
|
input clk;
|
72 |
|
|
input din;
|
73 |
|
|
output pls;
|
74 |
|
|
|
75 |
|
|
///////////////////////////////////////////////////////////////////////////////
|
76 |
|
|
//
|
77 |
|
|
// Module Level Declarations
|
78 |
|
|
//
|
79 |
|
|
|
80 |
|
|
reg [2:0] QSync;
|
81 |
|
|
|
82 |
|
|
///////////////////////////////////////////////////////////////////////////////
|
83 |
|
|
//
|
84 |
|
|
// Implementation
|
85 |
|
|
//
|
86 |
|
|
|
87 |
|
|
always @(posedge clk or posedge rst) begin
|
88 |
|
|
if(rst)
|
89 |
|
|
#1 QSync <= 3'b011;
|
90 |
|
|
else
|
91 |
|
|
#1 QSync <= {~QSync[0] & QSync[1], QSync[0], din};
|
92 |
|
|
end
|
93 |
|
|
|
94 |
|
|
assign pls = QSync[2];
|
95 |
|
|
|
96 |
|
|
endmodule
|