47 #include "config_HAVE_CIRCUIT_BUILT.hpp" 83 for(
const auto& cell : cells)
85 cell.second->print(os);
91 const std::string& Library)
const 98 return GetPointer<functional_unit>(node)->get_operation(op_name) ?
true :
false;
103 THROW_ASSERT(Library.size(),
"Library not specified for component " + fu_name);
129 const std::string& Library)
const 132 THROW_ASSERT(GetPointer<functional_unit>(node),
"Unit " + fu_name +
" not stored into library (" + Library +
")");
133 technology_nodeRef node_op = GetPointer<functional_unit>(node)->get_operation(op_name);
135 "Operation " + op_name +
" not stored into " + fu_name +
" library (" + Library +
")");
136 THROW_ASSERT(GetPointer<operation>(node_op)->time_m,
"Missing timing information");
137 return GetPointer<operation>(node_op)->time_m->get_initiation_time();
141 const std::string& Library)
const 144 THROW_ASSERT(GetPointer<functional_unit>(node),
"Unit " + fu_name +
" not stored into library (" + Library +
")");
145 technology_nodeRef node_op = GetPointer<functional_unit>(node)->get_operation(op_name);
147 "Operation " + op_name +
" not stored into " + fu_name +
" library (" + Library +
")");
148 THROW_ASSERT(GetPointer<operation>(node_op)->time_m,
"Missing timing information");
149 return GetPointer<operation>(node_op)->time_m->get_execution_time();
155 THROW_ASSERT(GetPointer<functional_unit>(node),
"Unit " + fu_name +
" not stored into library (" + Library +
")");
157 "Unit " + fu_name +
"(" + Library +
") does not store area model");
158 return GetPointer<functional_unit>(node)->area_m->get_area_value();
161 #if HAVE_CIRCUIT_BUILT 162 void technology_manager::add_resource(
const std::string& Library,
const std::string& fu_name,
169 GetPointer<functional_unit>(curr)->functional_unit_name = fu_name;
170 GetPointer<functional_unit>(curr)->CM = CM;
175 GetPointer<functional_unit>(curr)->CM = CM;
185 const std::string& operation_name)
188 THROW_ASSERT(
library_map.at(Library)->is_fu(fu_name),
"Unit \"" + fu_name +
"\" not found in library \"" + Library);
189 const auto curr =
get_fu(fu_name, Library);
191 GetPointerS<operation>(curr_op)->operation_name = operation_name;
192 auto fu = GetPointer<functional_unit>(curr);
219 std::map<unsigned int, std::string> info;
223 for(
const auto& iter : list)
225 const auto* Enode = GetPointer<const xml_element>(iter);
230 if(Enode->get_name() ==
"information")
233 if(Enode->get_name() ==
"library")
244 temp_libraries.insert(LM);
245 LM->
set_info(library_manager::XML,
"");
252 for(
const auto& fu : fus)
257 if(not GetPointer<const functional_unit>(
library_map[library_name]->
get_fu(fu.first)) or
258 GetPointer<const functional_unit>(
library_map[library_name]->get_fu(fu.first))
259 ->characterization_timestamp <=
260 GetPointer<const functional_unit>(fu.second)->characterization_timestamp)
264 "-->Updating " + fu.first +
265 (GetPointer<const functional_unit>(
library_map[library_name]->get_fu(fu.first)) ?
266 " characterized at " +
267 STR(GetPointer<const functional_unit>(fu.second)->characterization_timestamp) +
268 " - Previous characterization is at " +
270 ->characterization_timestamp) :
278 "-->Not updating " + fu.first +
279 (GetPointer<const functional_unit>(
library_map[library_name]->get_fu(fu.first)) ?
280 " characterized at " +
281 STR(GetPointer<const functional_unit>(fu.second)->characterization_timestamp) +
282 " - Previous characterization is at " +
284 ->characterization_timestamp) :
293 "-->Loading " + fu.first +
294 (GetPointer<const functional_unit>(fu.second) ?
295 " characterized at " +
296 STR(GetPointer<const functional_unit>(fu.second)->characterization_timestamp) :
306 for(
const auto& temp_library : temp_libraries)
308 for(
const auto& temp_info : info)
310 temp_library->set_info(temp_info.first, temp_info.second);
322 sorted_libraries.insert(library.first);
324 for(
const auto& library : sorted_libraries)
326 if(library ==
"design")
330 if(_libraries.empty() || _libraries.count(library))
386 return GetPointer<const functional_unit>(f_unit_as);
402 const auto op_ASSIGN = GetPointer<const operation>(op_as_node);
403 THROW_ASSERT(op_ASSIGN->time_m->get_execution_time() > 0.0,
"expected a setup time greater than zero");
404 return op_ASSIGN->time_m->get_execution_time();
423 return fu_it !=
function_fu.end() ? fu_it->second :
nullptr;
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
double CGetSetupHoldTime() const
Return the setup hold time.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
Collect information about resource area.
const fu_map_type & get_library_fu() const
Return the list of the resources contained into the given library.
File containing functions and utilities to support the printing of debug messagges.
technology_nodeRef get_fu(const std::string &fu_name, const std::string &Library) const
Return the reference to a component given its name.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
void xwrite(xml_element *rootnode, const CustomOrderedSet< std::string > &libraries=CustomOrderedSet< std::string >())
add library elements operation node to an xml tree.
void print(std::ostream &os) const
Function that prints the class technology_manager.
void set_info(unsigned int type, const std::string &information)
const ParameterConstRef Param
class containing all the parameters
Class specification of the graph structures.
exceptions managed by PandA
static void xload(const xml_element *node, const library_managerRef &LM, const ParameterConstRef &Param)
#define CG_LIBRARY
compound gates
void xwrite(xml_element *rootnode)
Collect information about resource performance.
~technology_manager()
Destructor.
Definition of hash function for EdgeDescriptor.
#define LIBRARY_STD_FU
standard library where all standard HLS resources are defined
Class specification of the manager of the technology library data structures.
This class specifies the characteristic of a particular functional unit.
void xload(const xml_element *node)
Load a technology manager from an xml file.
redefinition of map to manage ordered/unordered structures
TimeStamp characterization_timestamp
The timestamp of the characterization of this functional unit.
technology_nodeRef add_operation(const std::string &Library, const std::string &fu_name, const std::string &operation_name)
Add an operation to the specified functional unit.
refcount< technology_node > technology_nodeRef
refcount definition of the class
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
technology_manager(const ParameterConstRef Param)
Constructor.
static const unsigned int XML
#define DESIGN
Autoheader include.
CustomSet< std::string > builtins
The builtin components.
double get_area(const std::string &fu_name, const std::string &Library) const
Return the area for a given component.
void add(const technology_nodeRef curr, const std::string &Library)
Add the given functional_unit to the specified library.
This class specifies the characteristic of a particular operation working on a given functional unit...
Class specification of the data structures used to manage technology information. ...
int debug_level
The debug level for this class.
ControlStep get_initiation_time(const std::string &fu_name, const std::string &op_name, const std::string &Library) const
Return the initiation time for a given operation type and a given component.
bool IsBuiltin(const std::string &component_name) const
Return true if a component is builtin.
utility function used to read files.
This file collects some utility functions and macros.
std::list< xml_nodeRef > node_list
type for list of xml nodes
bool is_library_manager(const std::string &Name) const
Check if a library is contained into the data structure.
std::map< std::string, technology_nodeRef > fu_map_type
typedef for the identification of the functional units contained into the library ...
library_map_type library_map
map between library name and the corresponding data structure
const functional_unit * CGetSetupHoldFU() const
Return the functional unit used to compute the setup hold time.
std::vector< std::string > libraries
(reverse) ordered list of libraries; it gives a priority ordering for searching the nodes ...
This class manages the specific library structure.
CustomUnorderedMap< std::string, technology_nodeRef > function_fu
Map function names to hardware module used for implementation.
void erase_library(const std::string &Name)
Release the given library.
TimeStamp CGetSetupHoldTimeStamp() const
Return the characterization timestamp of the setup hold time.
technology_nodeRef GetFunctionFU(const std::string &fname) const
Return FU used to implement given function if any.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
this class is used to manage the command-line or XML options.
The type used for timestamp.
Some macro used to interface with the XML library.
node_list const & get_children()
Obtain the list of child nodes.
Class implementation of the structural_manager.
std::string get_library_name() const
Class specification of the manager for each library.
bool can_implement(const std::string &fu_name, const std::string &op_name, const std::string &Library) const
Check if an operation can be implemented by a given component in a given library. ...
double get_execution_time(const std::string &fu_name, const std::string &op_name, const std::string &Library) const
Return the execution time for a given operation type and a given component.
library_managerRef get_library_manager(const std::string &Name) const
Return the library data structure corresponding to the given library id.
std::string get_library(const std::string &Name) const
Return the higher priority library where the given component is stored.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...