63 const DesignFlowManagerConstRef _design_flow_manager)
65 TM(_HLSMgr->get_tree_manager()),
66 Discr(HLSMgr->RDiscr),
67 present_state_name(static_cast<
HDLWriter_Language>(_parameters->getOption<unsigned int>(OPT_writer_language)) ==
73 "Step " +
STR(__PRETTY_FUNCTION__) +
" should not be added without discrepancy");
91 switch(relationship_type)
118 for(
const unsigned int fun_id : reached_body_fun_ids)
123 const auto* fu_dec = GetPointer<const function_decl>(fun_decl_node);
124 for(
const auto& parm_decl_node : fu_dec->list_of_args)
127 parm_decl_node->ToString() +
" is of kind " +
tree_node::GetString(parm_decl_node->get_kind()));
130 address_parameters[fun_id].insert(
GET_NODE(parm_decl_node));
143 const auto* g_as_node = GetPointer<const gimple_assign>(tn);
146 if(ssa_node->get_kind() != ssa_name_K)
157 const auto rhs_kind = rhs->
get_kind();
165 THROW_ASSERT(rhs_kind != component_ref_K and rhs_kind != array_ref_K and rhs_kind != target_mem_ref_K and
166 rhs_kind != target_mem_ref461_K,
167 "unexpected tree_node");
168 if(rhs_kind == mem_ref_K)
170 if(not
parameters->isOption(OPT_discrepancy_no_load_pointers) or
171 not
parameters->getOption<
bool>(OPT_discrepancy_no_load_pointers))
173 Discr->address_ssa.insert(ssa_node);
182 if(rhs_kind == call_expr_K || rhs_kind == aggr_init_expr_K)
188 "call id " +
STR(tn->
index) +
" does not call any function");
189 for(
unsigned int i : call_id_to_called_id.at(tn->
index))
191 if(addr_fun_ids.find(i) != addr_fun_ids.end())
193 Discr->address_ssa.insert(ssa_node);
202 unsigned int rhs_type_index;
203 if(rhs_kind == nop_expr_K)
205 const auto* nop = GetPointer<const nop_expr>(rhs);
208 else if(rhs_kind == convert_expr_K)
210 const auto* convert = GetPointer<const convert_expr>(rhs);
213 else if(rhs_kind == view_convert_expr_K)
215 const auto* view_convert = GetPointer<const view_convert_expr>(rhs);
225 Discr->address_ssa.insert(ssa_node);
238 const auto is_address = [&address_ssa](
const std::pair<tree_nodeRef, unsigned int>& p) ->
bool {
239 return (
GET_NODE(p.first)->get_kind() == addr_expr_K) or
240 (address_ssa.find(
GET_NODE(p.first)) != address_ssa.end());
242 if(std::find_if(phi_it, phi_end, is_address) != phi_end)
254 for(
const auto fid : reached_body_fun_ids)
260 for(boost::tie(vi, vi_end) = boost::vertices(*op_graph); vi != vi_end; vi++)
262 const unsigned int st_tn_id = op_graph->
CGetOpNodeInfo(*vi)->GetNodeId();
269 const unsigned int assigned_tree_node_id =
HLSMgr->get_produced_value(fid, *vi);
270 if(assigned_tree_node_id == 0)
274 const tree_nodeRef assigned_ssa_tree_node =
TM->get_tree_node_const(assigned_tree_node_id);
275 if(assigned_ssa_tree_node->
get_kind() != ssa_name_K)
285 const auto* ssa = GetPointer<const ssa_name>(assigned_ssa_tree_node);
286 if(ssa->CGetUseStmts().empty())
288 Discr->ssa_to_skip.insert(assigned_ssa_tree_node);
291 Discr->address_ssa.insert(assigned_ssa_tree_node);
311 Discr->address_ssa.insert(assigned_ssa_tree_node);
314 if(curr_tn->
get_kind() == gimple_assign_K)
318 else if(curr_tn->
get_kind() == gimple_phi_K)
330 auto ssause_it = used_ssa.begin();
331 const auto ssause_end = used_ssa.end();
332 for(; ssause_it != ssause_end; ++ssause_it)
334 THROW_ASSERT(ssause_it->first->get_kind() == tree_reindex_K,
335 ssause_it->first->ToString() +
" is of kind " +
tree_node::GetString(ssause_it->first->get_kind()));
337 const auto* ssa = GetPointer<const ssa_name>(ssa_node);
344 if(address_parameters.find(ssa->var) != address_parameters.end())
346 const auto def = ssa->CGetDefStmts();
348 if(def.size() == 1 and ((
GET_NODE((*def.begin()))->get_kind() == gimple_nop_K) or ssa->volatile_flag))
350 Discr->address_ssa.insert(ssa_node);
351 Discr->ssa_to_skip.insert(ssa_node);
362 for(
const auto fid : reached_body_fun_ids)
365 bool has_addr_param = (addrp_it != address_parameters.end());
366 if(not has_addr_param)
374 for(boost::tie(vi, vi_end) = boost::vertices(*op_graph); vi != vi_end; vi++)
377 const unsigned int st_tn_id = op_info->GetNodeId();
384 if(curr_tn->
get_kind() == gimple_assign_K)
386 const auto* g_as_node = GetPointer<const gimple_assign>(curr_tn);
405 if(tn->
get_kind() == gimple_assign_K)
407 const auto* g_as_node = GetPointer<const gimple_assign>(tn);
414 if(ssa_node->get_kind() == ssa_name_K)
417 const auto rhs_kind = rhs->
get_kind();
419 const bool rhs_is_comparison = rhs_kind == lt_expr_K || rhs_kind == le_expr_K || rhs_kind == gt_expr_K ||
420 rhs_kind == ge_expr_K || rhs_kind == eq_expr_K || rhs_kind == ne_expr_K ||
421 rhs_kind == unordered_expr_K || rhs_kind == ordered_expr_K ||
422 rhs_kind == unlt_expr_K || rhs_kind == unle_expr_K || rhs_kind == ungt_expr_K ||
423 rhs_kind == unge_expr_K || rhs_kind == uneq_expr_K || rhs_kind == ltgt_expr_K;
425 bool is_a_vector_bitfield =
false;
426 if(rhs_kind == bit_field_ref_K)
428 const auto* bfr = GetPointer<const bit_field_ref>(rhs);
431 is_a_vector_bitfield =
true;
435 bool rhs_is_load_candidate =
436 (rhs_kind == bit_field_ref_K && !is_a_vector_bitfield) || rhs_kind == component_ref_K ||
437 rhs_kind == indirect_ref_K || rhs_kind == misaligned_indirect_ref_K || rhs_kind == mem_ref_K ||
438 rhs_kind == array_ref_K || rhs_kind == target_mem_ref_K ||
439 rhs_kind == target_mem_ref461_K ;
441 if(rhs_kind == view_convert_expr_K)
443 const auto* vc = GetPointer<const view_convert_expr>(rhs);
445 if(vc_kind == record_type_K || vc_kind == union_type_K)
447 rhs_is_load_candidate =
true;
449 if(vc_kind == array_type_K && ssa_node->get_kind() == vector_type_K)
451 rhs_is_load_candidate =
true;
455 if((not rhs_is_comparison) and (not rhs_is_load_candidate) and not(rhs_kind == call_expr_K))
457 Discr->address_ssa.insert(ssa_node);
461 else if(tn->
get_kind() == gimple_phi_K)
467 const auto is_address = [&address_ssa](
const std::pair<tree_nodeRef, unsigned int>& p) ->
bool {
468 return (
GET_NODE(p.first)->get_kind() == addr_expr_K) or
469 (address_ssa.find(
GET_NODE(p.first)) != address_ssa.end());
471 if(std::find_if(phi_it, phi_end, is_address) != phi_end)
483 size_t previous_address_ssa_size;
486 previous_address_ssa_size =
static_cast<size_t>(
Discr->address_ssa.size());
487 for(
const auto& addr :
Discr->address_ssa)
491 for(
const auto& stmt_using_ssa : GetPointer<const ssa_name>(addr)->CGetUseStmts())
496 }
while(previous_address_ssa_size != static_cast<size_t>(
Discr->address_ssa.size()));
503 for(
const unsigned int i : reached_body_functions)
505 if(addr_fun_ids.find(i) != addr_fun_ids.end())
514 const vertex& op = boost::source(edge, *op_graph);
515 const unsigned int node_id = op_graph->
CGetOpNodeInfo(op)->GetNodeId();
521 if(tn->
get_kind() == gimple_return_K)
523 const auto* gr = GetPointer<const gimple_return>(tn);
525 ((
GET_NODE(gr->op)->get_kind() == ssa_name_K) &&
528 addr_fun_ids.insert(i);
552 for(
const unsigned int caller_fun_id : reached_body_functions)
557 THROW_ASSERT(fu_id_to_call_ids.find(caller_fun_id) != fu_id_to_call_ids.end(),
558 "caller_id = " +
STR(caller_fun_id));
559 for(
const unsigned int callid : fu_id_to_call_ids.at(caller_fun_id))
561 THROW_ASSERT(call_id_to_called_id.find(callid) != call_id_to_called_id.end(),
"callid = " +
STR(callid));
562 for(
const unsigned int called_id : call_id_to_called_id.at(callid))
570 THROW_ASSERT(
HLSMgr->CGetFunctionBehavior(called_id)->CGetBehavioralHelper()->get_function_name() ==
572 "artificial calls to " +
573 HLSMgr->CGetFunctionBehavior(called_id)->CGetBehavioralHelper()->get_function_name() +
574 " should not happen");
585 if(call_node->
get_kind() == gimple_assign_K)
587 const auto* g_as = GetPointer<const gimple_assign>(call_node);
590 if(ssa_node->get_kind() == ssa_name_K and
596 if(addr_fun_ids.find(called_id) != addr_fun_ids.end())
598 Discr->address_ssa.insert(ssa_node);
608 Discr->ssa_to_skip.insert(ssa_node);
629 THROW_WARNING(
"cannot find call for interprocedural address propagation:\n\t" 643 STR(callid) +
"\ncall was probably removed by dead code elimination\n");
652 if(callopinfo->called.size() == 0)
657 "call id " +
STR(callid) +
" called.size() = " +
STR(callopinfo->called.size()));
670 const unsigned int direct_called_id = *callopinfo->called.begin();
673 const auto* direct_fu_dec = GetPointer<const function_decl>(direct_called_fun_decl_node);
676 const auto* fu_dec = GetPointer<const function_decl>(called_fun_decl_node);
677 std::list<unsigned int>::const_iterator par_id_it, par_id_end;
678 if(called_id == direct_called_id)
682 fu_dec->list_of_args.size() == callopinfo->actual_parameters.size() or
683 callopinfo->actual_parameters.empty(),
684 "fun decl " +
STR(called_fun_decl_node->index) +
687 STR(callid) +
", called id " +
STR(called_id) +
689 "list_of_args.size() = " +
690 STR(fu_dec->list_of_args.size()) +
692 "actual_parameters.size() = " +
693 STR(callopinfo->actual_parameters.size()) +
"\n");
694 par_id_it = callopinfo->actual_parameters.cbegin();
695 par_id_end = callopinfo->actual_parameters.cend();
701 GetPointer<const identifier_node>(
GET_NODE(direct_fu_dec->name))->strg +
702 " called_id=" +
STR(called_id) +
" direct_called_id=" +
STR(direct_called_id));
703 THROW_ASSERT(callopinfo->actual_parameters.size() == fu_dec->list_of_args.size() + 2 or
704 callopinfo->actual_parameters.size() == fu_dec->list_of_args.size() + 3,
705 "fun decl " +
STR(called_fun_decl_node->index) +
708 STR(callid) +
", called id " +
STR(called_id) +
710 "list_of_args.size() = " +
711 STR(fu_dec->list_of_args.size()) +
713 "actual_parameters.size() = " +
714 STR(callopinfo->actual_parameters.size()) +
"\n");
715 par_id_it = std::next(callopinfo->actual_parameters.cbegin(), 2);
716 par_id_end = par_id_it;
717 std::advance(par_id_end, fu_dec->list_of_args.size());
719 auto par_decl_it = fu_dec->list_of_args.cbegin();
720 const auto par_decl_end = fu_dec->list_of_args.cend();
721 for(; (par_id_it != par_id_end) and (par_decl_it != par_decl_end); ++par_id_it, ++par_decl_it)
724 if(ssa_node->
get_kind() == ssa_name_K)
726 if(
Discr->address_ssa.find(ssa_node) !=
Discr->address_ssa.end())
733 address_parameters[called_id].insert(
GET_NODE(*par_decl_it));
754 const auto reached_body_fun_ids = CGMan->GetReachedBodyFunctions();
755 for(
auto f_id : reached_body_fun_ids)
762 addr_fun_ids.insert(f_id);
787 size_t previous_address_ssa_n;
790 previous_address_ssa_n =
static_cast<size_t>(
Discr->address_ssa.size());
798 call_id_to_called_id);
803 }
while(previous_address_ssa_n != static_cast<size_t>(
Discr->address_ssa.size()));
810 const auto& fun_with_body =
HLSMgr->CGetCallGraphManager()->GetReachedBodyFunctions();
811 for(
const unsigned int f_id : fun_with_body)
813 const auto FB =
HLSMgr->CGetFunctionBehavior(f_id);
818 if(!FB->CGetBehavioralHelper()->has_implementation() ||
819 !FB->CGetBehavioralHelper()->function_has_to_be_printed(f_id))
823 fun_id_to_sig_names[f_id];
826 const auto& fu_bind =
HLSMgr->get_HLS(f_id)->Rfu;
827 const auto& alloc_info =
HLSMgr->get_HLS(f_id)->allocation_information;
830 for(boost::tie(op_vi, op_vi_end) = boost::vertices(*op_graph); op_vi != op_vi_end; op_vi++)
832 const auto op_node_id = op_graph->CGetOpNodeInfo(*op_vi)->GetNodeId();
837 const auto assigned_tree_node_id =
HLSMgr->get_produced_value(f_id, *op_vi);
838 if(assigned_tree_node_id == 0)
842 const auto assigned_var_tree_node =
TM->GetTreeNode(assigned_tree_node_id);
843 if(assigned_var_tree_node->get_kind() != ssa_name_K ||
Discr->ssa_to_skip.count(assigned_var_tree_node))
847 const auto op_node =
TM->CGetTreeNode(op_node_id);
848 if(op_node->get_kind() == gimple_assign_K)
850 const auto fu_type_id = fu_bind->get_assign(*op_vi);
851 const auto fu_instance_id = fu_bind->get_index(*op_vi);
852 auto to_select =
"out_" + fu_bind->get_fu_name(*op_vi) +
"_i" +
STR(fu_bind->get_index(*op_vi)) +
"_";
854 if(alloc_info->is_direct_access_memory_unit(fu_type_id) && alloc_info->is_memory_unit(fu_type_id))
856 to_select +=
"array_" +
STR(alloc_info->get_memory_var(fu_type_id)) +
"_" +
857 STR(fu_bind->get_index(*op_vi) / alloc_info->get_number_channels(fu_type_id));
859 else if((alloc_info->is_direct_proxy_memory_unit(fu_type_id)) ||
860 alloc_info->is_indirect_access_memory_unit(fu_type_id))
862 to_select += fu_bind->get_fu_name(*op_vi) +
"_i" +
863 STR(fu_bind->get_index(*op_vi) / alloc_info->get_number_channels(fu_type_id));
865 else if(alloc_info->is_proxy_wrapped_unit(fu_type_id))
867 const auto fu_unit_name = fu_bind->get_fu_name(*op_vi);
870 to_select += alloc_info->get_fu_name(fu_type_id).first.substr(
sizeof(
WRAPPED_PROXY_PREFIX) - 1);
874 to_select += fu_unit_name;
876 to_select +=
"_instance";
878 else if(alloc_info->get_number_channels(fu_type_id) > 0)
880 to_select += fu_bind->get_fu_name(*op_vi) +
"_i" +
881 STR(fu_bind->get_index(*op_vi) / alloc_info->get_number_channels(fu_type_id));
883 else if(fu_bind->get_operations(fu_type_id, fu_instance_id).size() == 1)
885 to_select +=
"fu_" +
GET_NAME(op_graph, *op_vi);
889 to_select += fu_bind->get_fu_name(*op_vi) +
"_i" +
STR(fu_bind->get_index(*op_vi));
891 Discr->opid_to_outsignal[op_node_id] = to_select;
892 fun_id_to_sig_names[f_id].insert(to_select);
894 else if(op_node->get_kind() == gimple_phi_K)
896 const auto phi = GetPointerS<const gimple_phi>(op_node);
897 if(!
phi->virtual_flag)
899 const auto& storage_val_info =
HLSMgr->get_HLS(f_id)->storage_value_information;
900 THROW_ASSERT(storage_val_info->is_a_storage_value(
nullptr, assigned_tree_node_id),
902 HLSMgr->CGetFunctionBehavior(f_id)->CGetBehavioralHelper()->PrintVariable(
903 assigned_tree_node_id) +
904 " with tree node index " +
STR(assigned_tree_node_id) +
" has to be a storage value");
905 const auto storage_index = storage_val_info->get_storage_value_index(
nullptr, assigned_tree_node_id);
906 const auto& regbind =
HLSMgr->get_HLS(f_id)->Rreg;
907 const auto reg_name = regbind->
get(regbind->get_register(storage_index))->get_string();
908 const auto reg_outsig_name =
"out_" + reg_name +
"_" + reg_name;
909 fun_id_to_sig_names[f_id].insert(reg_outsig_name);
910 Discr->opid_to_outsignal[op_node_id] = reg_outsig_name;
911 const auto reg_wrenable_sig_name =
"wrenable_" + reg_name;
912 fun_id_to_sig_names[f_id].insert(reg_wrenable_sig_name);
935 for(
const auto& vs :
Discr->unfolded_v_to_scope)
937 const unsigned int f_id = Cget_node_info<UnfoldedFunctionInfo>(vs.first,
Discr->DiscrepancyCallGraph)->f_id;
939 Cget_node_info<UnfoldedFunctionInfo>(vs.first,
Discr->DiscrepancyCallGraph)->behavior->CGetBehavioralHelper();
940 if(not BH->has_implementation() or not BH->function_has_to_be_printed(f_id))
944 const std::string& scope = vs.second;
945 auto& datapath_scope =
Discr->selected_vcd_signals[scope + datapath_str];
946 auto& controller_scope =
Discr->selected_vcd_signals[scope + controller_str];
947 THROW_ASSERT(not controller_scope.empty() or datapath_scope.empty(),
948 "controller_scope size " +
STR(controller_scope.size()) +
" datapath_scope size " +
949 STR(datapath_scope.size()));
950 if(not controller_scope.empty())
959 if(vs.first ==
Discr->unfolded_root_v)
970 if(
parameters->isOption(OPT_discrepancy_only))
973 std::string fu_name = BH->get_function_name();
974 if(not discrepancy_functions.empty() and discrepancy_functions.find(fu_name) == discrepancy_functions.end())
980 THROW_ASSERT(fun_ids_to_local_sig_names.find(f_id) != fun_ids_to_local_sig_names.end(),
"f_id = " +
STR(f_id));
981 for(
const auto& local_sig_name : fun_ids_to_local_sig_names.at(f_id))
983 datapath_scope.insert(local_sig_name);
990 for(
const auto& sig_scope :
Discr->selected_vcd_signals)
992 for(
const auto& sig_name : sig_scope.second)
1002 for(
const auto& s :
Discr->address_ssa)
1004 const unsigned int ssa_index = s->index;
1005 const auto* ssa = GetPointer<const ssa_name>(s);
1010 if((ssa_base_index != 0 and
HLSMgr->Rmem->has_base_address(ssa_base_index)) or
1011 ssa->use_set->is_fully_resolved())
1022 "DISCREPANCY RESOLVED: " +
STR(fully_resolved_n) +
"/" +
STR(pointers_n));
#define GET_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
OpEdgeSet CGetInEdges(const vertex v) const
Return the edge ingoing in a vertex.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
const DefEdgeList & CGetDefEdgesList() const
Return the list of def edges.
void PropagateAddrSsa()
Propagates the information on the ssa representing addresses across all the ssa in the functions with...
Data structure representing the entire HLS information.
absl::node_hash_set< _Value, _Hash, _Pred, _Alloc > UnorderedSetStdStable
static unsigned int GetElements(const tree_managerConstRef &TM, const unsigned int index)
Given an array or a vector return the element type.
#define MEMCPY
constant string identifying the operation performed when two objects are memcopied.
#define PRINT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
std::string ToString() const
Print this node as string in gimple format.
#define DEBUG_LEVEL_PEDANTIC
very verbose debugging print is performed.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
std::string get_function_name() const
Return the name of the function.
const int output_level
The output level.
static bool is_real(const tree_managerConstRef &TM, const unsigned int index)
Return true if the treenode is of real type.
void SelectInternalSignals(CustomUnorderedMap< unsigned int, UnorderedSetStdStable< std::string >> &fun_id_to_sig_names) const
RelationshipType
The relationship type.
Source must be executed to satisfy target.
#define INDENT_OUT_MEX(outLevel, curOutLevel, mex)
~VcdSignalSelection() override
Destructor.
static std::string GetString(const enum kind k)
Given a kind, return the corresponding string.
#define GET_NAME(data, vertex_index)
Helper macro returning the name associated with a node.
virtual bool is_var_args() const
Returns true if this function is of var args type.
#define BUILTIN_WAIT_CALL
constant defining the builtin wait call intrinsic function
#define GET_INDEX_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
VcdSignalSelection(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
static unsigned int get_type_index(const tree_managerConstRef &TM, const unsigned int index, long long int &vec_size, bool &is_a_pointer, bool &is_a_function)
Return the treenode index of the type of index.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
Include a set of utilities used to manage CPU time measures.
bool has_implementation() const
Return true if function has implementation.
tree_nodeRef res
res is the new SSA_NAME node created by the PHI node.
virtual enum kind get_kind() const =0
Virtual function returning the type of the actual class.
#define THROW_WARNING(str_expr)
helper function used to throw a warning in a standard way: though it uses PRINT_DBG_MEX, the debug level used is such that the message is always printed
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
Base class for all resources into datapath.
#define CLOCK_PORT_NAME
standard name for ports
virtual bool is_operating_system_function(const unsigned int obj) const
Return true if function is an operating system function.
const OpNodeInfoConstRef CGetOpNodeInfo(const vertex node) const
Returns the info associated with a node.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
bool starts_with(const std::string &str, const std::string &pattern)
void SingleStepPropagateAddrSsa(const tree_nodeRef &curr_tn)
Single step used in the loop of PropagateAddrSsa()
This struct specifies the gimple_phi node.
Data structure used to store the register binding of variables.
#define EXIT_ID
constant used to represent tree node index of exit operation
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
bool IsAddressType(const unsigned int type_index) const
Checks if type_index represents an address type.
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
Class specification of the data structures used to manage technology information. ...
void DetectInvalidReturns(const CustomOrderedSet< unsigned int > &reached_body_functions, CustomUnorderedSet< unsigned int > &addr_fun_ids)
Detects return statements resulting in values to be skipped in the discrepancy analysis.
unsigned int GetFunctionReturnType(unsigned int function) const
Return the index associated with the type of the return of the function.
const unsigned int index
Represent the index read from the raw file and the index-1 of the vector of tree_node associated to t...
Target must be reexecuted.
const OpGraphInfoConstRef CGetOpGraphInfo() const
Returns the property associated with the graph.
void SelectInitialAddrParam(const CustomOrderedSet< unsigned int > &reached_body_fun_ids, CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters)
Selects the initial set of function parameters to skip, iterating on the reached functions with a bod...
std::string present_state_name
The name of the present state signal.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
#define GET_CONST_NODE(t)
const BehavioralHelperConstRef CGetBehavioralHelper() const
Returns the helper associated with the function.
boost::graph_traits< graph >::vertex_iterator VertexIterator
vertex_iterator definition.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
bool function_has_to_be_printed(unsigned int f_id) const
returns true if the function body has to be printed by the C backend
void SingleStepPropagateParamToSsa(const TreeNodeMap< size_t > &used_ssa, const TreeNodeSet &address_parameters)
Single step used in the loop of PropagateAddrParamToSsa()
static bool is_a_pointer(const tree_managerConstRef &TM, const unsigned int index)
Return if treenode index is a pointer.
#define WRAPPED_PROXY_PREFIX
#define HIERARCHY_SEPARATOR
This file collects some utility functions.
void CrossPropagateAddrSsa(CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters, const CustomOrderedSet< unsigned int > &reached_body_functions, const CustomUnorderedSet< unsigned int > &addr_fun_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &fu_id_to_call_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id)
Propagates the information on the parameters to skip across function calls.
const DiscrepancyRef Discr
void PropagateAddrParamToSsa(const CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters, const CustomOrderedSet< unsigned int > &reached_body_fun_ids)
Propagates the information on the ssa to skip to all the ssa in the functions with body...
void SelectAddrSsa(const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &fu_id_to_call_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id)
Compute the ssa representing address values.
This class describes all classes used to represent a structural object.
Class specification of the tree_reindex support class.
#define ENTRY_ID
constant used to represent tree node index of entry operation
Data structure used to store the functional-unit binding of the vertexes.
const OpGraphConstRef CGetOpGraph(FunctionBehavior::graph_type gt) const
This method returns the operation graphs.
void InProcedurePropagateAddr(const CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters, const CustomOrderedSet< unsigned int > &reached_body_functions, CustomUnorderedSet< unsigned int > &addr_fun_ids)
Propagates the information on the ssa to skip to all the ssa in the functions with body...
static bool is_a_complex(const tree_managerConstRef &TM, const unsigned int index)
Return if treenode index is a complex.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
static tree_nodeConstRef CGetType(const tree_nodeConstRef &node)
Return the treenode of the type of node.
DesignFlowStep_Status Exec() override
Executes the step.
this class is used to manage the command-line or XML options.
static unsigned int get_base_index(const tree_managerConstRef &TM, const unsigned int index)
Retrun the base address of a memory access.
static bool is_a_vector(const tree_managerConstRef &TM, const unsigned int index)
Return true if the treenode index is a vector.
Control flow graph with feedback.
int debug_level
The debug level.
#define OUTPUT_LEVEL_VERBOSE
verbose debugging print is performed.
refcount< const HLSFlowStepSpecialization > HLSFlowStepSpecializationConstRef
const refcount definition of the class
void InitialPhiResIsAddress(const tree_nodeConstRef &tn)
Determines if the tree_node tn assigns an ssa_name representing an address.
Data structure definition for high-level synthesis flow.
static void ComputeSsaUses(const tree_nodeRef &, TreeNodeMap< size_t > &uses)
recursively compute the references to the ssa_name variables used in a statement
Datastructure to represent memory information in high-level synthesis.
void InitialSsaIsAddress(const tree_nodeConstRef &tn, const CustomUnorderedSet< unsigned int > &addr_fun_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id)
Determines if the tree_node tn assigns an ssa_name representing an address.
Class specification of the manager of the tree structures extracted from the raw file.
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.
A brief description of the C++ Header File.
static bool is_an_array(const tree_managerConstRef &TM, const unsigned int index)
Return if treenode index is an array or it is equivalent to an array (record recursively having a sin...
void SelectInitialSsa(const CustomOrderedSet< unsigned int > &reached_body_fun_ids, const CustomUnorderedSet< unsigned int > &addr_fun_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id)
Selects the initial set of ssa to skip, iterating on the reached functions with a body and inserting ...
boost::graph_traits< graph >::edge_descriptor EdgeDescriptor
edge definition.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...