-
Notifications
You must be signed in to change notification settings - Fork 99
Controller Configuration
The controller configuration is called gCtrlrConfig and is of type class CtrlrConfig. It is a global object, which is why it has a ‘g’ prefixed. It is created automatically by the framework and is guaranteed to exist before any test assumes control. It is also a singleton; meaning only 1 object of its kind will ever exist for each running instance of tnvme. The main job of the gCtrlrConfig is to control the overall configuration of a DUT.
The gCtrlrConfig is where you will find the interface to control such things as:
- Interrupt handling scheme per DUT
- Access to the DUT’s Controller Configuration (CC) register
- Enabling/Disabling the DUT
It is important to understand that although a test can access the DUT’s CC register directly by using the gRegister singleton and setting a custom value for the CC.EM bit, it is highly discouraged. If this backdoor disabling occurs, it will be done without the gRsrcMngr being notified and resources which require sudden lifetime annihilation will not be cleaned up immediately. The gCtrlrConfig and gRsrcMngr are wired via subject-observer design pattern classes to allow proper notification of sudden death scenarios. Hence as a lesson to learn, if this class allows the controlling of a particular feature, then use this class as opposed to direct register writes using gRegisters.