Files
fpga_modem/cores/primitive/clkgen/clkgen.v

38 lines
1.0 KiB
Verilog

`timescale 1ns/1ps
// =============================================================================
// Clock generator
// Stable public wrapper that selects the implementation.
// =============================================================================
module clkgen #(
parameter integer CLK_IN_HZ = 100000000,
parameter integer CLKFX_DIVIDE = 20,
parameter integer CLKFX_MULTIPLY = 3,
parameter real CLKDV_DIVIDE = 2.0
)(
input wire clk_in,
output wire clk_out
);
`ifdef FPGA_SPARTAN6
clkgen_spartan6_impl #(
.CLK_IN_HZ(CLK_IN_HZ),
.CLKFX_DIVIDE(CLKFX_DIVIDE),
.CLKFX_MULTIPLY(CLKFX_MULTIPLY),
.CLKDV_DIVIDE(CLKDV_DIVIDE)
) impl_i (
.clk_in(clk_in),
.clk_out(clk_out)
);
`else
clkgen_generic_impl #(
.CLK_IN_HZ(CLK_IN_HZ),
.CLKFX_DIVIDE(CLKFX_DIVIDE),
.CLKFX_MULTIPLY(CLKFX_MULTIPLY),
.CLKDV_DIVIDE(CLKDV_DIVIDE)
) impl_i (
.clk_in(clk_in),
.clk_out(clk_out)
);
`endif
endmodule