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

#include <ProximBusDetailsCmd.hh>

Inheritance diagram for ProximBusDetailsCmd:
Inheritance graph
Collaboration diagram for ProximBusDetailsCmd:
Collaboration graph

Public Member Functions

 ProximBusDetailsCmd (const TTAMachine::Bus &bus)
 
virtual ~ProximBusDetailsCmd ()
 
virtual bool Do ()
 
- Public Member Functions inherited from ComponentCommand
 ComponentCommand ()
 
virtual ~ComponentCommand ()
 
wxWindow * parentWindow ()
 
void setParentWindow (wxWindow *window)
 

Private Attributes

const TTAMachine::Busbus_
 Bus to display. More...
 

Detailed Description

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

Definition at line 46 of file ProximBusDetailsCmd.hh.

Constructor & Destructor Documentation

◆ ProximBusDetailsCmd()

ProximBusDetailsCmd::ProximBusDetailsCmd ( const TTAMachine::Bus bus)

The Constructor.

Parameters
busBus to display.

Definition at line 53 of file ProximBusDetailsCmd.cc.

53  :
54  ComponentCommand(), bus_(bus) {
55 }

◆ ~ProximBusDetailsCmd()

ProximBusDetailsCmd::~ProximBusDetailsCmd ( )
virtual

The Destructor.

Definition at line 61 of file ProximBusDetailsCmd.cc.

61  {
62 }

Member Function Documentation

◆ Do()

bool ProximBusDetailsCmd::Do ( )
virtual

Executes the command.

Implements ComponentCommand.

Definition at line 68 of file ProximBusDetailsCmd.cc.

68  {
69 
70  string busName = bus_.name();
71 
74  const UtilizationStats& stats =
76 
77  // Append component type and name to the details widget.
79  machineWin->appendDetails(busName + "\n\n");
80 
81  // Append registers to the details widget.
82  const BusState& busState = machineState.busState(busName);
83  int busValue = busState.value().sIntWordValue();
85  machineWin->appendDetails(Conversion::toString(busValue) + "\n");
86 
87  // Append utlization statistics.
88  ClockCycleCount writes = stats.busWrites(busName);
89  machineWin->appendUtilizationData(
91  machineWin->appendUtilizationData(Conversion::toString(writes));
92 
94  double percent = 0;
95  if (cycles > 0) {
96  percent = (100.0 * writes) / cycles;
97  }
98  machineWin->appendUtilizationData(
99  " (" + Conversion::toString(percent) + "%)");
100 
101  return true;
102 }

References ProximMachineStateWindow::appendDetails(), ProximMachineStateWindow::appendUtilizationData(), bus_, MachineState::busState(), UtilizationStats::busWrites(), SimulatorFrontend::cycleCount(), ProximToolbox::frontend(), ProximConstants::MACH_WIN_BUS_LABEL, ProximConstants::MACH_WIN_BUS_VALUE_LABEL, ProximConstants::MACH_WIN_BUS_WRITES_LABEL, SimulatorFrontend::machineState(), ProximToolbox::machineStateWindow(), TTAMachine::Component::name(), SimValue::sIntWordValue(), Conversion::toString(), SimulatorFrontend::utilizationStatistics(), and RegisterState::value().

Here is the call graph for this function:

Member Data Documentation

◆ bus_

const TTAMachine::Bus& ProximBusDetailsCmd::bus_
private

Bus to display.

Definition at line 53 of file ProximBusDetailsCmd.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
BusState
Definition: BusState.hh:48
ProximConstants::MACH_WIN_BUS_WRITES_LABEL
static const std::string MACH_WIN_BUS_WRITES_LABEL
Label for the machine state window bus write count..
Definition: ProximConstants.hh:224
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
ProximConstants::MACH_WIN_BUS_LABEL
static const std::string MACH_WIN_BUS_LABEL
Label precing bus names in the machine state window.
Definition: ProximConstants.hh:216
MachineState
Definition: MachineState.hh:61
MachineState::busState
BusState & busState(const std::string &name)
Definition: MachineState.cc:116
SimulatorFrontend::utilizationStatistics
const UtilizationStats & utilizationStatistics(int core=-1)
Definition: SimulatorFrontend.cc:2155
UtilizationStats::busWrites
ClockCycleCount busWrites(const std::string &busName) const
Definition: UtilizationStats.cc:192
ProximConstants::MACH_WIN_BUS_VALUE_LABEL
static const std::string MACH_WIN_BUS_VALUE_LABEL
Label for the machine state window bus value.
Definition: ProximConstants.hh:222
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
SimulatorFrontend::cycleCount
ClockCycleCount cycleCount() const
Definition: SimulatorFrontend.cc:1194
ProximBusDetailsCmd::bus_
const TTAMachine::Bus & bus_
Bus to display.
Definition: ProximBusDetailsCmd.hh:53
SimulatorFrontend::machineState
MachineState & machineState(int core=-1)
Definition: SimulatorFrontend.cc:2138
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
UtilizationStats
Definition: UtilizationStats.hh:50