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

#include <ProximFUDetailsCmd.hh>

Inheritance diagram for ProximFUDetailsCmd:
Inheritance graph
Collaboration diagram for ProximFUDetailsCmd:
Collaboration graph

Public Member Functions

 ProximFUDetailsCmd (const TTAMachine::FunctionUnit &fu)
 
virtual ~ProximFUDetailsCmd ()
 
virtual bool Do ()
 
- Public Member Functions inherited from ComponentCommand
 ComponentCommand ()
 
virtual ~ComponentCommand ()
 
wxWindow * parentWindow ()
 
void setParentWindow (wxWindow *window)
 

Private Attributes

const TTAMachine::FunctionUnitfu_
 Function unit to display. More...
 

Detailed Description

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

Definition at line 46 of file ProximFUDetailsCmd.hh.

Constructor & Destructor Documentation

◆ ProximFUDetailsCmd()

ProximFUDetailsCmd::ProximFUDetailsCmd ( const TTAMachine::FunctionUnit fu)

The Constructor.

Parameters
fuFunction unit to display.

Definition at line 55 of file ProximFUDetailsCmd.cc.

55  :
56  ComponentCommand(), fu_(fu) {
57 }

◆ ~ProximFUDetailsCmd()

ProximFUDetailsCmd::~ProximFUDetailsCmd ( )
virtual

The Destructor.

Definition at line 63 of file ProximFUDetailsCmd.cc.

63  {
64 }

Member Function Documentation

◆ Do()

bool ProximFUDetailsCmd::Do ( )
virtual

Executes the command.

Implements ComponentCommand.

Definition at line 70 of file ProximFUDetailsCmd.cc.

