Add synchronizer module
This commit is contained in:
parent
3be5990b17
commit
998dd0f0ba
1 changed files with 19 additions and 0 deletions
19
sync.sv
Normal file
19
sync.sv
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
`ifndef SYNC
|
||||
`define SYNC
|
||||
|
||||
module sync #(
|
||||
parameter BITS = 1
|
||||
) (
|
||||
input clk,
|
||||
input [BITS-1:0] in,
|
||||
output [BITS-1:0] out
|
||||
);
|
||||
logic [BITS-1:0] metastable;
|
||||
|
||||
always_ff @(posedge clk) begin
|
||||
metastable <= in;
|
||||
out <= metastable;
|
||||
end
|
||||
endmodule
|
||||
|
||||
`endif
|
||||
Loading…
Reference in a new issue