PandA-2024.02
|
Functor used to write initialization of the memory writer. More...
#include <memory_initialization_writer.hpp>
Public Member Functions | |
MemoryInitializationWriter (std::ofstream &output_stream, const tree_managerConstRef TM, const BehavioralHelperConstRef behavioral_helper, const unsigned long int reserved_mem_bytes, const tree_nodeConstRef function_parameter, const TestbenchGeneration_MemoryType testbench_generation_memory_type, const ParameterConstRef parameters) | |
Constructor. More... | |
void | Process (const std::string &content) override |
Process an element. More... | |
void | ActivateFileInit (const std::string &) override |
In this case the function does not activate anything. More... | |
void | FinalizeFileInit () override |
do nothing More... | |
Public Member Functions inherited from MemoryInitializationWriterBase | |
MemoryInitializationWriterBase (const tree_managerConstRef TM, const BehavioralHelperConstRef behavioral_helper, const unsigned long int reserved_mem_bytes, const tree_nodeConstRef function_parameter, const TestbenchGeneration_MemoryType testbench_generation_memory_type, const ParameterConstRef parameters) | |
Constructor. More... | |
void | CheckEnd () override |
Check that all the necessary information was present in the initialization string. More... | |
void | GoDown () override |
Start the initialization of a new aggregated data structure. More... | |
void | GoNext () override |
Consume an element of an aggregated data structure. More... | |
void | GoUp () override |
Ends the initialization of the current aggregated data structure. More... | |
Public Member Functions inherited from CInitializationParserFunctor | |
CInitializationParserFunctor () | |
Constructor. More... | |
virtual | ~CInitializationParserFunctor () |
Destructor. More... | |
Protected Attributes | |
std::ofstream & | output_stream |
The stream corresponding to the memory initialization file. More... | |
Protected Attributes inherited from MemoryInitializationWriterBase | |
const tree_managerConstRef | TM |
The tree manager. More... | |
const BehavioralHelperConstRef | behavioral_helper |
The behavioral helper. More... | |
const unsigned long int | reserved_mem_bytes |
The number of bytes to be written. More... | |
unsigned long int | written_bytes |
The number of bytes currently written. More... | |
std::vector< std::pair< const tree_nodeConstRef, size_t > > | status |
The stack representing the current status of the parser; the content is the last dumped element. More... | |
const tree_nodeConstRef | function_parameter |
The variable/parameter being printed. More... | |
const TestbenchGeneration_MemoryType | testbench_generation_memory_type |
The type of initialization being written. More... | |
Protected Attributes inherited from CInitializationParserFunctor | |
int | debug_level |
The debug level. More... | |
bool | write_in_a_file |
the data will be written in a data copied by the caller More... | |
std::string | file_variable |
variable used to write in a variable More... | |
Additional Inherited Members | |
Protected Member Functions inherited from MemoryInitializationWriterBase | |
const std::string | PrintStatus () const |
Print the current status. More... | |
Functor used to write initialization of the memory writer.
Definition at line 65 of file memory_initialization_writer.hpp.
MemoryInitializationWriter::MemoryInitializationWriter | ( | std::ofstream & | _output_stream, |
const tree_managerConstRef | _TM, | ||
const BehavioralHelperConstRef | _behavioral_helper, | ||
const unsigned long int | _reserved_mem_bytes, | ||
const tree_nodeConstRef | _function_parameter, | ||
const TestbenchGeneration_MemoryType | _testbench_generation_memory_type, | ||
const ParameterConstRef | _parameters | ||
) |
Constructor.
Header include.
output_stream | is where memory initialization will be written |
TM | is the tree manager |
behavioral_helper | is the behavioral helper |
reserved_mem_bytes | is the number of bytes to be written |
function_parameter | is the function parameter whose initialization is being printed |
testbench_generation_memory_type | is the type of initialization being printed |
parameters | is the set of input parameters |
. include HLS/simulation include STD include STL include tree includes utility include
Definition at line 68 of file memory_initialization_writer.cpp.
References CInitializationParserFunctor::debug_level, and GET_CLASS.
|
inlineoverridevirtual |
In this case the function does not activate anything.
Implements CInitializationParserFunctor.
Definition at line 96 of file memory_initialization_writer.hpp.
|
inlineoverridevirtual |
do nothing
Implements CInitializationParserFunctor.
Definition at line 103 of file memory_initialization_writer.hpp.
|
overridevirtual |
Process an element.
Second, according to the type let's how many elements have to have been processed
Implements CInitializationParserFunctor.
Definition at line 79 of file memory_initialization_writer.cpp.
References MemoryInitializationWriterBase::behavioral_helper, CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_UNARY_EXPRESSION, tree_helper::CGetPointedType(), ConvertInBinary(), CInitializationParserFunctor::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, MemoryInitializationWriterBase::function_parameter, GET_CONST_NODE, INDENT_DBG_MEX, INPUT_PARAMETER, tree_helper::IsUnsignedIntegerType(), MEMORY_INITIALIZATION, NODE_NOT_YET_SUPPORTED_EC, OUTPUT_PARAMETER, output_stream, BehavioralHelper::PrintVariable(), RETURN, tree_helper::Size(), MemoryInitializationWriterBase::status, STR, MemoryInitializationWriterBase::testbench_generation_memory_type, THROW_ASSERT, THROW_ERROR, THROW_ERROR_CODE, THROW_UNREACHABLE, and MemoryInitializationWriterBase::written_bytes.
|
protected |
The stream corresponding to the memory initialization file.
Definition at line 69 of file memory_initialization_writer.hpp.
Referenced by Process().