I assume this works as ‘delay’ is an elaboration / compilation time integer constant.
I am not clear on the following ::
(1) Is the clock period for ‘clk_in’ independent of 1ns ? ( i.e it can be less than 1ns or equal to 1ns or even greater than 1ns )
(2) Should ‘clock_gate_en’ be sampled at 1ns after clocking event or at the clocking event after 1ns (where 1ns delay itself is calculated after an initial clocking event) ?