PandA-2024.02
discrepancy_analysis_c_writer.hpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
38 #ifndef DISCREPANCY_ANALYSIS_C_WRITER
39 #define DISCREPANCY_ANALYSIS_C_WRITER
40 
41 #include "hls_c_writer.hpp"
42 #include "refcount.hpp"
43 
45 
47 {
49 
50  protected:
52 
56  void WriteGlobalDeclarations() override;
57 
61  void WriteExtraInitCode() override;
62 
63  void WriteExtraCodeBeforeEveryMainCall() override;
64 
65  void WriteBBHeader(const unsigned int bb_number, const unsigned int function_index) override;
66 
71  void writePreInstructionInfo(const FunctionBehaviorConstRef FB, const vertex statement) override;
72 
77  void writePostInstructionInfo(const FunctionBehaviorConstRef fun_behavior, const vertex) override;
78 
83  void WriteFunctionImplementation(unsigned int function_index) override;
84 
85  public:
89  DiscrepancyAnalysisCWriter(const CBackendInformationConstRef _c_backend_information,
90  const HLS_managerConstRef _HLSMgr, const InstructionWriterRef _instruction_writer,
91  const IndentedOutputStreamRef _indented_output_stream,
92  const ParameterConstRef _parameters, bool _verbose);
93 
103  void DeclareLocalVariables(const CustomSet<unsigned int>& to_be_declared,
104  CustomSet<unsigned int>& already_declared_variables,
105  CustomSet<std::string>& locally_declared_type, const BehavioralHelperConstRef BH,
106  const var_pp_functorConstRef varFunc) override;
107 
108  void WriteFunctionDeclaration(const unsigned int funId) override;
109 
113  void WriteBuiltinWaitCall() override;
114 
115  void WriteMainTestbench() override;
116 };
117 #endif
void WriteGlobalDeclarations() override
Writes the global declarations.
void WriteFunctionDeclaration(const unsigned int funId) override
Writes the declaration of the function whose id in the tree is funId.
void WriteBBHeader(const unsigned int bb_number, const unsigned int function_index) override
void WriteFunctionImplementation(unsigned int function_index) override
Write function implementation.
void DeclareLocalVariables(const CustomSet< unsigned int > &to_be_declared, CustomSet< unsigned int > &already_declared_variables, CustomSet< std::string > &locally_declared_type, const BehavioralHelperConstRef BH, const var_pp_functorConstRef varFunc) override
Declares the local variable; in case the variable used in the initialization of curVar hasn&#39;t been de...
void WriteExtraInitCode() override
Write additional initialization code needed by subclasses.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
void WriteMainTestbench() override
Writes the main() of the testbench C program.
Template definition of refcount.
DiscrepancyAnalysisCWriter(const CBackendInformationConstRef _c_backend_information, const HLS_managerConstRef _HLSMgr, const InstructionWriterRef _instruction_writer, const IndentedOutputStreamRef _indented_output_stream, const ParameterConstRef _parameters, bool _verbose)
Constructor.
void WriteBuiltinWaitCall() override
Writes implementation of __builtin_wait_call.
REF_FORWARD_DECL(Discrepancy)
void writePreInstructionInfo(const FunctionBehaviorConstRef FB, const vertex statement) override
Write extra information on the given statement vertex, before the statement itself.
void writePostInstructionInfo(const FunctionBehaviorConstRef fun_behavior, const vertex) override
Write extra information on the given statement vertex, after the statement itself.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94

Generated on Mon Feb 12 2024 13:02:51 for PandA-2024.02 by doxygen 1.8.13