geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
SSTSignal.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef SSTSIGNAL_HPP_INCLUDE
7 #define SSTSIGNAL_HPP_INCLUDE
8 
9 #include <memory>
10 
11 #include "Signal.hpp"
12 
13 namespace geopm
14 {
15  class SSTIO;
16 
19  class SSTSignal : public geopm::Signal
20  {
21  public:
23  {
24  M_MBOX, // SST Mailbox interface
25  M_MMIO // SST MMIO interface
26  };
27 
39  SSTSignal(std::shared_ptr<geopm::SSTIO> sstio,
40  SignalType signal_type,
41  int cpu_idx,
42  uint16_t command,
43  uint16_t subcommand,
44  uint32_t subcommand_arg,
45  uint32_t interface_parameter);
46 
47  virtual ~SSTSignal() = default;
48 
49  void setup_batch(void) override;
50  double sample(void) override;
51  double read(void) const override;
52  private:
53  std::shared_ptr<geopm::SSTIO> m_sstio;
54  SignalType m_signal_type;
55  const int m_cpu_idx;
56  const uint16_t m_command;
57  const uint16_t m_subcommand;
58  const uint32_t m_subcommand_arg;
59 
60  int m_batch_idx;
61  };
62 
63 }
64 
65 #endif
Definition: SSTSignal.hpp:20
SignalType
Definition: SSTSignal.hpp:23
@ M_MBOX
Definition: SSTSignal.hpp:24
@ M_MMIO
Definition: SSTSignal.hpp:25
double read(void) const override
Read directly the value of the signal without affecting any pushed batch signals.
Definition: SSTSignal.cpp:46
virtual ~SSTSignal()=default
double sample(void) override
Apply any conversions necessary to interpret the latest stored value as a double.
Definition: SSTSignal.cpp:41
void setup_batch(void) override
Prepare the signal for being updated through side effects by the owner's read_batch step....
Definition: SSTSignal.cpp:28
SSTSignal(std::shared_ptr< geopm::SSTIO > sstio, SignalType signal_type, int cpu_idx, uint16_t command, uint16_t subcommand, uint32_t subcommand_arg, uint32_t interface_parameter)
Create an SSTIO Signal.
Definition: SSTSignal.cpp:14
Definition: Signal.hpp:16
Definition: Agg.cpp:20