Debian Codegraph @

hdl/fpga/platforms/bladerf-micro/constraints/i2c.sdc

raw
1 # bladeRF Micro Design Constraints File for I2C interfaces
2 #
3 # Copyright (c) 2017 Nuand LLC
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining a copy
6 # of this software and associated documentation files (the "Software"), to deal
7 # in the Software without restriction, including without limitation the rights
8 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 # copies of the Software, and to permit persons to whom the Software is
10 # furnished to do so, subject to the following conditions:
11 #
12 # The above copyright notice and this permission notice shall be included in
13 # all copies or substantial portions of the Software.
14 #
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 # THE SOFTWARE.
22
23 # Create generated clocks. Input clock to the SPI block in the common_system
24 # is 80 MHz, actual output clock is 400 kHz
25 set pwr_scl_divisor 200
26
27 create_generated_clock -name i2c_scl_reg -source [get_pins $system_clock] -divide_by $pwr_scl_divisor [get_registers {*bit_controller|scl_oen}]
28 create_generated_clock -name pwr_scl_pin -source [get_registers -no_duplicates {*bit_controller|scl_oen}] [get_ports {pwr_scl}]
29
30 set_max_skew -from [get_clocks {pwr_scl_pin}] -to [get_ports {pwr_scl}] 0.2
31
32 # Constraints for INA219 data
33 set ina_i2c_data_ts 100.0
34 set ina_i2c_data_th 900.0
35
36 set_input_delay -clock [get_clocks pwr_scl_pin] -max $ina_i2c_data_ts [get_ports {pwr_sda}]
37 set_input_delay -clock [get_clocks pwr_scl_pin] -min $ina_i2c_data_th [get_ports {pwr_sda}]
38
39 set_output_delay -clock [get_clocks pwr_scl_pin] -max $ina_i2c_data_ts [get_ports {pwr_sda}]
40 set_output_delay -clock [get_clocks pwr_scl_pin] -min $ina_i2c_data_th [get_ports {pwr_sda}]
41
42 # Multicycle constraints
43 set_multicycle_path -setup -start -from [get_clocks $system_clock] -to [get_clocks {pwr_scl_pin}] [expr {$pwr_scl_divisor / 2}]
44 set_multicycle_path -hold -start -from [get_clocks $system_clock] -to [get_clocks {pwr_scl_pin}] [expr {$pwr_scl_divisor - 1}]
45 set_multicycle_path -setup -end -from [get_clocks {pwr_scl_pin}] -to [get_clocks $system_clock] [expr {$pwr_scl_divisor / 2}]
46 set_multicycle_path -hold -end -from [get_clocks {pwr_scl_pin}] -to [get_clocks $system_clock] [expr {$pwr_scl_divisor - 1}]