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

#include <ProximRFDetailsCmd.hh>

Inheritance diagram for ProximRFDetailsCmd:
Inheritance graph
Collaboration diagram for ProximRFDetailsCmd:
Collaboration graph

Public Member Functions

 ProximRFDetailsCmd (const TTAMachine::RegisterFile &rf)
 
virtual ~ProximRFDetailsCmd ()
 
virtual bool Do ()
 
- Public Member Functions inherited from ComponentCommand
 ComponentCommand ()
 
virtual ~ComponentCommand ()
 
wxWindow * parentWindow ()
 
void setParentWindow (wxWindow *window)
 

Private Attributes

const TTAMachine::RegisterFilerf_
 Register file to display. More...
 

Detailed Description

Command for displaying register file details in the machine window component details pane.

Definition at line 46 of file ProximRFDetailsCmd.hh.

Constructor & Destructor Documentation

◆ ProximRFDetailsCmd()

ProximRFDetailsCmd::ProximRFDetailsCmd ( const TTAMachine::RegisterFile rf)

The Constructor.

Parameters
rfRegister file to display.

Definition at line 54 of file ProximRFDetailsCmd.cc.

54  :
55  ComponentCommand(), rf_(rf) {
56 }

◆ ~ProximRFDetailsCmd()

ProximRFDetailsCmd::~ProximRFDetailsCmd ( )
virtual

The Destructor.

Definition at line 62 of file ProximRFDetailsCmd.cc.

62  {
63 }

Member Function Documentation

◆ Do()

bool ProximRFDetailsCmd::Do ( )
virtual

Executes the command.

Implements ComponentCommand.

Definition at line 69 of file ProximRFDetailsCmd.cc.

69  {
70 
71  string rfName = rf_.name();
72 
75 
76  const UtilizationStats& stats =
78 
79  // Append component type and name to the details widget.
81  machineWin->appendDetails(rfName + "\n\n");
82 
83  // Append registers to the details widget.
84  machineWin->appendDetails(
86  RegisterFileState& rfState = machineState.registerFileState(rfName);
87  for (unsigned i = 0; i < rfState.registerCount(); i++) {
88  machineWin->appendDetails(" " + Conversion::toString(i) + ":\t");
89  int registerValue = rfState.registerState(i).value().unsignedValue();
90  machineWin->appendDetails(Conversion::toString(registerValue) + "\n");
91  }
92 
93  // Append register access statistics to the utilization widget.
94  machineWin->appendUtilizationData("Register access statistics:\n\n");
95 
96  int usedRegCount = 0;
97  for (unsigned i = 0; i < rfState.registerCount(); i++) {
98  ClockCycleCount readCount = stats.registerReads(rfName, i);
99  ClockCycleCount writeCount = stats.registerWrites(rfName, i);
100  if (readCount > 0 || writeCount > 0) {
101  usedRegCount++;
102  }
103  machineWin->appendUtilizationData(
104  Conversion::toString(i) + + ": " +
105  Conversion::toString(readCount) + " reads, " +
106  Conversion::toString(writeCount) + " writes.\n");
107  }
108 
109  machineWin->appendUtilizationData(
110  "\nTotal of " + Conversion::toString(usedRegCount) +
111  " registers used.");
112 
113  return true;
114 }

References ProximMachineStateWindow::appendDetails(), ProximMachineStateWindow::appendUtilizationData(), ProximToolbox::frontend(), ProximConstants::MACH_WIN_REGISTERS_TITLE, ProximConstants::MACH_WIN_RF_LABEL, SimulatorFrontend::machineState(), ProximToolbox::machineStateWindow(), TTAMachine::Component::name(), RegisterFileState::registerCount(), MachineState::registerFileState(), UtilizationStats::registerReads(), RegisterFileState::registerState(), UtilizationStats::registerWrites(), rf_, Conversion::toString(), SimValue::unsignedValue(), SimulatorFrontend::utilizationStatistics(), and RegisterState::value().

Here is the call graph for this function:

Member Data Documentation

◆ rf_

const TTAMachine::RegisterFile& ProximRFDetailsCmd::rf_
private

Register file to display.

Definition at line 53 of file ProximRFDetailsCmd.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
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)
RegisterState::value
virtual const SimValue & value() const
Definition: RegisterState.cc:92
MachineState
Definition: MachineState.hh:61
ProximConstants::MACH_WIN_RF_LABEL
static const std::string MACH_WIN_RF_LABEL
Label precing register file names in the machine state window.
Definition: ProximConstants.hh:214
SimulatorFrontend::utilizationStatistics
const UtilizationStats & utilizationStatistics(int core=-1)
Definition: SimulatorFrontend.cc:2155
ProximConstants::MACH_WIN_REGISTERS_TITLE
static const std::string MACH_WIN_REGISTERS_TITLE
Title for the machine state window register file register list.
Definition: ProximConstants.hh:237
ProximMachineStateWindow::appendUtilizationData
void appendUtilizationData(std::string text)
Definition: ProximMachineStateWindow.cc:467
SimValue::unsignedValue
unsigned int unsignedValue() const
Definition: SimValue.cc:919
ProximRFDetailsCmd::rf_
const TTAMachine::RegisterFile & rf_
Register file to display.
Definition: ProximRFDetailsCmd.hh:53
ProximToolbox::machineStateWindow
static ProximMachineStateWindow * machineStateWindow()
Definition: ProximToolbox.cc:123
RegisterFileState::registerCount
virtual std::size_t registerCount() const
Definition: RegisterFileState.cc:95
RegisterFileState::registerState
virtual RegisterState & registerState(int index)
Definition: RegisterFileState.cc:81
SimulatorFrontend::machineState
MachineState & machineState(int core=-1)
Definition: SimulatorFrontend.cc:2138
UtilizationStats::registerWrites
ClockCycleCount registerWrites(const std::string &rfName, int registerIndex) const
Definition: UtilizationStats.cc:314
RegisterFileState
Definition: RegisterFileState.hh:49
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
UtilizationStats::registerReads
ClockCycleCount registerReads(const std::string &rfName, int registerIndex) const
Definition: UtilizationStats.cc:270
UtilizationStats
Definition: UtilizationStats.hh:50
MachineState::registerFileState
RegisterFileState & registerFileState(const std::string &name)
Definition: MachineState.cc:213