icicle/sync.sv
Graham Edgecombe 22bce1bdeb Fix compatibility with iverilog
This commit:

 * changes the type of all output variables to logic
 * splits variable declaration and assignment
 * declares variables before modules that use the variables
2017-12-09 21:03:45 +00:00

19 lines
292 B
Systemverilog

`ifndef SYNC
`define SYNC
module sync #(
parameter BITS = 1
) (
input clk,
input [BITS-1:0] in,
output logic [BITS-1:0] out
);
logic [BITS-1:0] metastable;
always_ff @(posedge clk) begin
metastable <= in;
out <= metastable;
end
endmodule
`endif