70  {
71 
72  string fuName = fu_.name();
73 
75 
76  const UtilizationStats& stats =
78 
80 
81  // Append component type and name to the details widget.
83  machineWin->appendDetails(fuName + "\n\n");
84 
85  // Append ports to the details widget.
87  for (int i = 0; i < fu_.portCount(); i++) {
88  string portName = fu_.port(i)->name();
89  const PortState& portState = machineState.portState(portName, fuName);
90  machineWin->appendDetails(" " + portName + ":\t");
91  machineWin->appendDetails(
92  Conversion::toString(portState.value().uIntWordValue()) + "\n");
93  }
94 
95  // Append trigger count to the utlization widget.
96  machineWin->appendUtilizationData(
98  double triggerCount = stats.triggerCount(fuName);
99  machineWin->appendUtilizationData(Conversion::toString(triggerCount));
100  machineWin->appendUtilizationData("\n\n");
101 
102  // Append operation usage to the utilization widget.
103  machineWin->appendUtilizationData(
105  machineWin->appendUtilizationData("\n");
106 
107  for (int i = 0; i < fu_.operationCount(); i++) {
108  string opName = StringTools::stringToUpper(fu_.operation(i)->name());
109  ClockCycleCount execCount = stats.operationExecutions(fuName, opName);
110  double percent = 0;
111  if (triggerCount > 0) {
112  percent = 100 * (execCount / triggerCount);
113  }
114  machineWin->appendUtilizationData(
115  " " + opName + ": " +
116  Conversion::toString(execCount) + " (" +
117  Conversion::toString(percent) + "%)\n");
118  }
119 
120  return true;
121 }

References ProximMachineStateWindow::appendDetails(), ProximMachineStateWindow::appendUtilizationData(), ProximToolbox::frontend(), fu_, ProximConstants::MACH_WIN_EXECUTION_COUNT_LABEL, ProximConstants::MACH_WIN_FU_LABEL, ProximConstants::MACH_WIN_PORTS_TITLE, ProximConstants::MACH_WIN_TRIGGER_COUNT_LABEL, SimulatorFrontend::machineState(), ProximToolbox::machineStateWindow(), TTAMachine::HWOperation::name(), TTAMachine::Port::name(), TTAMachine::Component::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), UtilizationStats::operationExecutions(), TTAMachine::FunctionUnit::port(), TTAMachine::Unit::portCount(), MachineState::portState(), StringTools::stringToUpper(), Conversion::toString(), UtilizationStats::triggerCount(), SimValue::uIntWordValue(), SimulatorFrontend::utilizationStatistics(), and RegisterState::value().

Here is the call graph for this function:

Member Data Documentation

◆ fu_

const TTAMachine::FunctionUnit& ProximFUDetailsCmd::fu_
private

Function unit to display.

Definition at line 53 of file ProximFUDetailsCmd.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::triggerCount
ClockCycleCount triggerCount(const std::string &fuName) const
Definition: UtilizationStats.cc:220
ProximFUDetailsCmd::fu_
const TTAMachine::FunctionUnit & fu_
Function unit to display.
Definition: ProximFUDetailsCmd.hh:53
MachineState::portState
PortState & portState(const std::string &portName, const std::string &fuName)
Definition: MachineState.cc:175
ProximMachineStateWindow::appendDetails
void appendDetails(std::string text)
Definition: ProximMachineStateWindow.cc:479
ProximMachineStateWindow
Definition: ProximMachineStateWindow.hh:56
TTAMachine::FunctionUnit::port
virtual BaseFUPort * port(const std::string &name) const
Definition: FunctionUnit.cc:145
ComponentCommand::ComponentCommand
ComponentCommand()
Definition: ComponentCommand.cc:38
SimValue::uIntWordValue
UIntWord uIntWordValue() const
Definition: SimValue.cc:972
Conversion::toString
static std::string toString(const T &source)
StringTools::stringToUpper
static std::string stringToUpper(const std::string &source)
Definition: StringTools.cc:143
ProximConstants::MACH_WIN_EXECUTION_COUNT_LABEL
static const std::string MACH_WIN_EXECUTION_COUNT_LABEL
Execution count title for the machine state window.
Definition: ProximConstants.hh:229
RegisterState::value
virtual const SimValue & value() const
Definition: RegisterState.cc:92
MachineState
Definition: MachineState.hh:61
TTAMachine::HWOperation::name
const std::string & name() const
Definition: HWOperation.cc:141
SimulatorFrontend::utilizationStatistics
const UtilizationStats & utilizationStatistics(int core=-1)
Definition: SimulatorFrontend.cc:2155
UtilizationStats::operationExecutions
ClockCycleCount operationExecutions(const std::string &operationName) const
Definition: UtilizationStats.cc:234
TTAMachine::FunctionUnit::operationCount
virtual int operationCount() const
Definition: FunctionUnit.cc:419
ProximConstants::MACH_WIN_TRIGGER_COUNT_LABEL
static const std::string MACH_WIN_TRIGGER_COUNT_LABEL
Trigger count label for the machine state window.
Definition: ProximConstants.hh:232
PortState
Definition: PortState.hh:51
TTAMachine::Unit::portCount
virtual int portCount() const
Definition: Unit.cc:135
ProximMachineStateWindow::appendUtilizationData
void appendUtilizationData(std::string text)
Definition: ProximMachineStateWindow.cc:467
ProximToolbox::machineStateWindow
static ProximMachineStateWindow * machineStateWindow()
Definition: ProximToolbox.cc:123
SimulatorFrontend::machineState
MachineState & machineState(int core=-1)
Definition: SimulatorFrontend.cc:2138
TTAMachine::Port::name
virtual std::string name() const
Definition: Port.cc:141
ProximConstants::MACH_WIN_PORTS_TITLE
static const std::string MACH_WIN_PORTS_TITLE
Title for the machine state window ports list.
Definition: ProximConstants.hh:235
ProximConstants::MACH_WIN_FU_LABEL
static const std::string MACH_WIN_FU_LABEL
Label precing function unit names in the machine state window.
Definition: ProximConstants.hh:206
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
TTAMachine::FunctionUnit::operation
virtual HWOperation * operation(const std::string &name) const
Definition: FunctionUnit.cc:363
UtilizationStats
Definition: UtilizationStats.hh:50