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

#include <ProximIUDetailsCmd.hh>

Inheritance diagram for ProximIUDetailsCmd:
Inheritance graph
Collaboration diagram for ProximIUDetailsCmd:
Collaboration graph

Public Member Functions

 ProximIUDetailsCmd (const TTAMachine::ImmediateUnit &iu)
 
virtual ~ProximIUDetailsCmd ()
 
virtual bool Do ()
 
- Public Member Functions inherited from ComponentCommand
 ComponentCommand ()
 
virtual ~ComponentCommand ()
 
wxWindow * parentWindow ()
 
void setParentWindow (wxWindow *window)
 

Private Attributes

const TTAMachine::ImmediateUnitiu_
 Immediate unit to display. More...
 

Detailed Description

Command for displaying immediate unit details in the machine window component details pane.

Definition at line 46 of file ProximIUDetailsCmd.hh.

Constructor & Destructor Documentation

◆ ProximIUDetailsCmd()

ProximIUDetailsCmd::ProximIUDetailsCmd ( const TTAMachine::ImmediateUnit iu)

The Constructor.

Parameters
iuImmediate unit to display.

Definition at line 53 of file ProximIUDetailsCmd.cc.

53  :
54  ComponentCommand(), iu_(iu) {
55 }

◆ ~ProximIUDetailsCmd()

ProximIUDetailsCmd::~ProximIUDetailsCmd ( )
virtual

The Destructor.

Definition at line 61 of file ProximIUDetailsCmd.cc.

61  {
62 }

Member Function Documentation

◆ Do()

bool ProximIUDetailsCmd::Do ( )
virtual

Executes the command.

Implements ComponentCommand.

Definition at line 68 of file ProximIUDetailsCmd.cc.

68  {
69 
70  string iuName = iu_.name();
71 
74 
75  const UtilizationStats& stats =
77 
78  // Append component type and name to the details widget.
80  machineWin->appendDetails(iuName + "\n\n");
81 
82  // Append registers to the details widget.
83  machineWin->appendDetails(
85  LongImmediateUnitState& iuState =
86  machineState.longImmediateUnitState(iuName);
87 
88  for (int i = 0; i < iuState.immediateRegisterCount(); i++) {
89  machineWin->appendDetails(" " + Conversion::toString(i) + ":\t");
90  int immValue = iuState.registerValue(i).sIntWordValue();
91  machineWin->appendDetails(Conversion::toString(immValue) + "\n");
92  }
93 
94  // Append register access statistics to the utilization widget.
95  machineWin->appendUtilizationData("Register access statistics:\n\n");
96 
97  int usedRegCount = 0;
98  for (int i = 0; i < iuState.immediateRegisterCount(); i++) {
99  ClockCycleCount reads = stats.registerReads(iuName, i);
100  ClockCycleCount writes = stats.registerWrites(iuName, i);
101  if (reads > 0 || writes > 0) {
102  usedRegCount++;
103  }
104  machineWin->appendUtilizationData(
105  Conversion::toString(i) + + ": " +
106  Conversion::toString(reads) + " reads, " +
107  Conversion::toString(writes) + " writes.\n");
108  }
109 
110  machineWin->appendUtilizationData(
111  "\nTotal of " + Conversion::toString(usedRegCount) +
112  " registers used.");
113 
114  return true;
115 }

References ProximMachineStateWindow::appendDetails(), ProximMachineStateWindow::appendUtilizationData(), ProximToolbox::frontend(), LongImmediateUnitState::immediateRegisterCount(), iu_, MachineState::longImmediateUnitState(), ProximConstants::MACH_WIN_IMMEDIATES_TITLE, ProximConstants::MACH_WIN_IU_LABEL, SimulatorFrontend::machineState(), ProximToolbox::machineStateWindow(), TTAMachine::Component::name(), UtilizationStats::registerReads(), LongImmediateUnitState::registerValue(), UtilizationStats::registerWrites(), SimValue::sIntWordValue(), Conversion::toString(), and SimulatorFrontend::utilizationStatistics().

Here is the call graph for this function:

Member Data Documentation

◆ iu_

const TTAMachine::ImmediateUnit& ProximIUDetailsCmd::iu_
private

Immediate unit to display.

Definition at line 53 of file ProximIUDetailsCmd.hh.

Referenced by Do().


The documentation for this class was generated from the following files:
MachineState::longImmediateUnitState
LongImmediateUnitState & longImmediateUnitState(const std::string &name)
Definition: MachineState.cc:196
ProximToolbox::frontend
static TracedSimulatorFrontend * frontend()
Definition: ProximToolbox.cc:223
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
LongImmediateUnitState::immediateRegisterCount
virtual int immediateRegisterCount() const
Definition: LongImmediateUnitState.cc:174
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)
MachineState
Definition: MachineState.hh:61
SimulatorFrontend::utilizationStatistics
const UtilizationStats & utilizationStatistics(int core=-1)
Definition: SimulatorFrontend.cc:2155
ProximConstants::MACH_WIN_IMMEDIATES_TITLE
static const std::string MACH_WIN_IMMEDIATES_TITLE
Title for the machine state window immediate unit immediates list.
Definition: ProximConstants.hh:239
ProximIUDetailsCmd::iu_
const TTAMachine::ImmediateUnit & iu_
Immediate unit to display.
Definition: ProximIUDetailsCmd.hh:53
ProximMachineStateWindow::appendUtilizationData
void appendUtilizationData(std::string text)
Definition: ProximMachineStateWindow.cc:467
SimValue::sIntWordValue
SIntWord sIntWordValue() const
Definition: SimValue.cc:944
ProximToolbox::machineStateWindow
static ProximMachineStateWindow * machineStateWindow()
Definition: ProximToolbox.cc:123
ProximConstants::MACH_WIN_IU_LABEL
static const std::string MACH_WIN_IU_LABEL
Label precing immediate unit names in the machine state window.
Definition: ProximConstants.hh:218
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
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
LongImmediateUnitState::registerValue
virtual SimValue & registerValue(int index)
Definition: LongImmediateUnitState.cc:98
UtilizationStats
Definition: UtilizationStats.hh:50
LongImmediateUnitState
Definition: LongImmediateUnitState.hh:55