OpenASIP  2.0
ProximFUPortDetailsCmd.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file ProximFUPortDetailsCmd.cc
26  *
27  * Implementation of ProximFUPortDetailsCmd class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2005 (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #include <string>
36 #include "ProximToolbox.hh"
37 #include "FUPort.hh"
38 #include "UtilizationStats.hh"
40 #include "Conversion.hh"
41 #include "StringTools.hh"
42 #include "ProximConstants.hh"
43 #include "MachineState.hh"
44 #include "PortState.hh"
45 #include "FunctionUnit.hh"
46 
47 using std::string;
48 using namespace TTAMachine;
49 
50 /**
51  * The Constructor.
52  *
53  * @param fu Function unit port to display.
54  */
56  const TTAMachine::FUPort& port) :
57  ComponentCommand(), port_(port) {
58 }
59 
60 
61 /**
62  * The Destructor.
63  */
65 }
66 
67 
68 /**
69  * Executes the command.
70  */
71 bool
73 
74  string fuName = port_.parentUnit()->name();
75  string portName = port_.name();
76 
78 
80 
81  // Append component type and name to the details widget.
83  machineWin->appendDetails("\n" + fuName + "." + portName + "\n\n");
84 
85  const PortState& portState = machineState.portState(portName, fuName);
86  machineWin->appendDetails(
87  Conversion::toHexString(portState.value().unsignedValue()) + "\n");
88 
89  return true;
90 }
ProximToolbox::frontend
static TracedSimulatorFrontend * frontend()
Definition: ProximToolbox.cc:223
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
TTAMachine::BaseFUPort::parentUnit
FunctionUnit * parentUnit() const
Definition: BaseFUPort.cc:96
MachineState::portState
PortState & portState(const std::string &portName, const std::string &fuName)
Definition: MachineState.cc:175
ProximFUPortDetailsCmd::ProximFUPortDetailsCmd
ProximFUPortDetailsCmd(const TTAMachine::FUPort &port)
Definition: ProximFUPortDetailsCmd.cc:55
ProximMachineStateWindow.hh
ProximFUPortDetailsCmd::~ProximFUPortDetailsCmd
virtual ~ProximFUPortDetailsCmd()
Definition: ProximFUPortDetailsCmd.cc:64
ProximMachineStateWindow::appendDetails
void appendDetails(std::string text)
Definition: ProximMachineStateWindow.cc:479
ProximMachineStateWindow
Definition: ProximMachineStateWindow.hh:56
ProximFUPortDetailsCmd::port_
const TTAMachine::FUPort & port_
Function unit port to display.
Definition: ProximFUPortDetailsCmd.hh:53
StringTools.hh
ProximToolbox.hh
RegisterState::value
virtual const SimValue & value() const
Definition: RegisterState.cc:92
TTAMachine::FUPort
Definition: FUPort.hh:46
MachineState
Definition: MachineState.hh:61
ProximFUPortDetailsCmd.hh
ProximConstants::MACH_WIN_FU_PORT_LABEL
static const std::string MACH_WIN_FU_PORT_LABEL
Label precing function unit port names in the machine state window.
Definition: ProximConstants.hh:208
Conversion.hh
PortState
Definition: PortState.hh:51
Conversion::toHexString
static std::string toHexString(T source, std::size_t digits=0, bool include0x=true)
ComponentCommand
Definition: ComponentCommand.hh:46
SimValue::unsignedValue
unsigned int unsignedValue() const
Definition: SimValue.cc:919
ProximToolbox::machineStateWindow
static ProximMachineStateWindow * machineStateWindow()
Definition: ProximToolbox.cc:123
UtilizationStats.hh
TracedSimulatorFrontend.hh
ProximConstants.hh
SimulatorFrontend::machineState
MachineState & machineState(int core=-1)
Definition: SimulatorFrontend.cc:2138
ProximFUPortDetailsCmd::Do
virtual bool Do()
Definition: ProximFUPortDetailsCmd.cc:72
TTAMachine::Port::name
virtual std::string name() const
Definition: Port.cc:141
FUPort.hh
MachineState.hh
TTAMachine
Definition: Assembler.hh:48
PortState.hh
FunctionUnit.hh