x393
1.0
FPGAcodeforElphelNC393camera
clock_inverter.v
Go to the documentation of this file.
1
26
`timescale 1ns/1ps
27
28
module
clock_inverter
(
29
input
rst
,
// just for simulation
30
input
clk_in
,
31
input
invert
,
32
output
clk_out
33
);
34
`ifdef
SUPPORTED_BUFGCTRL_INVERION
35
BUFGCTRL
#(
36
.INIT_OUT
(0),
37
.IS_CE0_INVERTED
(1'b0),
38
.IS_CE1_INVERTED
(1'b0),
39
.IS_I0_INVERTED
(1'b1),
40
.IS_I1_INVERTED
(1'b0),
41
.IS_IGNORE0_INVERTED
(1'b0),
42
.IS_IGNORE1_INVERTED
(1'b0),
43
.IS_S0_INVERTED
(1'b1),
44
.IS_S1_INVERTED
(1'b0),
45
.PRESELECT_I0
("TRUE"),
46
.PRESELECT_I1
("FALSE")
47
)
BUFGCTRL_i
(
48
.O
(clk_out),
// output
49
.CE0
(1'b1),
// input
50
.CE1
(1'b1),
// input
51
.I0
(clk_in),
// input
52
.I1
(clk_in),
// input
53
.IGNORE0
(1'b0),
// input
54
.IGNORE1
(1'b0),
// input
55
.S0
(invert),
// input
56
.S1
(invert)
// input
57
);
58
`else
59
reg
invert_r
;
60
reg
pos_r
;
61
reg
neg_r
;
62
// poor man's ddr
63
always
@ (
posedge
clk_in
)
begin
64
invert_r
<=
invert
;
65
pos_r
<= !
rst
&& !
pos_r
;
66
end
67
68
always
@ (
negedge
clk_in
)
begin
69
neg_r
<=
pos_r
;
70
end
71
BUFGCTRL
#(
72
.
INIT_OUT
(
0
),
73
.
PRESELECT_I0
(
"TRUE"
),
74
.
PRESELECT_I1
(
"FALSE"
)
75
)
BUFGCTRL_i
(
76
.
O
(
clk_out
),
// output
77
.
CE0
(
1'b1
),
// input
78
.
CE1
(
1'b1
),
// input
79
.
I0
(
pos_r
^
neg_r
),
// input
80
.
I1
(
pos_r
==
neg_r
),
// input
81
.
IGNORE0
(
1'b0
),
// input
82
.
IGNORE1
(
1'b0
),
// input
83
.
S0
(!
invert_r
),
// input
84
.
S1
(
invert_r
)
// input
85
);
86
87
`endif
88
endmodule
89
90
clock_inverter.15603pos_r
15603pos_rreg
Definition:
clock_inverter.v:36
clock_inverter.15602invert_r
15602invert_rreg
Definition:
clock_inverter.v:35
clock_inverter.15598rst
15598rst
Definition:
clock_inverter.v:29
clock_inverter.15604neg_r
15604neg_rreg
Definition:
clock_inverter.v:37
clock_inverter.15601clk_out
15601clk_out
Definition:
clock_inverter.v:32
clock_inverter
Definition:
clock_inverter.v:28
clock_inverter.15599clk_in
15599clk_in
Definition:
clock_inverter.v:30
clock_inverter.15600invert
15600invert
Definition:
clock_inverter.v:31
clock_inverter.BUFGCTRL
BUFGCTRL_i BUFGCTRL
Definition:
clock_inverter.v:47
x393_sata
wrapper
clock_inverter.v
Generated by
1.8.12