PandA-2024.02
testbench_generation.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  */
41 #include "hls_step.hpp"
42 #include "refcount.hpp"
43 
44 #include <string>
45 #include <vector>
46 
47 class module;
52 
57 {
61  RETURN
62 };
63 
65 #if(__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
66  final
67 #endif
68  : public HLS_step
69 {
71 
73 
74  const module* mod;
75 
77  const std::string output_directory;
78 
79  const std::string c_testbench_basename;
80 
83 
90  bool printCacheStats(const module* rootMod) const;
91 
97  std::string write_verilator_testbench() const;
98 
100  ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override;
101 
102  void ComputeRelationships(DesignFlowStepSet& design_flow_step_set,
103  const DesignFlowStep::RelationshipType relationship_type) override;
104 
105  public:
113  const DesignFlowManagerConstRef design_flow_manager);
114 
115  void Initialize() override;
116 
117  bool HasToBeExecuted() const override;
118 
119  DesignFlowStep_Status Exec() override;
120 
121  static std::vector<std::string> print_var_init(const tree_managerConstRef TreeM, unsigned int var,
122  const memoryRef mem);
123 
124  static unsigned long long generate_init_file(const std::string& dat_filename, const tree_managerConstRef TreeM,
125  unsigned int var, const memoryRef mem);
126 };
void ComputeRelationships(DesignFlowStepSet &design_flow_step_set, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
const std::string c_testbench_basename
RelationshipType
The relationship type.
This class manages the tree structures extracted from the raw file.
static unsigned long long generate_init_file(const std::string &dat_filename, const tree_managerConstRef TreeM, unsigned int var, const memoryRef mem)
static std::vector< std::string > print_var_init(const tree_managerConstRef TreeM, unsigned int var, const memoryRef mem)
std::string hdl_testbench_basename
testbench basename
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
bool printCacheStats(const module *rootMod) const
This function takes care of printing cache hit/miss counters.
structural_objectRef cir
REF_FORWARD_DECL(language_writer)
const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
DesignFlowStep_Status Exec() override
Execute the step.
TestbenchGeneration(const ParameterConstRef parameters, const HLS_managerRef _HLSMgr, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
DesignFlowStep_Status
The status of a step.
const std::string output_directory
output directory
const language_writerRef writer
Template definition of refcount.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
HDL writer base class used to specify the interface of the different language writers.
std::string write_verilator_testbench() const
Write the verilator testbench.
CONSTREF_FORWARD_DECL(tree_manager)
This class describes a generic module.
TestbenchGeneration_MemoryType
Enum class used to specify which type of content has to be printed for memory initialization.
Base object for all the structural objects.

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