OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
ProximSocketDetailsCmd Class Reference

#include <ProximSocketDetailsCmd.hh>

Inheritance diagram for ProximSocketDetailsCmd:
Inheritance graph
Collaboration diagram for ProximSocketDetailsCmd:
Collaboration graph

Public Member Functions

 ProximSocketDetailsCmd (const TTAMachine::Socket &socket)
 
virtual ~ProximSocketDetailsCmd ()
 
virtual bool Do ()
 
- Public Member Functions inherited from ComponentCommand
 ComponentCommand ()
 
virtual ~ComponentCommand ()
 
wxWindow * parentWindow ()
 
void setParentWindow (wxWindow *window)
 

Private Attributes

const TTAMachine::Socketsocket_
 Socket to display. More...
 

Detailed Description

Command for displaying socket details in the machine window component details pane.

Definition at line 46 of file ProximSocketDetailsCmd.hh.

Constructor & Destructor Documentation

◆ ProximSocketDetailsCmd()

ProximSocketDetailsCmd::ProximSocketDetailsCmd ( const TTAMachine::Socket socket)

The Constructor.

Parameters
busSocket to display.

Definition at line 51 of file ProximSocketDetailsCmd.cc.

52  :
53  ComponentCommand(), socket_(socket) {
54 }

◆ ~ProximSocketDetailsCmd()

ProximSocketDetailsCmd::~ProximSocketDetailsCmd ( )
virtual

The Destructor.

Definition at line 60 of file ProximSocketDetailsCmd.cc.

60  {
61 }

Member Function Documentation

◆ Do()

bool ProximSocketDetailsCmd::Do ( )
virtual

Executes the command.

Implements ComponentCommand.

Definition at line 67 of file ProximSocketDetailsCmd.cc.

67  {
68 
69  string socketName = socket_.name();
70 
72  const UtilizationStats& stats =
74 
75  // Append component type and name to the details widget.
77  machineWin->appendDetails(socketName + "\n\n");
78 
79  // Append utlization statistics.
80  ClockCycleCount writes = stats.socketWrites(socketName);
81  machineWin->appendUtilizationData(
83  machineWin->appendUtilizationData(Conversion::toString(writes));
84 
86  double percent = 0;
87  if (cycles > 0) {
88  percent = (100.0 * writes) / cycles;
89  }
90  machineWin->appendUtilizationData(
91  " (" + Conversion::toString(percent) + "%)");
92 
93  return true;
94 }

References ProximMachineStateWindow::appendDetails(), ProximMachineStateWindow::appendUtilizationData(), SimulatorFrontend::cycleCount(), ProximToolbox::frontend(), ProximConstants::MACH_WIN_SOCKET_LABEL, ProximConstants::MACH_WIN_SOCKET_WRITES_LABEL, ProximToolbox::machineStateWindow(), TTAMachine::Component::name(), socket_, UtilizationStats::socketWrites(), Conversion::toString(), and SimulatorFrontend::utilizationStatistics().

Here is the call graph for this function:

Member Data Documentation

◆ socket_

const TTAMachine::Socket& ProximSocketDetailsCmd::socket_
private

Socket to display.

Definition at line 53 of file ProximSocketDetailsCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
ProximToolbox::frontend
static TracedSimulatorFrontend * frontend()
Definition: ProximToolbox.cc:223
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
UtilizationStats::socketWrites
ClockCycleCount socketWrites(const std::string &socketName) const
Definition: UtilizationStats.cc:206
ProximMachineStateWindow::appendDetails
void appendDetails(std::string text)
Definition: ProximMachineStateWindow.cc:479
ProximMachineStateWindow
Definition: ProximMachineStateWindow.hh:56
ComponentCommand::ComponentCommand
ComponentCommand()
Definition: ComponentCommand.cc:38
Conversion::toString
static std::string toString(const T &source)
SimulatorFrontend::utilizationStatistics
const UtilizationStats & utilizationStatistics(int core=-1)
Definition: SimulatorFrontend.cc:2155
ProximConstants::MACH_WIN_SOCKET_LABEL
static const std::string MACH_WIN_SOCKET_LABEL
Label precing socket names in the machine state window.
Definition: ProximConstants.hh:212
ProximMachineStateWindow::appendUtilizationData
void appendUtilizationData(std::string text)
Definition: ProximMachineStateWindow.cc:467
ProximSocketDetailsCmd::socket_
const TTAMachine::Socket & socket_
Socket to display.
Definition: ProximSocketDetailsCmd.hh:53
ProximToolbox::machineStateWindow
static ProximMachineStateWindow * machineStateWindow()
Definition: ProximToolbox.cc:123
SimulatorFrontend::cycleCount
ClockCycleCount cycleCount() const
Definition: SimulatorFrontend.cc:1194
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
ProximConstants::MACH_WIN_SOCKET_WRITES_LABEL
static const std::string MACH_WIN_SOCKET_WRITES_LABEL
Label for the machine state window socket write count.
Definition: ProximConstants.hh:226
UtilizationStats
Definition: UtilizationStats.hh:50