OpenASIP  2.0
Public Types | Public Member Functions | Protected Attributes | List of all members
RemoteController Class Referenceabstract

#include <RemoteController.hh>

Inheritance diagram for RemoteController:
Inheritance graph
Collaboration diagram for RemoteController:
Collaboration graph

Public Types

typedef MinimumAddressableUnit MAU
 
- Public Types inherited from TTASimulationController
enum  SimulationStatus {
  STA_INITIALIZING, STA_INITIALIZED, STA_RUNNING, STA_STOPPED,
  STA_FINISHED
}
 The states of simulation. More...
 

Public Member Functions

 RemoteController (SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program)
 
virtual void writeMem (Word address, MAU data, const AddressSpace &)=0
 
virtual MAU readMem (Word address, const AddressSpace &)=0
 
virtual void loadIMemImage ()
 
virtual void writeIMem (const char *data, int size)=0
 
virtual void step (double count=1)=0
 
virtual void next (int count=1)=0
 
virtual void run ()=0
 
virtual void runUntil (UIntWord address)=0
 
virtual void reset ()=0
 
virtual std::string registerFileValue (const std::string &rfName, int registerIndex=-1)=0
 
virtual SimValue immediateUnitRegisterValue (const std::string &iuName, int index=-1)=0
 
virtual SimValue FUPortValue (const std::string &fuName, const std::string &portName)=0
 
virtual InstructionAddress programCounter () const =0
 
- Public Member Functions inherited from TTASimulationController
 TTASimulationController (SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program)
 
virtual ~TTASimulationController ()
 
virtual void prepareToStop (StopReason reason)
 
virtual unsigned int stopReasonCount () const
 
virtual StopReason stopReason (unsigned int index) const
 
virtual SimulationStatus state () const
 
virtual InstructionAddress lastExecutedInstruction (int coreId=-1) const
 
virtual ClockCycleCount clockCount () const
 
virtual MemorySystemmemorySystem (int coreId=-1)
 
virtual SimulatorFrontendfrontend ()
 
virtual bool automaticFinishImpossible () const
 
virtual std::set< InstructionAddressfindProgramExitPoints (const TTAProgram::Program &program, const TTAMachine::Machine &machine) const
 

Protected Attributes

std::set< InstructionAddressexitPoints
 
std::ostringstream imemImage
 
- Protected Attributes inherited from TTASimulationController
SimulatorFrontendfrontend_
 Reference to the simulator frontend. More...
 
const TTAMachine::MachinesourceMachine_
 The simulated Machine Object Model. More...
 
const TTAProgram::Programprogram_
 Program object model of the simulated program. More...
 
bool stopRequested_
 Flag indicating that simulation should stop. More...
 
StopReasonContainer stopReasons_
 The set of reasons the simulation was stopped. More...
 
SimulationStatus state_
 The current state of the simulation. More...
 
ClockCycleCount clockCount_
 How many clock cycles have been simulated. More...
 
std::vector< InstructionAddresslastExecutedInstruction_
 The address of the last executed instruction. More...
 
InstructionAddress initialPC_
 The address of the first executed instruction. More...
 
bool automaticFinishImpossible_
 If this is true, simulation cannot be finished automatically. More...
 
InstructionAddress firstIllegalInstructionIndex_
 The index of the first illegal instruction in the instruction sequence. More...
 

Additional Inherited Members

- Protected Types inherited from TTASimulationController
typedef std::set< StopReasonStopReasonContainer
 The container type for reasons why simulation stop was requested. More...
 
- Protected Member Functions inherited from TTASimulationController
 TTASimulationController (const TTASimulationController &)
 Copying not allowed. More...
 
TTASimulationControlleroperator= (const TTASimulationController &)
 Assignment not allowed. More...
 

Detailed Description

RemoteController is a "simulation" controller base class for debuggers on hardware implementations.

RemoteController is a base class for the TCE built-in debugger and the custom debugger classes. It adds virtual interfaces to TTASimulationController, that are needed to integrate an FPGA or ASIC to the TCE debugging tools. RemoteController is a interface class, and cannot be instantiated.

Definition at line 48 of file RemoteController.hh.

Member Typedef Documentation

◆ MAU

Definition at line 50 of file RemoteController.hh.

Constructor & Destructor Documentation

◆ RemoteController()

RemoteController::RemoteController ( SimulatorFrontend frontend,
const TTAMachine::Machine machine,
const TTAProgram::Program program 
)

Definition at line 48 of file RemoteController.cc.

51  :
53  imemImage(std::ostringstream::binary) {
55 }

References exitPoints, TTASimulationController::findProgramExitPoints(), machine, and program.

Here is the call graph for this function:

Member Function Documentation

◆ FUPortValue()

virtual SimValue RemoteController::FUPortValue ( const std::string &  fuName,
const std::string &  portName 
)
pure virtual

◆ immediateUnitRegisterValue()

virtual SimValue RemoteController::immediateUnitRegisterValue ( const std::string &  iuName,
int  index = -1 
)
pure virtual

◆ loadIMemImage()

void RemoteController::loadIMemImage ( )
virtual

Create and load instruction memory image from current program.

This function generates a binary image of the instruction memory, and stores it in cache. It is then written with loadInstructions(), which in turn call the pure virtual writeIMem, that subclasses need to implement.

Definition at line 58 of file RemoteController.cc.

