You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.8 KiB

  1. library ieee ;
  2. use ieee.std_logic_1164.all;
  3. use ieee.math_real.all;
  4. entity CC_PLL is
  5. generic (
  6. REF_CLK : string := "0"; -- reference clk in MHz
  7. OUT_CLK : string := "0"; -- output clk in MHz
  8. PERF_MD : string := "UNDEFINED"; -- LOWPOWER, ECONOMY, SPEED (optional, global, setting of Place&Route can be used instead)
  9. LOW_JITTER : natural := 1; -- 0: disable, 1: enable low jitter mode
  10. CI_FILTER_CONST : natural := 2; -- optional CI filter constant
  11. CP_FILTER_CONST : natural := 4 -- optional CP filter constant
  12. );
  13. port (
  14. CLK_REF : in std_logic;
  15. CLK_FEEDBACK : in std_logic;
  16. USR_CLK_REF : in std_logic;
  17. USR_LOCKED_STDY_RST : in std_logic;
  18. USR_PLL_LOCKED_STDY : out std_logic;
  19. USR_PLL_LOCKED : out std_logic;
  20. CLK270 : out std_logic;
  21. CLK180 : out std_logic;
  22. CLK0 : out std_logic := '1';
  23. CLK90 : out std_logic := '0';
  24. CLK_REF_OUT : out std_logic
  25. );
  26. end entity;
  27. architecture sim of CC_PLL is
  28. constant c_period_ns : real := (1000.0 / real'value(OUT_CLK));
  29. constant c_half_period_ns : real := c_period_ns / 2.0;
  30. begin
  31. Log : process is
  32. begin
  33. report CC_PLL'instance_name & " CC_PLL CLK0 = " & to_string(1000.0/(c_period_ns), 2) & " MHz";
  34. wait;
  35. end process;
  36. CLK0 <= not CLK0 after c_half_period_ns * ns;
  37. CLK90 <= transport CLK0 after (c_half_period_ns / 2.0) * ns;
  38. CLK180 <= not CLK0;
  39. CLK270 <= not CLK90;
  40. CLK_REF_OUT <= CLK_REF;
  41. USR_PLL_LOCKED <= '1';
  42. end architecture;
  43. library ieee ;
  44. use ieee.std_logic_1164.all;
  45. entity CC_CFG_END is
  46. port (
  47. CFG_END : out std_logic
  48. );
  49. end entity;
  50. architecture sim of CC_CFG_END is
  51. begin
  52. CFG_END <= '1';
  53. end architecture;