1 |
51 |
dgisselq |
////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
//
|
3 |
|
|
// Filename: xoddr.v
|
4 |
|
|
//
|
5 |
|
|
// Project: CMod S6 System on a Chip, ZipCPU demonstration project
|
6 |
|
|
//
|
7 |
|
|
// Purpose: When outputting a clock, Xilinx recommends using the ODDR
|
8 |
|
|
// primitive to insure the clock's stability. This is a simple
|
9 |
|
|
// wrapper around that primitive, although it does cost one delay.
|
10 |
|
|
// For the QSPI, this helps to make certain that as much of the logic
|
11 |
|
|
// delay as possible has been removed from the path--to get the full
|
12 |
|
|
// 80MHz speed of our clock. (The QSPI device on the S6 can run at 108MHz,
|
13 |
|
|
// here, we will run it at 80MHz.)
|
14 |
|
|
//
|
15 |
|
|
// Creator: Dan Gisselquist, Ph.D.
|
16 |
|
|
// Gisselquist Technology, LLC
|
17 |
|
|
//
|
18 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
//
|
20 |
|
|
// Copyright (C) 2015-2017, Gisselquist Technology, LLC
|
21 |
|
|
//
|
22 |
|
|
// This program is free software (firmware): you can redistribute it and/or
|
23 |
|
|
// modify it under the terms of the GNU General Public License as published
|
24 |
|
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
25 |
|
|
// your option) any later version.
|
26 |
|
|
//
|
27 |
|
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
28 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
29 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
30 |
|
|
// for more details.
|
31 |
|
|
//
|
32 |
|
|
// You should have received a copy of the GNU General Public License along
|
33 |
|
|
// with this program. (It's in the $(ROOT)/doc directory. Run make with no
|
34 |
|
|
// target there if the PDF file isn't present.) If not, see
|
35 |
|
|
// <http://www.gnu.org/licenses/> for a copy.
|
36 |
|
|
//
|
37 |
|
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
38 |
|
|
// http://www.gnu.org/licenses/gpl.html
|
39 |
|
|
//
|
40 |
|
|
//
|
41 |
|
|
////////////////////////////////////////////////////////////////////////////////
|
42 |
|
|
//
|
43 |
|
|
//
|
44 |
|
|
module xoddr(i_clk, i_v, o_pin);
|
45 |
|
|
input [1:0] i_clk;
|
46 |
|
|
input [1:0] i_v;
|
47 |
|
|
output o_pin;
|
48 |
|
|
|
49 |
|
|
wire w_internal;
|
50 |
|
|
reg last;
|
51 |
|
|
|
52 |
|
|
ODDR2 #(
|
53 |
|
|
.DDR_ALIGNMENT("C0"),
|
54 |
|
|
.INIT(1'b1),
|
55 |
|
|
.SRTYPE("ASYNC")
|
56 |
|
|
) ODDRi(
|
57 |
|
|
.Q(o_pin),
|
58 |
|
|
.CE(1'b1),
|
59 |
|
|
.C0(i_clk[0]),
|
60 |
|
|
.D0(i_v[0]), // Negative clock edge (goes first)
|
61 |
|
|
.C1(i_clk[1]),
|
62 |
|
|
.D1(i_v[1]), // Positive clock edge
|
63 |
|
|
.R(1'b0),
|
64 |
|
|
.S(1'b0));
|
65 |
|
|
|
66 |
|
|
endmodule
|