PandA-2024.02
HDL_manager.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  */
45 #ifndef HDL_MANAGER_HPP
46 #define HDL_MANAGER_HPP
47 
49 #include "config_HAVE_FLOPOCO.hpp"
50 
52 #include "design_flow_step.hpp"
53 
54 #include <list>
55 #include <ostream>
56 #include <string>
57 #include <vector>
58 
59 #include "refcount.hpp"
60 
74 enum class HDLWriter_Language;
76 
78 {
79  private:
82 
85 
87  const technology_managerConstRef TM;
88 
89 #if HAVE_FLOPOCO
90  const flopoco_wrapperRef flopo_wrap;
92 #endif
93 
96 
99 
101  const int debug_level;
102 
112  std::list<structural_objectRef>& list_of_com) const;
113 
117  std::string write_components(const std::string& filename, const HDLWriter_Language language,
118  const std::list<structural_objectRef>& components,
119  std::list<std::string>& aux_files) const;
120 
124  void write_components(const std::string& filename, const std::list<structural_objectRef>& components,
125  std::list<std::string>& hdl_files, std::list<std::string>& aux_files, bool tb);
126 
133  void write_module(const language_writerRef writer, const structural_objectRef cir,
134  std::list<std::string>& aux_files) const;
135 
140  void write_flopoco_module(const structural_objectRef& cir, std::list<std::string>& aux_files) const;
141 
148  void io_signal_fix_ith(const language_writerRef writer, const structural_objectRef po, bool& lspf) const;
149  void io_signal_fix_ith_vector(const language_writerRef writer, const structural_objectRef po, bool& lspf) const;
150 
155  bool is_fsm(const structural_objectRef& cir) const;
156 
163  void write_fsm(const language_writerRef writer, const structural_objectRef& cir, const std::string& fsm_desc) const;
164 
171  void write_behavioral(const language_writerRef writer, const structural_objectRef& cir,
172  const std::string& behav) const;
173 
174  public:
181  HDL_manager(const HLS_managerRef _HLSMgr, const generic_deviceRef device, const ParameterConstRef parameters);
182 
190  HDL_manager(const HLS_managerRef HLSMgr, const generic_deviceRef device, const structural_managerRef SM,
191  const ParameterConstRef parameters);
192 
196  ~HDL_manager();
197 
205  void hdl_gen(const std::string& filename, const std::list<structural_objectRef>& cirs,
206  std::list<std::string>& hdl_files, std::list<std::string>& aux_files, bool tb);
207 
211  static std::string convert_to_identifier(const language_writer* writer, const std::string& id);
212 
218  static std::string get_mod_typename(const language_writer* lan, const structural_objectRef& cir);
219 
220 #if HAVE_FLOPOCO
221 
224  const flopoco_wrapperRef get_flopocowrapper() const
225  {
226  return flopo_wrap;
227  }
228 #endif
229 };
232 #endif
generic device description
static std::string get_mod_typename(const language_writer *lan, const structural_objectRef &cir)
Returns the module typename taking into account even the flopoco customizations.
static std::string convert_to_identifier(const language_writer *writer, const std::string &id)
Converts a generic string to a language compliant identifier.
void write_fsm(const language_writerRef writer, const structural_objectRef &cir, const std::string &fsm_desc) const
Writes a mealy/moore finite state machine behavioral description.
void hdl_gen(const std::string &filename, const std::list< structural_objectRef > &cirs, std::list< std::string > &hdl_files, std::list< std::string > &aux_files, bool tb)
Generates HDL code.
HDL_manager(const HLS_managerRef _HLSMgr, const generic_deviceRef device, const ParameterConstRef parameters)
Constructor.
std::string filename
This class manages the circuit structures.
void write_flopoco_module(const structural_objectRef &cir, std::list< std::string > &aux_files) const
Writes the FloPoCo module description to a VHDL file.
~HDL_manager()
Destructor.
HDLWriter_Language
const int debug_level
The debug level.
void write_module(const language_writerRef writer, const structural_objectRef cir, std::list< std::string > &aux_files) const
Writes the module description.
Base class for step of design flow.
const HLS_managerRef HLSMgr
The high level synthesis manager.
Definition: HDL_manager.hpp:81
void get_post_order_structural_components(const structural_objectRef cir, std::list< structural_objectRef > &list_of_com) const
Returns the list of components that have a structural-based description.
This class manages the technology library structures.
bool is_fsm(const structural_objectRef &cir) const
Returns true if the module has a FSM description associated with, false otherwise.
const ParameterConstRef parameters
The set of input parameters.
Definition: HDL_manager.hpp:98
Template definition of refcount.
const generic_deviceRef device
reference to the target device
Definition: HDL_manager.hpp:84
Main class for wrapping the FloPoCo code generator.
void io_signal_fix_ith(const language_writerRef writer, const structural_objectRef po, bool &lspf) const
Writes signal port connection post fix.
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.
REF_FORWARD_DECL(HDL_manager)
const structural_managerRef SM
The structural manager containing top.
Definition: HDL_manager.hpp:95
const technology_managerConstRef TM
reference to the class containing all the technology information
Definition: HDL_manager.hpp:87
std::string write_components(const std::string &filename, const HDLWriter_Language language, const std::list< structural_objectRef > &components, std::list< std::string > &aux_files) const
Generates the HDL description for the given components in the specified language. ...
CONSTREF_FORWARD_DECL(technology_manager)
void write_behavioral(const language_writerRef writer, const structural_objectRef &cir, const std::string &behav) const
Writes the behavioral description associated with the component.
void io_signal_fix_ith_vector(const language_writerRef writer, const structural_objectRef po, bool &lspf) const
Base object for all the structural objects.

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