geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::SSTIOImp Class Reference

#include <SSTIOImp.hpp>

Inheritance diagram for geopm::SSTIOImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::SSTIOImp:
Collaboration graph
[legend]

Public Member Functions

 SSTIOImp (uint32_t max_cpus)
 Main constructor for the SST ioctl interface. More...
 
 SSTIOImp (uint32_t max_cpus, std::shared_ptr< SSTIoctl > ioctl_interface)
 This is the same as the main constructor, but it allows you to override the ioctl interface. More...
 
virtual ~SSTIOImp ()=default
 
int add_mbox_read (uint32_t cpu_index, uint16_t command, uint16_t subcommand, uint32_t subcommand_arg) override
 Interact with the mailbox on commands that are expected to return data. More...
 
int add_mbox_write (uint32_t cpu_index, uint16_t command, uint16_t subcommand, uint32_t interface_parameter, uint16_t read_subcommand, uint32_t read_interface_parameter, uint32_t read_mask) override
 Interact with the mailbox on commands that are not expected to return data. More...
 
int add_mmio_read (uint32_t cpu_index, uint16_t register_offset) override
 Interact with the mmio interface on commands that are expected to return data. More...
 
int add_mmio_write (uint32_t cpu_index, uint16_t register_offset, uint32_t register_value, uint32_t read_mask) override
 Interact with the mmio interface on commands that are not expected to return data. More...
 
void read_batch (void) override
 Issue a batch read. More...
 
uint64_t sample (int batch_idx) const override
 Sample a value from the most recent batch read. More...
 
void write_batch (void) override
 Issue a batch write. More...
 
uint32_t read_mbox_once (uint32_t cpu_index, uint16_t command, uint16_t subcommand, uint32_t subcommand_arg) override
 Immediately query the SST mailbox for a read operation. More...
 
void write_mbox_once (uint32_t cpu_index, uint16_t command, uint16_t subcommand, uint32_t interface_parameter, uint16_t read_subcommand, uint32_t read_interface_parameter, uint32_t read_mask, uint64_t write_value, uint64_t write_mask) override
 Immediately query the SST mailbox for a write operation. More...
 
uint32_t read_mmio_once (uint32_t cpu_index, uint16_t register_offset) override
 Immediately read a value from the SST MMIO interface. More...
 
void write_mmio_once (uint32_t cpu_index, uint16_t register_offset, uint32_t register_value, uint32_t read_mask, uint64_t write_value, uint64_t write_mask) override
 Immediately write a value to the SST MMIO interface. More...
 
void adjust (int batch_idx, uint64_t write_value, uint64_t write_mask) override
 Adjust a value for the next batch write. More...
 
uint32_t get_punit_from_cpu (uint32_t cpu_index) override
 Get the punit index associated with a CPU index. More...
 
- Public Member Functions inherited from geopm::SSTIO
 SSTIO ()=default
 
virtual ~SSTIO ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::SSTIO
static std::shared_ptr< SSTIOmake_shared (uint32_t max_cpus)
 Create an SSTIO object. More...
 

Constructor & Destructor Documentation

◆ SSTIOImp() [1/2]

geopm::SSTIOImp::SSTIOImp ( uint32_t  max_cpus)

Main constructor for the SST ioctl interface.

Parameters
[in]max_cpusThe number of CPUs to attempt to map to punit cores.

◆ SSTIOImp() [2/2]

geopm::SSTIOImp::SSTIOImp ( uint32_t  max_cpus,
std::shared_ptr< SSTIoctl ioctl_interface 
)

This is the same as the main constructor, but it allows you to override the ioctl interface.

◆ ~SSTIOImp()

virtual geopm::SSTIOImp::~SSTIOImp ( )
virtualdefault

Member Function Documentation

◆ add_mbox_read()

int geopm::SSTIOImp::add_mbox_read ( uint32_t  cpu_index,
uint16_t  command,
uint16_t  subcommand,
uint32_t  subcommand_arg 
)
overridevirtual

Interact with the mailbox on commands that are expected to return data.

Implements geopm::SSTIO.

◆ add_mbox_write()

int geopm::SSTIOImp::add_mbox_write ( uint32_t  cpu_index,
uint16_t  command,
uint16_t  subcommand,
uint32_t  interface_parameter,
uint16_t  read_subcommand,
uint32_t  read_interface_parameter,
uint32_t  read_mask 
)
overridevirtual

Interact with the mailbox on commands that are not expected to return data.

Parameters
[in]cpu_indexIndex of the CPU to which the mailbox read is being issued
[in]commandWhich SST mailbox command to issue
[in]subcommandWhich SST mailbox subcommand to issue
[in]interface_parameterWhich SST mailbox parameter to use
[in]read_subcommandWhich SST mailbox subcommand to issue when reading the current value prior to a write
[in]read_interface_parameterWhich SST mailbox parameter to use when reading the current value prior to a write
[in]read_maskThe mask to apply to values read from the mailbox prior to a write

Implements geopm::SSTIO.

◆ add_mmio_read()

