46 #ifndef HLS_CONSTRAINTS_HPP 47 #define HLS_CONSTRAINTS_HPP 65 #define ENCODE_FU_LIB(fu_name, library) ((fu_name) + ":" + (library)) 137 void set_number_fu(
const std::string& name,
const std::string& library,
146 unsigned int get_number_fu(
const std::string& name,
const std::string& library)
const;
153 unsigned int get_number_fu(
const std::string& combined)
const;
162 void bind_vertex_to_fu(
const std::string& vertex_name,
const std::string& fu_name,
const std::string& fu_library,
163 const unsigned int fu_index);
250 unsigned int number_fu,
bool forDump =
false);
260 const std::string& fu_library,
unsigned int fu_index);
274 void print(std::ostream& os)
const;
288 return std::string(
"HLS_constraints");
generic device description
unsigned int registers
Variable storing the number of registers.
std::string get_kind_text() const
definition of the get_kind_text method
bool has_binding_to_fu(const std::string &vertex_name) const
Binds a vertex to a functional unit.
void read_HLS_constraints_File(const std::string &f)
Reads an XML file describing the structural data structures.
CONSTREF_FORWARD_DECL(Parameter)
std::string get_function_name() const
Gets the name of the function which the constraints are associated with.
void set_max_registers(unsigned int n_resources)
Sets the number of registers present in the function.
void set_clock_period(double period)
Sets the clock period.
CustomOrderedMap< T, U > CustomMap
double get_clock_period_resource_fraction() const
Gets the resource fraction of the clock period.
void set_scheduling_priority(const std::string &vertex_name, int Priority)
Stores the priority value for an operation vertex.
void xload(const xml_element *Enode)
Loads a set of HLS constraints starting from an XML node.
void xwriteBindingConstraints(xml_element *Enode, const std::string &vertex_name, const std::string &fu_name, const std::string &fu_library, unsigned int fu_index)
Writes the binding constraints (i.e., functional unit, instance and library) associated with an opera...
redefinition of map to manage ordered/unordered structures
unsigned int get_number_fu(const std::string &name, const std::string &library) const
This method returns the maximum number of functional units available for the design.
void xwriteFUConstraints(xml_element *Enode, const std::string &fu_name, const std::string &fu_library, unsigned int number_fu, bool forDump=false)
Writes the constraints on the functional units.
void set_number_fu(const std::string &name, const std::string &library, unsigned int n_resources=std::numeric_limits< unsigned int >::max())
Sets the maximum number of resources available in the design.
CustomMap< std::string, std::pair< std::string, std::pair< std::string, unsigned int > > > binding_constraints
put into relation the vertex name with the functional unit, its library and the functional unit index...
double get_clock_period() const
Gets the clock period.
REF_FORWARD_DECL(HLS_constraints)
STD include.
void print(std::ostream &os) const
Function that prints the class HLS_constraints.
Data structure used to store all the HLS constraints.
void xwrite(xml_element *rootnode)
Writes the HLS constraints into an XML tree.
This wrapper collects all the methods used by the High-level synthesis classes to retrieve informatio...
friend std::ostream & operator<<(std::ostream &os, const HLS_constraints &s)
Friend definition of the << operator.
Template definition of refcount.
CustomMap< std::string, int > get_scheduling_priority() const
Returns the data structure containing scheduling priority constraints.
void write_HLS_constraints_File(const std::string &f)
Writes an XML file describing the high level synthesis constraints data structure.
unsigned int get_max_registers() const
Returns the number of registers available.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
void xwriteSchedulingConstraints(xml_element *Enode, const std::string &vertex_name, int priority)
Writes the scheduling constraints (i.e., priority value) associated with an operation.
void bind_vertex_to_fu(const std::string &vertex_name, const std::string &fu_name, const std::string &fu_library, const unsigned int fu_index)
Binds a vertex to a functional unit.
CustomMap< std::string, unsigned int > tech_constraints
For each functional unit tech_constraints stores the number of resources.
const ParameterConstRef parameters
The set of input parameters.
CustomMap< std::string, int > scheduling_constraints
map between an operation vertex and its given scheduling priority value
double clock_period_resource_fraction
current value of the resource fraction
std::string fun_name
name of the function which the constraints are associated with; emtpy string means that they are glob...
HLS_constraints(const ParameterConstRef &Param, std::string _fun_name)
Constructor.
void add_builtin_constraints()
Adds the builtin constraints.
double clock_period
Clock period in ns.
void xwriteHLSConstraints(xml_element *Enode, bool forDump=false)
Writes the generic synthesis constraints.