58  {
59 
60  ProgramImageGenerator thePIG;
61  BinaryEncoding *theBE;
62  TPEF::Binary *binary;
63  // TODO. better name from somewhere?
64  std::string programName("the program");
65  // clear the old image
66  imemImage.str("");
67 
68  // Binary encoding of the instruction sream
69  // TODO: loading of instruction compressors would happen here?
70  BEMGenerator theBEMGen(sourceMachine_);
71  theBE = theBEMGen.generate();
72 
74  binary = writer.createBinary();
76  // TODO: have some actual name for this program?
77  tmap[programName] = binary;
78 
79  thePIG.loadBEM(*theBE);
80  thePIG.loadMachine(sourceMachine_);
81  thePIG.loadPrograms(tmap);
82  // clear the old image
83 
84  // put the instructions into imemImage
85  thePIG.generateProgramImage(
86  programName, imemImage,
88 
89  writeIMem(imemImage.str().c_str(), imemImage.str().size());
90 
91  delete binary;
92  delete theBE;
93 
94  return;
95 
96 }

References ProgramImageGenerator::BINARY, TTAProgram::ProgramWriter::createBinary(), BEMGenerator::generate(), ProgramImageGenerator::generateProgramImage(), imemImage, ProgramImageGenerator::loadBEM(), ProgramImageGenerator::loadMachine(), ProgramImageGenerator::loadPrograms(), TTASimulationController::program_, TTASimulationController::sourceMachine_, and writeIMem().

Here is the call graph for this function:

◆ next()

virtual void RemoteController::next ( int  count = 1)
pure virtual

◆ programCounter()

virtual InstructionAddress RemoteController::programCounter ( ) const
pure virtual

◆ readMem()

virtual MAU RemoteController::readMem ( Word  address,
const AddressSpace  
)
pure virtual

Read data from physical memory.

Parameters
addressTTA's view of the memory address from which to read @space the address space from which to read the data.
Returns
one MAU of data to write. (TODO: is return value masked or not?)

Implemented in TCEDBGController, and CustomDBGController.

Referenced by RemoteMemory::read().

◆ registerFileValue()

virtual std::string RemoteController::registerFileValue ( const std::string &  rfName,
int  registerIndex = -1 
)
pure virtual

◆ reset()

virtual void RemoteController::reset ( )
pure virtual

◆ run()

virtual void RemoteController::run ( )
pure virtual

◆ runUntil()

virtual void RemoteController::runUntil ( UIntWord  address)
pure virtual

◆ step()

virtual void RemoteController::step ( double  count = 1)
pure virtual

◆ writeIMem()

virtual void RemoteController::writeIMem ( const char *  data,
int  size 
)
pure virtual

Write to phyical instruction memory.

Parameters
addressTTA's view of the memory address to which to write @data buffer of raw data to write to instruction memory @size the size of the data buffer, in bytes

Implemented in TCEDBGController, and CustomDBGController.

Referenced by loadIMemImage().

◆ writeMem()

virtual void RemoteController::writeMem ( Word  address,
MAU  data,
const AddressSpace  
)
pure virtual

Write data to physical memory.

Parameters
addressTTA's view of the memory address to which to write @data one MAU of data to write. Needs to be masked, if MAU is less than maximum MAU size. @space the address space in which to write the data.

Implemented in TCEDBGController, and CustomDBGController.

Referenced by RemoteMemory::write().

Member Data Documentation

◆ exitPoints

std::set<InstructionAddress> RemoteController::exitPoints
protected

Definition at line 120 of file RemoteController.hh.

Referenced by RemoteController().

◆ imemImage

std::ostringstream RemoteController::imemImage
protected

Definition at line 121 of file RemoteController.hh.

Referenced by loadIMemImage().


The documentation for this class was generated from the following files:
ProgramImageGenerator::generateProgramImage
void generateProgramImage(const std::string &programName, std::ostream &stream, OutputFormat format, int mausPerLine=0)
Definition: ProgramImageGenerator.cc:185
BinaryEncoding
Definition: BinaryEncoding.hh:61
RemoteController::writeIMem
virtual void writeIMem(const char *data, int size)=0
ProgramImageGenerator::loadBEM
void loadBEM(const BinaryEncoding &bem)
Definition: ProgramImageGenerator.cc:162
RemoteController::exitPoints
std::set< InstructionAddress > exitPoints
Definition: RemoteController.hh:120
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
TTASimulationController::TTASimulationController
TTASimulationController(SimulatorFrontend &frontend, const TTAMachine::Machine &machine, const TTAProgram::Program &program)
Definition: TTASimulationController.cc:60
TPEF::Binary
Definition: Binary.hh:49
TTAProgram::ProgramWriter
Definition: ProgramWriter.hh:141
ProgramImageGenerator::loadPrograms
void loadPrograms(TPEFMap programs)
Definition: ProgramImageGenerator.cc:140
BEMGenerator
Definition: BEMGenerator.hh:61
ProgramImageGenerator::loadMachine
void loadMachine(const TTAMachine::Machine &machine)
Definition: ProgramImageGenerator.cc:151
TTASimulationController::findProgramExitPoints
virtual std::set< InstructionAddress > findProgramExitPoints(const TTAProgram::Program &program, const TTAMachine::Machine &machine) const
Definition: TTASimulationController.cc:209
TTASimulationController::sourceMachine_
const TTAMachine::Machine & sourceMachine_
The simulated Machine Object Model.
Definition: TTASimulationController.hh:137
ProgramImageGenerator
Definition: ProgramImageGenerator.hh:67
TTASimulationController::frontend
virtual SimulatorFrontend & frontend()
Definition: TTASimulationController.cc:181
ProgramImageGenerator::BINARY
@ BINARY
Real binary format.
Definition: ProgramImageGenerator.hh:72
RemoteController::imemImage
std::ostringstream imemImage
Definition: RemoteController.hh:121
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
TTASimulationController::program_
const TTAProgram::Program & program_
Program object model of the simulated program.
Definition: TTASimulationController.hh:139
ProgramImageGenerator::TPEFMap
std::map< std::string, TPEF::Binary * > TPEFMap
Definition: ProgramImageGenerator.hh:81