int geopm::SSTIOImp::add_mmio_read ( uint32_t  cpu_index,
uint16_t  register_offset 
)
overridevirtual

Interact with the mmio interface on commands that are expected to return data.

Parameters
[in]cpu_indexIndex of the CPU to which the MMIO read is being issued
[in]register_offsetWhich SST MMIO register offset to use

Implements geopm::SSTIO.

◆ add_mmio_write()

int geopm::SSTIOImp::add_mmio_write ( uint32_t  cpu_index,
uint16_t  register_offset,
uint32_t  register_value,
uint32_t  read_mask 
)
overridevirtual

Interact with the mmio interface on commands that are not expected to return data.

Parameters
[in]cpu_indexIndex of the CPU to which the MMIO write is being issued
[in]register_offsetWhich SST MMIO register offset to use
[in]register_valueWhich SST MMIO register value to set for the write.
[in]read_maskThe mask to apply to values read from the register prior to a write

Implements geopm::SSTIO.

◆ adjust()

void geopm::SSTIOImp::adjust ( int  batch_idx,
uint64_t  write_value,
uint64_t  write_mask 
)
overridevirtual

Adjust a value for the next batch write.

Parameters
[in]batch_idxAn index returned from an add_*_write function
[in]write_valueThe value to write in the next batch_write()
[in]write_maskThe mask to apply when writing this value

Implements geopm::SSTIO.

◆ get_punit_from_cpu()

uint32_t geopm::SSTIOImp::get_punit_from_cpu ( uint32_t  cpu_index)
overridevirtual

Get the punit index associated with a CPU index.

Parameters
[in]cpu_indexIndex of the CPU

Implements geopm::SSTIO.

◆ read_batch()

void geopm::SSTIOImp::read_batch ( void  )
overridevirtual

Issue a batch read.

Implements geopm::SSTIO.

◆ read_mbox_once()

uint32_t geopm::SSTIOImp::read_mbox_once ( uint32_t  cpu_index,
uint16_t  command,
uint16_t  subcommand,
uint32_t  subcommand_arg 
)
overridevirtual

Immediately query the SST mailbox for a read operation.

Parameters
[in]cpu_indexIndex of the CPU to which the mailbox read is being issued
[in]commandWhich SST mailbox command to issue
[in]subcommandWhich SST mailbox subcommand to issue
[in]subcommand_argWhich argument to use for the SST mailbox subcommand

Implements geopm::SSTIO.

◆ read_mmio_once()

uint32_t geopm::SSTIOImp::read_mmio_once ( uint32_t  cpu_index,
uint16_t  register_offset 
)
overridevirtual

Immediately read a value from the SST MMIO interface.

Parameters
[in]cpu_indexIndex of the CPU to which the MMIO read is being issued
[in]register_offsetWhich SST MMIO register offset to use

Implements geopm::SSTIO.

◆ sample()

uint64_t geopm::SSTIOImp::sample ( int  batch_idx) const
overridevirtual

Sample a value from the most recent batch read.

Parameters
[in]batch_idxAn index returned from an add_*_read function prior to calling read_batch().

Implements geopm::SSTIO.

◆ write_batch()

void geopm::SSTIOImp::write_batch ( void  )
overridevirtual

Issue a batch write.

Implements geopm::SSTIO.

◆ write_mbox_once()

void geopm::SSTIOImp::write_mbox_once ( uint32_t  cpu_index,
uint16_t  command,
uint16_t  subcommand,
uint32_t  interface_parameter,
uint16_t  read_subcommand,
uint32_t  read_interface_parameter,
uint32_t  read_mask,
uint64_t  write_value,
uint64_t  write_mask 
)
overridevirtual

Immediately query the SST mailbox for a write operation.

Parameters
[in]cpu_indexIndex of the CPU to which the mailbox read is being issued
[in]commandWhich SST mailbox command to issue
[in]subcommandWhich SST mailbox subcommand to issue
[in]interface_parameterWhich SST mailbox parameter to use
[in]read_subcommandWhich SST mailbox subcommand to issue when reading the current value prior to a write
[in]read_interface_parameterWhich SST mailbox parameter to use when reading the current value prior to a write
[in]read_maskThe mask to apply to values read from the mailbox prior to a write
[in]write_valueThe value to write
[in]write_maskThe mask to apply to the written value

Implements geopm::SSTIO.

◆ write_mmio_once()

void geopm::SSTIOImp::write_mmio_once ( uint32_t  cpu_index,
uint16_t  register_offset,
uint32_t  register_value,
uint32_t  read_mask,
uint64_t  write_value,
uint64_t  write_mask 
)
overridevirtual

Immediately write a value to the SST MMIO interface.

Parameters
[in]cpu_indexIndex of the CPU to which the MMIO write is being issued
[in]register_offsetWhich SST MMIO register offset to use
[in]register_valueWhich SST MMIO register value to set for the write.
[in]read_maskThe mask to apply to values read from the register prior to a write
[in]write_valueThe value to write
[in]write_maskThe mask to apply to the written value

Implements geopm::SSTIO.


The documentation for this class was generated from the following files: