x393
1.0
FPGAcodeforElphelNC393camera
pulse_cross_clock.v
Go to the documentation of this file.
1
41
`timescale 1ns/1ps
42
43
module
pulse_cross_clock
#(
44
parameter
EXTRA_DLY
=
0
// for
45
)(
46
input
rst
,
47
input
src_clk
,
48
input
dst_clk
,
49
input
in_pulse
,
// single-cycle positive pulse
50
output
out_pulse
,
51
output
busy
52
);
53
localparam
EXTRA_DLY_SAFE
=
EXTRA_DLY
?
1
:
0
;
54
`ifndef
IGNORE_ATTR
55
(*
KEEP
=
"TRUE"
*)
56
`endif
57
reg
in_reg
=
0
;
// can not be ASYNC_REG as it can not be put together with out_reg
58
//WARNING: [Constraints 18-1079] Register sensors393_i/sensor_channel_block[0].sensor_channel_i/sens_sync_i/pulse_cross_clock_trig_in_pclk_i/in_reg_reg
59
// and sensors393_i/sensor_channel_block[0].sensor_channel_i/sens_sync_i/pulse_cross_clock_trig_in_pclk_i/out_reg_reg[0] are
60
//from the same synchronizer and have the ASYNC_REG property set, but could not be placed into the same slice due to constraints
61
// or mismatched control signals on the registers.
62
63
`ifndef
IGNORE_ATTR
64
(*
ASYNC_REG
=
"TRUE"
*)
65
`endif
66
reg
[
2
:
0
]
out_reg
=
0
;
67
`ifndef
IGNORE_ATTR
68
(*
ASYNC_REG
=
"TRUE"
*)
69
`endif
70
reg
busy_r
=
0
;
71
assign
out_pulse
=
out_reg
[
2
];
72
assign
busy
=
busy_r
;
// in_reg;
73
always
@(
posedge
src_clk
or
posedge
rst
)
begin
74
if
(
rst
)
in_reg
<=
0
;
75
else
in_reg
<=
in_pulse
|| (
in_reg
&& !
out_reg
[
EXTRA_DLY_SAFE
]);
76
if
(
rst
)
busy_r
<=
0
;
77
else
busy_r
<=
in_pulse
||
in_reg
|| (
busy_r
&& (|
out_reg
[
EXTRA_DLY_SAFE
:
0
]));
78
end
79
// always @(posedge dst_clk or posedge rst) begin
80
always
@(
posedge
dst_clk
)
begin
81
out_reg
<= {
out_reg
[
0
] & ~
out_reg
[
1
],
out_reg
[
0
],
in_reg
};
82
end
83
endmodule
84
85
pulse_cross_clock.10722rst
10722rst
Definition:
pulse_cross_clock.v:46
pulse_cross_clock
Definition:
pulse_cross_clock.v:43
pulse_cross_clock.10724dst_clk
10724dst_clk
Definition:
pulse_cross_clock.v:48
pulse_cross_clock.10729in_reg
10729in_regreg
Definition:
pulse_cross_clock.v:57
pulse_cross_clock.10727busy
10727busy
Definition:
pulse_cross_clock.v:51
pulse_cross_clock.10721EXTRA_DLY
10721EXTRA_DLY0
Definition:
pulse_cross_clock.v:44
pulse_cross_clock.10725in_pulse
10725in_pulse
Definition:
pulse_cross_clock.v:49
pulse_cross_clock.10723src_clk
10723src_clk
Definition:
pulse_cross_clock.v:47
pulse_cross_clock.10731busy_r
10731busy_rreg
Definition:
pulse_cross_clock.v:70
pulse_cross_clock.10726out_pulse
10726out_pulse
Definition:
pulse_cross_clock.v:50
pulse_cross_clock.10730out_reg
10730out_regreg[2:0]
Definition:
pulse_cross_clock.v:66
pulse_cross_clock.10728EXTRA_DLY_SAFE
10728EXTRA_DLY_SAFEEXTRA_DLY ? 1 : 0
Definition:
pulse_cross_clock.v:53
util_modules
pulse_cross_clock.v
Generated by
1.8.12