MmcmClkMux.v 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //////////////////////////////////////////////////////////////////////////////////
  2. // Company: TAIR
  3. // Engineer:
  4. //
  5. // Create Date: 10/30/2023 11:24:31 AM
  6. // Design Name:
  7. // Module Name: MmcmClkMux
  8. // Project Name: S5443_V3_FPGA3
  9. // Target Devices: BOARD: BY5443v3. FPGA: xc7s25csga225-2
  10. // Tool Versions:
  11. // Description: This module determines which of the MMCM should be muxed based
  12. // on a input setting
  13. //
  14. // Dependencies:
  15. //
  16. // Revision:
  17. // Revision 1.0 - File Created
  18. // Additional Comments:
  19. //
  20. //////////////////////////////////////////////////////////////////////////////////
  21. module MmcmClkMux(
  22. input Rst_i,
  23. input [2:0] clkNum,
  24. input Clk0_i,
  25. input Clk1_i,
  26. input Clk2_i,
  27. input Clk3_i,
  28. input Clk4_i,
  29. input Clk5_i,
  30. input Clk6_i,
  31. output ClkOutMMCM_o
  32. );
  33. //================================================================================
  34. // REG/WIRE
  35. //================================================================================
  36. reg clkOutMMCMReg;
  37. wire clkOutMMCM;
  38. //================================================================================
  39. // ASSIGNMENTS
  40. //===============================================================================
  41. assign clkOutMMCM = clkOutMMCMReg;
  42. //================================================================================
  43. // CODING
  44. //================================================================================
  45. always @(*) begin
  46. if (Rst_i) begin
  47. clkOutMMCMReg = 0;
  48. end
  49. else begin
  50. case (clkNum)
  51. 0: clkOutMMCMReg = Clk0_i;
  52. 1: clkOutMMCMReg = Clk1_i;
  53. 2: clkOutMMCMReg = Clk2_i;
  54. 3: clkOutMMCMReg = Clk3_i;
  55. 4: clkOutMMCMReg = Clk4_i;
  56. 5: clkOutMMCMReg = Clk5_i;
  57. 6: clkOutMMCMReg = Clk6_i;
  58. default: clkOutMMCMReg = 0;
  59. endcase
  60. end
  61. end
  62. BUFG BUFG_inst (
  63. .O(ClkOutMMCM_o), // 1-bit output: Clock output
  64. .I(clkOutMMCM) // 1-bit input: Clock input
  65. );
  66. endmodule