max80.sdc 4.0 KB

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