max80.sdc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # -*- tcl -*-
  2. # Clock constraints
  3. # Input master clock for all PLLs
  4. create_clock -name "clock_48" -period 20.834ns [get_ports {clock_48}]
  5. derive_pll_clocks
  6. # Handle both the RTC input clock and the internal workaround
  7. # The internal workaround clock should still be treated an asynchronous
  8. create_clock -name "rtc_32khz" -period 30517.578ns [get_ports {rtc_32khz}]
  9. create_clock -name "ctr_32khz" -period 30517.578ns [get_registers {ctr_32khz}]
  10. set_clock_groups -asynchronous -group {rtc_32khz}
  11. set_clock_groups -asynchronous -group {ctr_32khz}
  12. # Automatically calculate clock uncertainty to jitter and other effects.
  13. derive_clock_uncertainty
  14. # Don't report signaltap clock problems...
  15. set_false_path -to [get_registers sld_signaltap:*]
  16. # -------- PLL clock mappings --------
  17. set sdram_out_clk [get_clocks {pll|*|clk[0]}]
  18. set sdram_clk [get_clocks {pll|*|clk[4]}]
  19. set sys_clk [get_clocks {pll|*|clk[1]}]
  20. set vid_clk [get_clocks {pll|*|clk[2]}]
  21. set flash_clk [get_clocks {pll|*|clk[3]}]
  22. set main_clocks [get_clocks {pll|*}]
  23. # Reset isn't actually a clock, but Quartus thinks it is
  24. create_generated_clock -name rst_n \
  25. -source [get_nets {pll|*|*clk[1]}] \
  26. [get_registers rst_n]
  27. # Reset is asynchronous with everything as far as we are concerned.
  28. set_clock_groups -asynchronous \
  29. -group $main_clocks \
  30. -group [get_clocks rst_n]
  31. # Anything that feeds into a synchronizer is by definition
  32. # asynchronous, but encode it as allowing multicycle of one
  33. # clock, to limit the possible skew (but it is of course not possible
  34. # to eliminate it...)
  35. set synchro_inputs [get_registers *|synchronizer:*|qreg0*]
  36. set_multicycle_path -from [all_clocks] -to $synchro_inputs \
  37. -start -setup 2
  38. set_multicycle_path -from [all_clocks] -to $synchro_inputs \
  39. -start -hold 1
  40. # -------- SDRAM I/O constraints --------
  41. set sr_data_out [remove_from_collection [get_ports sr_*] sr_clk]
  42. set sr_data_in [get_ports sr_dq\[*\]]
  43. set_max_skew -to $sr_data_out 0.100ns
  44. set_input_delay -clock $sdram_clk 0.500ns $sr_data_in
  45. set_multicycle_path -from $sdram_clk -to $sdram_out_clk \
  46. -start -setup 2
  47. set_multicycle_path -from $sdram_clk -to $sdram_out_clk \
  48. -start -hold 0
  49. # -------- SPI ROM multicycle paths --------
  50. # the load of the spi_data_ctr register happens no less than 2 target
  51. # clocks after datalen is loaded by the CPU
  52. set_multicycle_path -from [get_registers {spirom:*|datalen[*]}] \
  53. -to [get_registers {spirom:*|spi_data_ctr[*]}] -end -setup 2
  54. set_multicycle_path -from [get_registers {spirom:*|datalen[*]}] \
  55. -to [get_registers {spirom:*|spi_data_ctr[*]}] -end -hold 1
  56. # A load of romstart does not affect spi_cmd for a minimum of 3 target
  57. # clock cycles (in reality much more, since the CPU needs to
  58. # write datalen in order to start the transfer)
  59. set_multicycle_path -from [get_registers {spirom:*|romstart[*]}] \
  60. -to [get_registers {spirom:*|spi_cmd[*]}] -end -setup 3
  61. set_multicycle_path -from [get_registers {spirom:*|romstart[*]}] \
  62. -to [get_registers {spirom:*|spi_cmd[*]}] -end -hold 2
  63. # CS# going low to spi_clk_en is a minimum of one clock cycle, which allows
  64. # an extra clock cycle before spi_cmd needs to stop resetting
  65. set_multicycle_path -from [get_registers {spirom:*|spi_cs_n}] \
  66. -to [get_registers {spirom:*|spi_cmd[*]}] -end -setup 2
  67. set_multicycle_path -from [get_registers {spirom:*|spi_cs_n}] \
  68. -to [get_registers {spirom:*|spi_cmd[*]}] -end -hold 1
  69. # -------- CPU/fastmem multicycle paths --------
  70. # We never read and write in the same clock cycle, thus there is a multicycle
  71. # path from the write enable register to anything in the CPU itself
  72. set_multicycle_path -from [get_keepers {fast_mem:fast_mem|*porta_we_reg*}] \
  73. -to [get_keepers {picorv32:cpu|*}] -start -setup 2
  74. set_multicycle_path -from [get_keepers {fast_mem:fast_mem|*porta_we_reg*}] \
  75. -to [get_keepers {picorv32:cpu|*}] -start -hold 1