OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 

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}
const TTAMachine::RegisterFile & rf_
Register file to display.

◆ ~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}
CycleCount ClockCycleCount
Alias for ClockCycleCount.
static std::string toString(const T &source)
RegisterFileState & registerFileState(const std::string &name)
static const std::string MACH_WIN_RF_LABEL
Label precing register file names in the machine state window.
static const std::string MACH_WIN_REGISTERS_TITLE
Title for the machine state window register file register list.
void appendDetails(std::string text)
void appendUtilizationData(std::string text)
static TracedSimulatorFrontend * frontend()
static ProximMachineStateWindow * machineStateWindow()
virtual RegisterState & registerState(int index)
virtual std::size_t registerCount() const
virtual const SimValue & value() const
unsigned int unsignedValue() const
Definition SimValue.cc:919
const UtilizationStats & utilizationStatistics(int core=-1)
MachineState & machineState(int core=-1)
virtual TCEString name() const
ClockCycleCount registerReads(const std::string &rfName, int registerIndex) const
ClockCycleCount registerWrites(const std::string &rfName, int registerIndex) const

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: