| Patrick Venture | e620656 | 2018-03-08 15:36:53 -0800 | [diff] [blame] | 1 | # Introduction | 
|  | 2 |  | 
|  | 3 | Swampd's primary function is to drive the fans of a system given various inputs. | 
|  | 4 |  | 
|  | 5 | # Layout | 
|  | 6 |  | 
|  | 7 | The code is broken out into modules as follows: | 
|  | 8 |  | 
|  | 9 | * `dbus` - Any read or write interface that uses dbus primarily. | 
|  | 10 | * `experiments` - Small execution paths that allow for fan examination | 
|  | 11 | including how quickly fans respond to changes. | 
|  | 12 | * `ipmi` - Manual control for any zone is handled by receiving an IPMI message. | 
|  | 13 | This holds the ipmid provider for receiving those messages and sending them | 
|  | 14 | onto swampd. | 
|  | 15 | * `notimpl` - These are read-only and write-only interface implementations that | 
|  | 16 | can be dropped into a pluggable sensor to make it complete. | 
|  | 17 | * `pid` - This contains all the PID associated code, including the zone | 
| Gunnar Mills | 08afbb2 | 2018-06-14 08:50:53 -0500 | [diff] [blame^] | 18 | definition, controller definition, and the PID computational code. | 
| Patrick Venture | e620656 | 2018-03-08 15:36:53 -0800 | [diff] [blame] | 19 | * `scripts` - This contains the scripts that convert YAML into C++. | 
|  | 20 | * `sensors` - This contains a couple of sensor types including the pluggable | 
|  | 21 | sensor's definition.  It also holds the sensor manager. | 
|  | 22 | * `sysfs` - This contains code that reads from or writes to sysfs. | 
|  | 23 | * `threads` - Most of swampd's threads run in this method where there's just a | 
|  | 24 | dbus bus that we manage. | 
|  | 25 |  | 
|  | 26 |  | 
|  | 27 | # Design | 
|  | 28 |  | 
|  | 29 | One defines a series of sensors and a series of PIDs that utilize those sensors | 
|  | 30 | as inputs (and outputs). | 
|  | 31 |  | 
|  | 32 | The thermal PID | 
|  | 33 |  | 
|  | 34 | set-point -------->|---|---> RPM | 
|  | 35 | current value ---->|___| | 
|  | 36 |  | 
|  | 37 | The fan PID | 
|  | 38 |  | 
|  | 39 | set-point -------->|---|---> pwm% | 
|  | 40 | current value ---->|___| | 
|  | 41 |  | 
|  | 42 | How to get set-point for fan PIDs | 
|  | 43 |  | 
|  | 44 | thermal-out ----->|-----| | 
|  | 45 | thermal-out ----->|     |-----> RPM | 
|  | 46 | thermal-out ----->| MAX | | 
|  | 47 | thermal-out ----->|_____| |