1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-30 02:32:53 +08:00
oh/common/hdl/pulse_stretcher.v
Andreas Olofsson 55ba8ff635 Cleaning up warnings from FGPA tools
- removing unconnected ports
- only one rst input for async_fifo
- synchronizing the reset input toe emaxi fifo
2015-11-09 13:23:40 -05:00

30 lines
486 B
Verilog

/*
* This module stretches a pulse by DW+1 clock cycles
* Can be useful for synchronous clock transfers from fast to slow.
*
*/
module pulse_stretcher (/*AUTOARG*/
// Outputs
out,
// Inputs
clk, in
);
parameter DW = 1;
input clk;
input in;
output out;
reg [DW-1:0] wide_pulse;
always @ (posedge clk)
wide_pulse[DW-1:0] <= {wide_pulse[DW-2:0],in};
assign out = (|{wide_pulse[DW-1:0],in});
endmodule // pulse_stretcher