sysmgr.v 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * sysmgr.v
  3. *
  4. * vim: ts=4 sw=4
  5. *
  6. * Copyright (C) 2021 Sylvain Munaut <tnt@246tNt.com>
  7. * SPDX-License-Identifier: CERN-OHL-P-2.0
  8. */
  9. `default_nettype none
  10. module sysmgr (
  11. input wire clk_in,
  12. output wire clk_1x,
  13. output wire clk_4x,
  14. output wire sync_4x,
  15. output wire rst
  16. );
  17. wire pll_lock;
  18. SB_PLL40_2F_PAD #(
  19. .FEEDBACK_PATH("SIMPLE"),
  20. .DIVR(4'b0000),
  21. .DIVF(7'b1000010),
  22. .DIVQ(3'b011),
  23. .FILTER_RANGE(3'b001),
  24. .DELAY_ADJUSTMENT_MODE_RELATIVE("DYNAMIC"),
  25. .FDA_RELATIVE(15),
  26. .SHIFTREG_DIV_MODE(0),
  27. .PLLOUT_SELECT_PORTA("GENCLK"),
  28. .PLLOUT_SELECT_PORTB("GENCLK")
  29. ) pll_I (
  30. .PACKAGEPIN (clk_in),
  31. .DYNAMICDELAY (8'h0),
  32. .PLLOUTGLOBALA (),
  33. .PLLOUTGLOBALB (clk_4x),
  34. .RESETB (1'b1),
  35. .LOCK (pll_lock)
  36. );
  37. ice40_serdes_crg #(
  38. .NO_CLOCK_2X(1)
  39. ) crg_I (
  40. .clk_4x (clk_4x),
  41. .pll_lock (pll_lock),
  42. .clk_1x (clk_1x),
  43. .clk_2x (),
  44. .rst (rst)
  45. );
  46. ice40_serdes_sync #(
  47. .PHASE (2),
  48. .NEG_EDGE (0),
  49. .GLOBAL_BUF (0),
  50. .BEL_COL ("X20"),
  51. .BEL_ROW ("Y4")
  52. ) sync_96m_I (
  53. .clk_slow (clk_1x),
  54. .clk_fast (clk_4x),
  55. .rst (rst),
  56. .sync (sync_4x)
  57. );
  58. endmodule