blob: ff1c429309d532dad278b921e25fd335b476e60d [file] [log] [blame]
Patrick Venturee6206562018-03-08 15:36:53 -08001# Introduction
2
3Swampd's primary function is to drive the fans of a system given various inputs.
4
5# Layout
6
7The 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
11including how quickly fans respond to changes.
12* `ipmi` - Manual control for any zone is handled by receiving an IPMI message.
13This holds the ipmid provider for receiving those messages and sending them
14onto swampd.
15* `notimpl` - These are read-only and write-only interface implementations that
16can be dropped into a pluggable sensor to make it complete.
17* `pid` - This contains all the PID associated code, including the zone
Gunnar Mills08afbb22018-06-14 08:50:53 -050018definition, controller definition, and the PID computational code.
Patrick Venturee6206562018-03-08 15:36:53 -080019* `scripts` - This contains the scripts that convert YAML into C++.
20* `sensors` - This contains a couple of sensor types including the pluggable
21sensor'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
24dbus bus that we manage.
25
26
27# Design
28
29One defines a series of sensors and a series of PIDs that utilize those sensors
30as 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 ----->|_____|