fancontrol.tcl 2.13 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# Copyright (C) 2014 Jens Korinth, TU Darmstadt
#
# This file is part of Tapasco (TPC).
#
# Tapasco is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Tapasco is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Tapasco.  If not, see <http://www.gnu.org/licenses/>.
#
# @file   fancontrol.tcl
# @brief  Plugin to add a primitive counter-based PWM to slow down the noisy
#         fan on the ZC706 (use at own risk!).
# @author J. Korinth, TU Darmstadt (jk@esa.cs.tu-darmstadt.de)
#
namespace eval fancontrol {
  proc fancontrol_feature {{args {}}} {
26
    if {[tapasco::is_feature_enabled "FanControl"]} {
27
28
      put "Building primitive PWM module to subdue the noisy ZC706 fan ..."
      set ps [get_bd_cell -hierarchical -filter {VLNV =~ "xilinx.com:ip:processing_system*"}]
29
30
      set cnt [tapasco::ip::create_bincnt "pwmcounter" 4]
      set sli [tapasco::ip::create_xlslice "pwmslice" 4 3]
31
32
33
34
35
36
37
38
39
40
      set pwm [create_bd_port -dir O "pwm"]
      connect_bd_net $pwm [get_bd_pins "pwmslice/Dout"]
      connect_bd_net [get_bd_pins "pwmcounter/Q"] [get_bd_pins "pwmslice/Din"]
      connect_bd_net [get_bd_pin "$ps/FCLK_CLK0"] [get_bd_pin "$cnt/CLK"]
      add_files -fileset constrs_1 -norecurse "$::env(TAPASCO_HOME)/platform/zc706/plugins/fancontrol-zc706.xdc"
    }
    return {}
  }

  proc fancontrol_falsepath {{args {}}} {
41
42
43
44
45
    if {[tapasco::is_feature_enabled "FanControl"]} {
      set port [get_ports -filter {NAME =~ *pwm*}]
      puts "Setting false path on $port, timing does not matter."
      set_false_path -to $port
    }
46
47
48
49
    return {}
  }
}

Jens Korinth's avatar
Jens Korinth committed
50
tapasco::register_plugin "platform::fancontrol::fancontrol_feature" "pre-wrapper"
51
tapasco::register_plugin "platform::fancontrol::fancontrol_falsepath" "post-synth"