61 const DesignFlowManagerConstRef _design_flow_manager,
65 assignment_execution_time(0.0),
78 const double connection_time_ratio =
parameters->IsParameter(
"RelativeConnectionOffset") ?
79 parameters->GetParameter<
double>(
"RelativeConnectionOffset") :
87 for(
const auto& library : libraries)
91 for(
const auto& fu : fus)
94 auto single_fu = GetPointer<functional_unit>(fu.second);
99 auto template_name = single_fu->fu_template_name;
100 auto fu_name = single_fu->functional_unit_name;
104 if(fu_name ==
"ASSIGN_REAL_FU" || fu_name ==
"ASSIGN_SIGNED_FU" || fu_name ==
"ASSIGN_UNSIGNED_FU" ||
105 fu_name ==
"ASSIGN_VECTOR_BOOL_FU" || fu_name ==
"addr_expr_FU" ||
106 fu_name ==
"fp_view_convert_expr_FU" || fu_name ==
"ui_view_convert_expr_FU" ||
107 fu_name ==
"view_convert_expr_FU" || fu_name ==
"assert_expr_FU")
109 single_fu->area_m->set_area_value(1);
110 for(
const auto& op : single_fu->get_operations())
115 "---Fixing execution time of " + GetPointer<const operation>(op)->operation_name +
123 if(template_name ==
"rshift_expr_FU" || template_name ==
"ui_rshift_expr_FU" ||
124 template_name ==
"lshift_expr_FU" || template_name ==
"ui_lshift_expr_FU" ||
125 template_name ==
"ui_lrotate_expr_FU" || template_name ==
"ui_rrotate_expr_FU")
127 std::vector<std::string> template_parameters =
SplitString(single_fu->fu_template_parameters,
" ");
128 THROW_ASSERT(template_parameters.size() == 3, single_fu->fu_template_parameters);
129 if(template_parameters[1] ==
"0")
131 single_fu->area_m->set_area_value(1);
132 for(
const auto& op : single_fu->get_operations())
137 "---Fixing execution time of " +
138 GetPointer<const operation>(op)->operation_name +
" on " + fu.first);
146 if(template_name ==
"vec_rshift_expr_FU" || template_name ==
"ui_vec_rshift_expr_FU" ||
147 template_name ==
"vec1_rshift_expr_FU" || template_name ==
"ui_vec1_rshift_expr_FU" ||
148 template_name ==
"vec_lshift_expr_FU" || template_name ==
"ui_vec_lshift_expr_FU" ||
149 template_name ==
"vec1_lshift_expr_FU" || template_name ==
"ui_vec1_lshift_expr_FU")
151 std::vector<std::string> template_parameters =
SplitString(single_fu->fu_template_parameters,
" ");
152 THROW_ASSERT(template_parameters.size() >= 4, single_fu->fu_template_parameters);
153 if(template_parameters[2] ==
"0")
155 single_fu->area_m->set_area_value(1);
156 for(
const auto& op : single_fu->get_operations())
161 "---Fixing execution time of " +
162 GetPointer<const operation>(op)->operation_name +
" on " + fu.first);
170 if(fu_name ==
"IIdata_converter_FU" || fu_name ==
"UIdata_converter_FU" ||
171 fu_name ==
"IUdata_converter_FU" || fu_name ==
"UUdata_converter_FU" || fu_name ==
"IIconvert_expr_FU" ||
172 fu_name ==
"IUconvert_expr_FU" || fu_name ==
"UIconvert_expr_FU" || fu_name ==
"UUconvert_expr_FU")
174 single_fu->area_m->set_area_value(1);
175 for(
const auto& op : single_fu->get_operations())
180 "---Fixing execution time of " + GetPointer<const operation>(op)->operation_name +
188 if(template_name ==
"bit_and_expr_FU" || template_name ==
"ui_bit_and_expr_FU" ||
189 template_name ==
"bit_ior_expr_FU" || template_name ==
"ui_bit_ior_expr_FU")
191 std::vector<std::string> template_parameters =
SplitString(single_fu->fu_template_parameters,
" ");
192 THROW_ASSERT(template_parameters.size() == 3, single_fu->fu_template_parameters);
193 if(template_parameters[0] ==
"0" || template_parameters[1] ==
"0")
195 single_fu->area_m->set_area_value(1);
196 for(
const auto& op : single_fu->get_operations())
201 "---Fixing execution time of " +
202 GetPointer<const operation>(op)->operation_name +
" on " + fu.first);
210 if(template_name ==
"vec_bit_and_expr_FU" || template_name ==
"ui_vec_bit_and_expr_FU" ||
211 template_name ==
"vec_bit_ior_expr_FU" || template_name ==
"ui_vec_bit_ior_expr_FU")
213 std::vector<std::string> template_parameters =
SplitString(single_fu->fu_template_parameters,
" ");
214 THROW_ASSERT(template_parameters.size() >= 5, single_fu->fu_template_parameters);
215 if(template_parameters[0] ==
"0" || template_parameters[2] ==
"0")
217 single_fu->area_m->set_area_value(1);
218 for(
const auto& op : single_fu->get_operations())
223 "---Fixing execution time of " +
224 GetPointer<const operation>(op)->operation_name +
" on " + fu.first);
232 if(template_name ==
"cond_expr_FU" || template_name ==
"ui_cond_expr_FU" ||
233 template_name ==
"fp_cond_expr_FU")
235 std::vector<std::string> template_parameters =
SplitString(single_fu->fu_template_parameters,
" ");
236 THROW_ASSERT(template_parameters.size() == 4, single_fu->fu_template_parameters);
237 if(template_parameters[0] ==
"0")
239 single_fu->area_m->set_area_value(1);
240 for(
const auto& op : single_fu->get_operations())
245 "---Fixing execution time of " +
246 GetPointer<const operation>(op)->operation_name +
" on " + fu.first);
254 if(template_name ==
"vec_cond_expr_FU" || template_name ==
"ui_vec_cond_expr_FU")
256 std::vector<std::string> template_parameters =
SplitString(single_fu->fu_template_parameters,
" ");
257 THROW_ASSERT(template_parameters.size() >= 6, single_fu->fu_template_parameters);
258 if(template_parameters[0] ==
"0")
260 single_fu->area_m->set_area_value(1);
261 for(
const auto& op : single_fu->get_operations())
266 "---Fixing execution time of " +
267 GetPointer<const operation>(op)->operation_name +
" on " + fu.first);
275 if(template_name ==
"plus_expr_FU" or template_name ==
"ui_plus_expr_FU" or template_name ==
"minus_expr_FU" or template_name ==
"ui_minus_expr_FU")
278 std::vector<std::string> template_parameters =
SplitString(single_fu->fu_template_parameters,
" ");
279 const auto output_size = std::stoul(template_parameters.back());
283 for(
auto op : single_fu->get_operations())
288 (GetPointer<operation>(op))->time_m->set_execution_time(GetPointer<operation>(op)->time_m->get_execution_time() +
connection_time, 0);
294 if(template_name ==
"ternary_alu_expr_FU" or template_name ==
"ui_ternary_alu_expr_FU" or template_name ==
"ternary_mm_expr_FU" or template_name ==
"ui_ternary_mm_expr_FU" or template_name ==
"ternary_mp_expr_FU" or template_name ==
"ui_ternary_mp_expr_FU" or template_name ==
"ternary_pm_expr_FU" or template_name ==
"ui_ternary_pm_expr_FU" or template_name ==
"ternary_plus_expr_FU" or template_name ==
"ui_ternary_plus_expr_FU")
296 std::vector<std::string> template_parameters =
SplitString(single_fu->fu_template_parameters,
" ");
297 const auto output_size = std::stoul(template_parameters.back());
301 for(
auto op : single_fu->get_operations())
306 (GetPointer<operation>(op))->time_m->set_execution_time(GetPointer<operation>(op)->time_m->get_execution_time() +
connection_time, 0);
318 for(
const auto& library : libraries)
322 for(
const auto& fu : fus)
325 auto single_fu = GetPointer<functional_unit>(fu.second);
330 auto template_name = single_fu->fu_template_name;
334 if(template_name ==
"plus_expr_FU" or template_name ==
"ui_plus_expr_FU" or
335 template_name ==
"minus_expr_FU" or template_name ==
"ui_minus_expr_FU" or
336 template_name ==
"ternary_alu_expr_FU" or template_name ==
"ui_ternary_alu_expr_FU" or
337 template_name ==
"ternary_mm_expr_FU" or template_name ==
"ui_ternary_mm_expr_FU" or
338 template_name ==
"ternary_mp_expr_FU" or template_name ==
"ui_ternary_mp_expr_FU" or
339 template_name ==
"ternary_pm_expr_FU" or template_name ==
"ui_ternary_pm_expr_FU" or
340 template_name ==
"ternary_plus_expr_FU" or template_name ==
"ui_ternary_plus_expr_FU")
342 if(single_fu->fu_template_parameters.find(
" 0") != std::string::npos or
343 (single_fu->fu_template_parameters.size() >= 2 and
344 single_fu->fu_template_parameters.substr(0, 2) ==
"0 "))
347 std::vector<std::string> template_parameters =
SplitString(single_fu->fu_template_parameters,
" ");
348 const auto output_size = std::stoul(template_parameters.back());
349 std::string cell_name = template_name;
350 for(
const auto& template_parameter : template_parameters)
353 if(template_parameter ==
"0")
355 cell_name +=
STR(output_size);
359 cell_name += template_parameter;
363 THROW_ASSERT(nc_f_unit,
"Library miss component: " + std::string(cell_name));
365 for(
const auto& op : GetPointer<const functional_unit>(nc_f_unit)->get_operations())
367 non_constant_execution_times[op->get_name()] =
368 GetPointer<operation>(op)->time_m->get_execution_time();
370 for(
const auto& op : single_fu->get_operations())
372 const std::string operation_name = op->get_name();
373 THROW_ASSERT(non_constant_execution_times.find(operation_name) !=
374 non_constant_execution_times.end(),
376 const auto non_constant_execution_time = non_constant_execution_times.find(operation_name)->second;
377 GetPointer<operation>(op)->time_m->set_execution_time(non_constant_execution_time, 0);
393 switch(relationship_type)
415 return relationships;
#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;.
double connection_time
The estimated execution time of connection.
Collect information about resource area.
const CustomUnorderedSet< TechnologyFlowStep_Type > ComputeTechnologyRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
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.
DesignFlowStep_Status Exec() override
Execute the step.
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.
const std::vector< std::string > SplitString(const std::string &input, const std::string &separators)
Function which splits a string into tokens.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
const std::vector< std::string > & get_library_list() const
Return the list of the libraries.
double assignment_execution_time
The execution time of the assignment.
CustomOrderedMap< T, U > CustomMap
Collect information about resource performance.
FixCharacterization(const technology_managerRef TM, const generic_deviceRef target, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
Constructor.
Class specification of the manager of the technology library data structures.
Step to fix components characterization.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Class specification of the data structures used to manage technology information. ...
Target must be reexecuted.
redefinition of set to manage ordered/unordered structures
const technology_managerRef TM
The technology manager.
~FixCharacterization() override
Destructor.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
This file collects some utility functions and macros.
TimeStamp CGetSetupHoldTimeStamp() const
Return the characterization timestamp of the setup hold time.
this class is used to manage the command-line or XML options.
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
Generic device description.
Class specification of the manager for each library.
int debug_level
The debug level.
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.
TimeStamp assignment_characterization_timestamp
The timestamp of the assignment.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...