forked from ferrandi/PandA-bambu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
memory_initialization_writer.hpp
107 lines (97 loc) · 3.56 KB
/
memory_initialization_writer.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
*
* _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
* _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
* _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
* _/ _/ _/ _/ _/ _/ _/ _/ _/
* _/ _/ _/ _/ _/ _/_/_/ _/ _/
*
* ***********************************************
* PandA Project
* URL: http://panda.dei.polimi.it
* Politecnico di Milano - DEIB
* System Architectures Group
* ***********************************************
* Copyright (c) 2018-2023 Politecnico di Milano
*
* This file is part of the PandA framework.
*
* The PandA framework is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* @file memory_initialization_writer.hpp
* @brief Functor used to write initialization of the memory
*
* @author Marco Lattuada <[email protected]>
*
*/
#ifndef MEMORY_INITIALIZATION_WRITER_HPP
#define MEMORY_INITIALIZATION_WRITER_HPP
/// Superclass include
#include "memory_initialization_writer_base.hpp"
/// STD include
#include <string>
/// STL includes
#include <utility>
#include <vector>
/// utility include
#include "refcount.hpp"
CONSTREF_FORWARD_DECL(BehavioralHelper);
CONSTREF_FORWARD_DECL(Parameter);
enum class TestbenchGeneration_MemoryType;
CONSTREF_FORWARD_DECL(tree_manager);
CONSTREF_FORWARD_DECL(tree_node);
/**
* Functor used to write initialization of the memory writer
*/
class MemoryInitializationWriter : public MemoryInitializationWriterBase
{
protected:
/// The stream corresponding to the memory initialization file
std::ofstream& output_stream;
public:
/**
* Constructor
* @param output_stream is where memory initialization will be written
* @param TM is the tree manager
* @param behavioral_helper is the behavioral helper
* @param reserved_mem_bytes is the number of bytes to be written
* @param function_parameter is the function parameter whose initialization is being printed
* @param testbench_generation_memory_type is the type of initialization being printed
* @param parameters is the set of input parameters
*/
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);
/**
* Process an element
*/
void Process(const std::string& content) override;
/**
* In this case the function does not activate anything
*/
void ActivateFileInit(const std::string&) override
{
}
/**
* do nothing
*/
void FinalizeFileInit() override
{
}
};
#endif