43#include "data/constantHandler.h"
44#include "data/dataHandler.h"
45#include "data/primitiveTypeArray.h"
46#include "instructions/instruction.h"
47#include "instructions/set.h"
66 operator size_t()
const
90 const std::vector<std::reference_wrapper<const Data::DataHandler>>
100 std::vector<std::reference_wrapper<const Data::DataHandler>>
136 const std::vector<std::reference_wrapper<const Data::DataHandler>>&
173 const std::vector<std::reference_wrapper<const Data::DataHandler>>&
197 const std::vector<std::reference_wrapper<const Data::DataHandler>>&
199 const size_t nbRegs,
const size_t nbConst = 0)
216 (std::reference_wrapper<const Data::DataHandler>)
this
284 const std::vector<std::reference_wrapper<const Data::DataHandler>>&
295 const std::vector<std::reference_wrapper<const Data::DataHandler>>&
Data::DataHandler used by Program::Program to handle their set of Constant values.
Definition: constantHandler.h:56
The Environment class contains all information needed to execute a Program.
Definition: environment.h:84
const std::vector< std::reference_wrapper< const Data::DataHandler > > & getDataSources() const
Get the DataHandler of the Environment.
Definition: environment.cpp:203
const Data::PrimitiveTypeArray< double > fakeRegisters
DataHandler whost type corresponds to registers.
Definition: environment.h:104
size_t getLargestAddressSpace() const
Get the size of the largestAddressSpace of DataHandlers.
Definition: environment.cpp:192
Environment(const Instructions::Set &iSet, const std::vector< std::reference_wrapper< const Data::DataHandler > > &dHandlers, const size_t nbRegs, const size_t nbConst=0)
Constructor with initialization of all attributes.
Definition: environment.h:195
const LineSize & getLineSize() const
Get the size of the line for this environment (in bits).
Definition: environment.cpp:197
const Data::ConstantHandler fakeConstants
DataHandler whost type corresponds to the programs constants.
Definition: environment.h:107
const LineSize lineSize
Size of lines within this Environment.
Definition: environment.h:122
const std::vector< std::reference_wrapper< const Data::DataHandler > > dataSources
List of DataHandler that can be accessed within this Environment.
Definition: environment.h:91
size_t getNbInstructions() const
Get the size of the number of Instruction within the Instructions::Set.
Definition: environment.cpp:177
const size_t nbRegisters
Number of registers.
Definition: environment.h:94
std::vector< std::reference_wrapper< const Data::DataHandler > > fakeDataSources
Vector of DataHandlers containing the environment's dataSources.
Definition: environment.h:101
size_t getNbConstant() const
Get the number of constants used by programs.
Definition: environment.cpp:172
const size_t maxNbOperands
Maxmimum number of operands of the Instructions::Set.
Definition: environment.h:113
static Instructions::Set filterInstructionSet(const Instructions::Set &iSet, const size_t nbRegisters, const size_t nbConstants, const std::vector< std::reference_wrapper< const Data::DataHandler > > &dataSources)
Filter an InstructionSet to keep only Instruction with operand types provided by the given DataHandle...
Definition: environment.cpp:55
const size_t nbConstants
Number of constants.
Definition: environment.h:97
const std::vector< std::reference_wrapper< const Data::DataHandler > > & getFakeDataSources() const
Definition: environment.cpp:209
size_t getMaxNbOperands() const
Get the size of the maximum number of operands of Instructions::Set.
Definition: environment.cpp:182
const Instructions::Set instructionSet
Set of Instruction used by Program running within this Environment.
Definition: environment.h:87
size_t getNbDataSources() const
Get the size of the number of DataHandlers.
Definition: environment.cpp:187
const size_t nbDataSources
Number of DataHandler from which data can be accessed.
Definition: environment.h:116
const size_t largestAddressSpace
Size of the largestAddressSpace of DataHandlers.
Definition: environment.h:119
const size_t nbInstructions
Number of Instruction in the Instructions::Set.
Definition: environment.h:110
const Instructions::Set & getInstructionSet() const
Get the Instruction Set of the Environment.
Definition: environment.cpp:214
size_t getNbRegisters() const
Get the size of the number of registers of this Environment.
Definition: environment.cpp:167
static const LineSize computeLineSize(const Environment &env)
Static method used to compute the size of Program lines based on information from the Enviroment.
Definition: environment.cpp:124
static size_t computeLargestAddressSpace(const size_t nbRegisters, const size_t nbConstants, const std::vector< std::reference_wrapper< const Data::DataHandler > > &dHandlers)
Static method used when constructing a new Environment to compute the largest AddressSpace of a set o...
Definition: environment.cpp:42
Class for storing a set of Instruction.
Definition: set.h:53
LineSize structure to be used within the Environment.
Definition: environment.h:51
size_t nbInstructionBits
Number of bits used to encode the instructionIndex.
Definition: environment.h:53
size_t nbOperandLocationBits
Number of bits used for each operand pair, to encode location.
Definition: environment.h:61
size_t nbDestinationBits
Number of bits used to encode the destinationIndex.
Definition: environment.h:55
size_t nbOperandsBits
Total number of bits used to encode the operands info.
Definition: environment.h:57
size_t nbOperandDataSourceIndexBits
Number of bits used for each operand pair, to encode dataSourceIndex.
Definition: environment.h:59
size_t totalNbBits
Total number of bits to encode a program line.
Definition: environment.h:63