MmcmClkMux.v 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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:
  12. //
  13. // Dependencies:
  14. //
  15. // Revision:
  16. // Revision 1.0 - File Created
  17. // Additional Comments:
  18. //
  19. //////////////////////////////////////////////////////////////////////////////////
  20. module MmcmClkMux(
  21. input Rst_i,
  22. input [2:0] clkNum,
  23. input Clk0_i,
  24. input Clk1_i,
  25. input Clk2_i,
  26. input Clk3_i,
  27. input Clk4_i,
  28. input Clk5_i,
  29. input Clk6_i,
  30. output ClkOutMMCM_o
  31. );
  32. //================================================================================
  33. // REG/WIRE
  34. //================================================================================
  35. reg clkOutMMCMReg;
  36. wire clkOutMMCM;
  37. //================================================================================
  38. // ASSIGNMENTS
  39. //===============================================================================
  40. assign clkOutMMCM = clkOutMMCMReg;
  41. //================================================================================
  42. // CODING
  43. //================================================================================
  44. always @(*) begin
  45. if (Rst_i) begin
  46. clkOutMMCMReg = 0;
  47. end
  48. else begin
  49. case (clkNum)
  50. 0: clkOutMMCMReg = Clk0_i;
  51. 1: clkOutMMCMReg = Clk1_i;
  52. 2: clkOutMMCMReg = Clk2_i;
  53. 3: clkOutMMCMReg = Clk3_i;
  54. 4: clkOutMMCMReg = Clk4_i;
  55. 5: clkOutMMCMReg = Clk5_i;
  56. 6: clkOutMMCMReg = Clk6_i;
  57. default: clkOutMMCMReg = 0;
  58. endcase
  59. end
  60. end
  61. BUFG BUFG_inst (
  62. .O(ClkOutMMCM_o), // 1-bit output: Clock output
  63. .I(clkOutMMCM) // 1-bit input: Clock input
  64. );
  65. endmodule