62 #include "config_HAVE_ASSERTS.hpp" 64 #include <boost/algorithm/string/case_conv.hpp> 65 #include <boost/tokenizer.hpp> 76 #define MAX_METADATA_BITSIZE 10 79 #define FIXED_METADATA_SIZE 6 82 const DesignFlowManagerConstRef _design_flow_manager)
84 Discr(_HLSMgr->RDiscr),
85 present_state_name(static_cast<
HDLWriter_Language>(_parameters->getOption<unsigned int>(OPT_writer_language)) ==
97 switch(relationship_type)
101 ret.insert(std::make_tuple(
104 CBackendInformation::CB_DISCREPANCY_ANALYSIS,
105 parameters->getOption<std::string>(OPT_output_directory) +
"/simulation/discrepancy.c",
106 parameters->getOption<std::string>(OPT_output_directory) +
"/simulation/dynamic_discrepancy_stats")),
143 for(
const auto& fid2ctxtrace :
Discr->c_control_flow_trace)
145 const auto f_id = fid2ctxtrace.first;
148 for(
const auto& ctx2trace : fid2ctxtrace.second)
151 for(
const auto& bb_id : ctx2trace.second)
169 size_t min_memory_usage = 0;
170 size_t total_state_of_the_art_memory_usage = 0;
171 size_t total_state_of_the_art_fixed_memory_usage = 0;
172 size_t total_state_of_the_art_opt_memory_usage = 0;
173 for(
const auto& f :
Discr->c_control_flow_trace)
175 const auto f_id = f.first;
177 "-->Untangling software control flow trace of function: " +
STR(f_id) +
" " +
178 HLSMgr->CGetFunctionBehavior(f_id)->CGetBehavioralHelper()->get_function_name());
179 const auto& stg =
HLSMgr->get_HLS(f_id)->STG->CGetStg();
180 const auto& epp_stg =
HLSMgr->get_HLS(f_id)->STG->CGetEPPStg();
181 const auto& stg_info = stg->CGetStateTransitionGraphInfo();
182 const auto fsm_entry_node = stg_info->entry_node;
183 const auto fsm_exit_node = stg_info->exit_node;
184 const auto& state_id_to_check =
Discr->hw_discrepancy_info->fu_id_to_states_to_check.at(f_id);
186 const auto& state_id_to_check_on_feedback =
187 Discr->hw_discrepancy_info->fu_id_to_feedback_states_to_check.at(f_id);
188 const auto& reset_transitions =
Discr->hw_discrepancy_info->fu_id_to_reset_edges.at(f_id);
191 for(
auto& context2trace : f.second)
193 const auto context_id = context2trace.first;
195 const auto& scope =
Discr->context_to_scope.at(context_id);
196 scope_to_function_id[scope] = f_id;
199 size_t epp_counter = 0;
200 vertex current_state = fsm_entry_node;
201 bool takes_feedback_edge =
false;
208 THROW_ASSERT(boost::out_degree(current_state, *stg) == 1,
209 "entry state has out degree = " +
STR(boost::out_degree(current_state, *stg)));
212 boost::tie(out_edge, out_end) = boost::out_edges(current_state, *stg);
214 THROW_ASSERT(reset_transitions.find(taken_edge) == reset_transitions.cend(),
"");
216 const auto taken_edge_info = stg->CGetTransitionInfo(taken_edge);
217 epp_counter += taken_edge_info->get_epp_increment();
222 THROW_ASSERT(state_id_to_check_on_feedback.find(stg_info->vertex_to_state_id.at(current_state)) ==
223 state_id_to_check_on_feedback.cend(),
226 if(
HLSMgr->get_HLS(f_id)->registered_inputs)
236 THROW_ASSERT(boost::out_degree(current_state, *stg) == 1,
237 "registered input state has out degree = " +
STR(boost::out_degree(current_state, *stg)));
239 state_id_to_check.find(stg_info->vertex_to_state_id.at(current_state)) == state_id_to_check.cend(),
"");
242 boost::tie(out_edge, out_end) = boost::out_edges(current_state, *stg);
244 THROW_ASSERT(reset_transitions.find(taken_edge) == reset_transitions.cend(),
"");
246 const auto taken_edge_info = stg->CGetTransitionInfo(taken_edge);
247 epp_counter += taken_edge_info->get_epp_increment();
252 const auto next_state_id = stg_info->vertex_to_state_id.at(current_state);
253 scope_to_state_trace[scope].push_back(next_state_id);
254 THROW_ASSERT(state_id_to_check_on_feedback.find(next_state_id) == state_id_to_check_on_feedback.cend(),
"");
256 const std::list<unsigned int>& bb_trace = context2trace.second;
257 auto bb_id_it = bb_trace.cbegin();
258 const auto bb_id_end = bb_trace.cend();
259 for(; bb_id_it != bb_id_end; bb_id_it++)
261 const auto bb_id = *bb_id_it;
268 bool goes_to_next_bb_execution =
false;
272 const auto cur_state_id = stg_info->vertex_to_state_id.at(current_state);
275 if(not takes_feedback_edge and state_id_to_check.find(cur_state_id) != state_id_to_check.cend())
277 scope_to_epp_trace[scope].push_back(epp_counter);
281 bool found_valid_next_state =
false;
282 bool end_of_bb_execution =
false;
283 takes_feedback_edge =
false;
284 vertex next_state =
nullptr;
287 BOOST_FOREACH(
const EdgeDescriptor e, boost::out_edges(current_state, *stg))
290 const auto dst_info = stg->CGetStateInfo(dst);
293 "---analyzing next state: " +
294 ((dst == fsm_exit_node) ?
STR(
"EXIT") :
STR(stg_info->vertex_to_state_id.at(dst))) +
295 " in the same BB " +
STR(bb_id));
296 if((not dst_info->is_dummy) and (*dst_info->BB_ids.begin() == bb_id))
298 if(not(stg->GetSelector(e) & TransitionInfo::StateTransitionType::ST_EDGE_FEEDBACK))
301 "two neighbors of state S_" +
STR(stg_info->vertex_to_state_id.at(current_state)) +
302 " have the same BB id = " +
STR(bb_id));
303 found_valid_next_state =
true;
307 "---FOUND next state: " +
STR(stg_info->vertex_to_state_id.at(next_state)) +
308 " in the same BB " +
STR(bb_id));
311 else if(dst_info->is_dummy)
313 scope_to_state_trace[scope].push_back(stg_info->vertex_to_state_id.at(dst));
317 if(not found_valid_next_state)
319 if(std::next(bb_id_it) != bb_id_end)
322 const auto next_bb_id = *std::next(bb_id_it);
324 BOOST_FOREACH(
const EdgeDescriptor e, boost::out_edges(current_state, *stg))
327 const auto dst_info = stg->CGetStateInfo(dst);
328 if((not dst_info->is_dummy) and (*dst_info->BB_ids.begin() == next_bb_id))
331 "two neighbors of state S_" +
332 STR(stg_info->vertex_to_state_id.at(current_state)) +
333 " have the same BB id = " +
STR(next_bb_id));
335 found_valid_next_state =
true;
337 end_of_bb_execution =
true;
341 "---FOUND next state: " +
STR(stg_info->vertex_to_state_id.at(next_state)) +
342 " in new BB " +
STR(next_bb_id));
343 if(stg->GetSelector(taken_edge) & TransitionInfo::StateTransitionType::ST_EDGE_FEEDBACK)
345 takes_feedback_edge =
true;
348 else if(dst_info->is_dummy)
350 scope_to_state_trace[scope].push_back(stg_info->vertex_to_state_id.at(dst));
358 BOOST_FOREACH(
const EdgeDescriptor e, boost::out_edges(current_state, *stg))
361 if(dst == fsm_exit_node)
364 found_valid_next_state =
true;
366 end_of_bb_execution =
true;
375 THROW_ASSERT(found_valid_next_state,
"next valid state not found");
376 THROW_ASSERT(takes_feedback_edge == (reset_transitions.find(taken_edge) != reset_transitions.cend()),
378 if(next_state != fsm_exit_node)
380 const auto next_state_id = stg_info->vertex_to_state_id.at(next_state);
381 scope_to_state_trace[scope].push_back(next_state_id);
382 THROW_ASSERT((not takes_feedback_edge) or (state_id_to_check_on_feedback.find(next_state_id) !=
383 state_id_to_check_on_feedback.cend()),
386 const auto taken_edge_info = epp_stg->CGetTransitionInfo(taken_edge);
387 epp_counter += taken_edge_info->get_epp_increment();
390 if(takes_feedback_edge)
405 const auto src = boost::source(taken_edge, *stg);
407 const auto epp_edge_from_entry = epp_stg->CGetEdge(fsm_entry_node, dst);
408 const auto epp_edge_to_exit = epp_stg->CGetEdge(src, fsm_exit_node);
409 const auto from_entry_edge_info = epp_stg->CGetTransitionInfo(epp_edge_from_entry);
410 const auto to_exit_edge_info = epp_stg->CGetTransitionInfo(epp_edge_to_exit);
411 scope_to_epp_trace[scope].push_back(epp_counter + to_exit_edge_info->get_epp_increment());
413 "epp_trace " +
STR(epp_counter + to_exit_edge_info->get_epp_increment()));
414 epp_counter = from_entry_edge_info->get_epp_increment();
417 current_state = next_state;
418 goes_to_next_bb_execution = end_of_bb_execution;
419 }
while(not goes_to_next_bb_execution);
428 const auto tgt_device =
HLSMgr->get_HLS_device();
429 if(tgt_device->has_parameter(
"vendor"))
431 vendor = tgt_device->get_parameter<std::string>(
"vendor");
432 boost::algorithm::to_lower(vendor);
434 unsigned int n_states =
HLSMgr->get_HLS(f_id)->STG->get_number_of_states();
435 bool one_hot_encoding =
false;
436 if(
parameters->getOption<std::string>(OPT_fsm_encoding) ==
"one-hot")
438 one_hot_encoding =
true;
440 else if(
parameters->getOption<std::string>(OPT_fsm_encoding) ==
"auto" && vendor ==
"xilinx" && n_states < 256)
442 one_hot_encoding =
true;
447 unsigned max_value = 0;
448 for(
const auto& s : stg_info->state_id_to_vertex)
450 max_value =
std::max(max_value, s.first);
452 if(max_value != n_states - 1)
457 "---f_id " +
STR(f_id) +
" ONE HOT" +
STR(one_hot_encoding ?
" true" :
" false"));
459 const unsigned int state_bitsize = one_hot_encoding ? (max_value + 1) : bitsnumber;
461 "---f_id " +
STR(f_id) +
" STATE BITSIZE " +
STR(state_bitsize));
463 size_t f_state_of_the_art_usage = 0;
464 size_t f_state_of_the_art_usage_fixed = 0;
465 size_t f_state_of_the_art_usage_opt = 0;
466 for(
const auto& scope :
Discr->f_id_to_scope.at(f_id))
468 if(scope_to_state_trace.find(scope) == scope_to_state_trace.end())
472 const auto& state_trace = scope_to_state_trace.at(scope);
473 size_t scope_memory_usage = state_bitsize * state_trace.size();
475 "---scope " + scope +
" state_of_the_art memory usage (BITS): " +
STR(scope_memory_usage));
477 "---scope " + scope +
" state_of_the_art memory usage (BYTES): " +
478 STR((scope_memory_usage / 8) + (((scope_memory_usage % 8) == 0) ? 0 : 1)));
479 f_state_of_the_art_usage += scope_memory_usage;
482 size_t incremental_counter_fixed = 0;
484 size_t scope_memory_usage_fixed = 0;
486 for(
const auto state_id : state_trace)
488 if(state_id != (prev_state + 1))
491 for(
unsigned int metadata_bitsize = 0; metadata_bitsize <
MAX_METADATA_BITSIZE; metadata_bitsize++)
493 scope_memory_usage_opt[metadata_bitsize] += state_bitsize + metadata_bitsize;
495 incremental_counter_fixed = 0;
496 for(
unsigned int metadata_bitsize = 0; metadata_bitsize <
MAX_METADATA_BITSIZE; metadata_bitsize++)
498 incremental_counter_opt[metadata_bitsize] = 0;
503 incremental_counter_fixed++;
504 for(
unsigned int metadata_bitsize = 0; metadata_bitsize <
MAX_METADATA_BITSIZE; metadata_bitsize++)
506 incremental_counter_opt[metadata_bitsize]++;
511 incremental_counter_fixed = 0;
513 for(
unsigned int metadata_bitsize = 0; metadata_bitsize <
MAX_METADATA_BITSIZE; metadata_bitsize++)
515 if(incremental_counter_opt[metadata_bitsize] >= (1ULL << metadata_bitsize))
517 scope_memory_usage_opt[metadata_bitsize] += state_bitsize + metadata_bitsize;
518 incremental_counter_opt[metadata_bitsize] = 0;
522 prev_state = state_id;
525 "---scope " + scope +
526 " state_of_the_art fixed memory usage (BITS): " +
STR(scope_memory_usage_fixed));
528 "---scope " + scope +
" state_of_the_art fixed memory usage (BYTES): " +
529 STR((scope_memory_usage_fixed / 8) + (((scope_memory_usage_fixed % 8) == 0) ? 0 : 1)));
530 f_state_of_the_art_usage_fixed += scope_memory_usage_fixed;
532 for(
unsigned int metadata_bitsize = 0; metadata_bitsize <
MAX_METADATA_BITSIZE; metadata_bitsize++)
534 min_scope_memory_usage_opt =
535 std::min(min_scope_memory_usage_opt, scope_memory_usage_opt[metadata_bitsize]);
538 "---scope " + scope +
539 " state_of_the_art opt memory usage (BITS): " +
STR(min_scope_memory_usage_opt));
542 "---scope " + scope +
" state_of_the_art opt memory usage (BYTES): " +
543 STR((min_scope_memory_usage_opt / 8) + (((min_scope_memory_usage_opt % 8) == 0) ? 0 : 1)));
544 f_state_of_the_art_usage_opt += min_scope_memory_usage_opt;
547 "---f_id " +
STR(f_id) +
548 " state_of_the_art memory usage (BITS): " +
STR(f_state_of_the_art_usage));
550 "---f_id " +
STR(f_id) +
" state_of_the_art memory usage (BYTES): " +
551 STR((f_state_of_the_art_usage / 8) + (((f_state_of_the_art_usage % 8) == 0) ? 0 : 1)));
553 "---f_id " +
STR(f_id) +
554 " state_of_the_art fixed memory usage (BITS): " +
STR(f_state_of_the_art_usage_fixed));
557 "---f_id " +
STR(f_id) +
" state_of_the_art fixed memory usage (BYTES): " +
558 STR((f_state_of_the_art_usage_fixed / 8) + (((f_state_of_the_art_usage_fixed % 8) == 0) ? 0 : 1)));
560 "---f_id " +
STR(f_id) +
561 " state_of_the_art opt memory usage (BITS): " +
STR(f_state_of_the_art_usage_opt));
564 "---f_id " +
STR(f_id) +
" state_of_the_art opt memory usage (BYTES): " +
565 STR((f_state_of_the_art_usage_opt / 8) + (((f_state_of_the_art_usage_opt % 8) == 0) ? 0 : 1)));
566 total_state_of_the_art_memory_usage += f_state_of_the_art_usage;
567 total_state_of_the_art_fixed_memory_usage += f_state_of_the_art_usage_fixed;
568 total_state_of_the_art_opt_memory_usage += f_state_of_the_art_usage_opt;
573 size_t f_min_memory_usage = 0;
574 std::map<std::string, std::map<size_t, size_t>> scope_to_bits_to_usage;
575 if(
Discr->hw_discrepancy_info->fu_id_control_flow_skip.find(f_id) ==
576 Discr->hw_discrepancy_info->fu_id_control_flow_skip.end())
578 size_t f_id_epp_trace_memory_word_bitsize =
Discr->hw_discrepancy_info->fu_id_to_epp_trace_bitsize.at(f_id);
579 if((
Discr->hw_discrepancy_info->fu_id_to_max_epp_path_val.at(f_id) + 1) ==
580 (1ULL << f_id_epp_trace_memory_word_bitsize))
582 f_id_epp_trace_memory_word_bitsize++;
585 "---f_id " +
STR(f_id) +
" EPP TRACE BITSIZE " +
STR(f_id_epp_trace_memory_word_bitsize));
586 for(
const auto& scope :
Discr->f_id_to_scope.at(f_id))
588 if(scope_to_epp_trace.find(scope) == scope_to_epp_trace.end())
592 const auto epp_trace = scope_to_epp_trace.at(scope);
594 "---f_id " +
STR(f_id) +
" scope " + scope +
" EPP TRACE LENGTH " +
595 STR(epp_trace.size()));
597 "---f_id " +
STR(f_id) +
" scope " + scope +
" expected baseline EPP TRACE LENGTH " +
598 STR(f_id_epp_trace_memory_word_bitsize * epp_trace.size()));
599 size_t best_metadata_bitsize = 0;
603 std::list<std::pair<size_t, size_t>> compressed_epp_trace_with_metadata;
606 size_t prev_epp_counter = epp_trace.front();
609 size_t metadata_counter = 0;
610 for(
const auto epp_counter : epp_trace)
612 if(epp_counter != prev_epp_counter)
614 compressed_epp_trace_with_metadata.emplace_back(metadata_counter - 1, prev_epp_counter);
615 metadata_counter = 0;
619 if(metadata_counter > ((1ULL << i) - 1))
621 compressed_epp_trace_with_metadata.emplace_back(metadata_counter - 1, prev_epp_counter);
622 metadata_counter = 0;
626 prev_epp_counter = epp_counter;
630 compressed_epp_trace_with_metadata.emplace_back(metadata_counter - 1, prev_epp_counter);
633 size_t scope_memory_usage =
634 (f_id_epp_trace_memory_word_bitsize + i) * compressed_epp_trace_with_metadata.size();
635 scope_to_bits_to_usage[scope][i] = scope_memory_usage;
637 "---scope " + scope +
" memory usage (METADATA) " +
STR(i) +
638 " (BITS): " +
STR(scope_memory_usage));
640 "---scope " + scope +
" memory usage (METADATA) " +
STR(i) +
" (BYTES): " +
641 STR((scope_memory_usage / 8) + (((scope_memory_usage % 8) == 0) ? 0 : 1)));
642 if(scope_memory_usage < min_scope_memory_usage)
645 best_metadata_bitsize = i;
646 min_scope_memory_usage = scope_memory_usage;
647 scope_to_best_epp_trace_with_metadata[scope].swap(compressed_epp_trace_with_metadata);
650 scope_to_best_metadata_bits[scope] = best_metadata_bitsize;
652 for(
const auto& s2b2u : scope_to_bits_to_usage)
657 f_memory_usage.at(i) += s2b2u.second.at(i);
658 min_scope_usage =
std::min(min_scope_usage, s2b2u.second.at(i));
660 f_min_memory_usage += min_scope_usage;
666 "---f_id " +
STR(f_id) +
" NO CONTROL FLOW CHECKS NEEDED");
671 tot_memory_usage_per_bits.at(i) += f_memory_usage.at(i);
673 "---f_id " +
STR(f_id) +
" memory usage (METADATA) " +
STR(i) +
674 " (BITS): " +
STR(f_memory_usage.at(i)));
676 "---f_id " +
STR(f_id) +
" memory usage (METADATA) " +
STR(i) +
" (BYTES): " +
677 STR((f_memory_usage.at(i) / 8) + (((f_memory_usage.at(i) % 8) == 0) ? 0 : 1)));
679 min_memory_usage += f_min_memory_usage;
681 "---f_id " +
STR(f_id) +
" memory usage (BITS): " +
STR(f_min_memory_usage));
683 "---f_id " +
STR(f_id) +
" memory usage (BYTES): " +
684 STR((f_min_memory_usage / 8) + (((f_min_memory_usage % 8) == 0) ? 0 : 1)));
687 "<--Untangled software control flow trace of function: " +
STR(f_id));
690 for(
const auto& i : scope_to_state_trace)
693 "---state trace length for function scope: " + i.first +
": " +
STR(i.second.size()));
695 for(
const auto id : i.second)
702 for(
const auto& i : scope_to_epp_trace)
705 "---EPP trace length for function scope: " + i.first +
": " +
STR(i.second.size()));
707 for(
const auto id : i.second)
716 const auto top_symbols =
parameters->getOption<std::vector<std::string>>(OPT_top_functions_names);
717 THROW_ASSERT(top_symbols.size() == 1,
"Expected single top function name");
719 const auto top_module =
HLSMgr->get_HLS(top_id)->top->get_circ();
723 for(
const auto& i : scope_to_best_epp_trace_with_metadata)
725 const std::string& scope = i.first;
726 const auto f_id = scope_to_function_id.at(i.first);
732 "<--Skipping scope " + i.first +
" since it is not executed");
735 if(
Discr->hw_discrepancy_info->fu_id_control_flow_skip.find(f_id) !=
736 Discr->hw_discrepancy_info->fu_id_control_flow_skip.end())
739 "<--Skipping scope " + i.first +
740 " since it is belongs to a function without control flow instructions");
744 using tokenizer = boost::tokenizer<boost::char_separator<char>>;
745 boost::char_separator<char> sep(
"/",
nullptr);
746 tokenizer module_path_tokens(scope, sep);
747 tokenizer::iterator tok_iter;
748 tokenizer::iterator tok_iter_end = module_path_tokens.end();
749 for(tok_iter = module_path_tokens.begin(); tok_iter != tok_iter_end; ++tok_iter)
751 if(*tok_iter == top_module->get_id())
756 THROW_ASSERT(tok_iter != tok_iter_end,
"unexpected condition");
758 THROW_ASSERT(tok_iter != tok_iter_end,
"unexpected condition");
760 for(; tok_iter != tok_iter_end; ++tok_iter)
763 "---Looking for " + *tok_iter +
" in " + curr_module->
get_path());
767 const std::string datapath_id =
"Datapath_i";
770 const std::string cfc_id =
"ControlFlowChecker_i";
775 GetPointer<module>(curr_module)->SetParameter(
"EPP_MISMATCH_ID",
STR(scope_id));
777 const size_t trace_len =
779 const size_t metadata_word_size = scope_to_best_metadata_bits.at(scope);
780 auto data_word_size = std::stoul(GetPointer<module>(curr_module)->GetParameter(
"EPP_TRACE_BITSIZE"));
781 if((
Discr->hw_discrepancy_info->fu_id_to_max_epp_path_val.at(f_id) + 1) == (1ULL << data_word_size))
784 GetPointer<module>(curr_module)->SetParameter(
"EPP_TRACE_BITSIZE",
STR(data_word_size));
786 const size_t invalid_epp_id = (1ULL << data_word_size) - 1;
787 GetPointer<module>(curr_module)->SetParameter(
"EPP_TRACE_LENGTH",
STR(trace_len));
788 GetPointer<module>(curr_module)->SetParameter(
"EPP_TRACE_METADATA_BITSIZE",
STR(metadata_word_size));
789 GetPointer<module>(curr_module)->SetParameter(
"EPP_TRACE_INITIAL_METADATA",
STR(i.second.begin()->first));
791 for(
const auto&
id : i.second)
796 const std::string init_filename =
"epp_control_flow_trace_scope__" +
STR(scope_id) +
".mem";
797 std::ofstream init_file(
GetPath(init_filename));
799 for(
const auto&
id : i.second)
801 const auto metadata =
id.first;
802 const auto data =
id.second;
803 if(metadata >> metadata_word_size)
805 THROW_ERROR(
"metadata " +
STR(metadata) +
" cannot be represented with " +
STR(metadata_word_size) +
808 if(data >> data_word_size)
810 THROW_ERROR(
"data " +
STR(data) +
" cannot be represented with " +
STR(data_word_size) +
" bits");
812 if(metadata_word_size)
818 if(metadata_word_size)
824 GetPointer<module>(curr_module)->SetParameter(
"MEMORY_INIT_file",
"\"\"" +
GetPath(init_filename) +
"\"\"");
831 "---tot memory usage (METADATA) " +
STR(i) +
" (BITS): " +
STR(tot_memory_usage_per_bits.at(i)));
834 "---tot memory usage (METADATA) " +
STR(i) +
" (BYTES): " +
835 STR((tot_memory_usage_per_bits.at(i) / 8) + (((tot_memory_usage_per_bits.at(i) % 8) == 0) ? 0 : 1)));
840 "---tot memory usage BASE (BITS): " +
STR(tot_memory_usage_per_bits.at(0)));
842 "---tot memory usage BASE (BYTES): " +
STR((tot_memory_usage_per_bits.at(0) / 8) +
843 (((tot_memory_usage_per_bits.at(0) % 8) == 0) ? 0 : 1)));
847 "---tot memory usage FIXED (BYTES): " +
852 "---minimal tot memory usage (BYTES): " +
853 STR((min_memory_usage / 8) + (((min_memory_usage % 8) == 0) ? 0 : 1)));
855 "---total state_of_the_art memory usage (BITS): " +
STR(total_state_of_the_art_memory_usage));
858 "---total state_of_the_art memory usage (BYTES): " +
859 STR((total_state_of_the_art_memory_usage / 8) + (((total_state_of_the_art_memory_usage % 8) == 0) ? 0 : 1)));
861 "---total state_of_the_art fixed memory usage (BITS): " +
862 STR(total_state_of_the_art_fixed_memory_usage));
864 "---total state_of_the_art fixed memory usage (BYTES): " +
865 STR((total_state_of_the_art_fixed_memory_usage / 8) +
866 (((total_state_of_the_art_fixed_memory_usage % 8) == 0) ? 0 : 1)));
868 "---total state_of_the_art opt memory usage (BITS): " +
STR(total_state_of_the_art_opt_memory_usage));
870 "---total state_of_the_art opt memory usage (BYTES): " +
871 STR((total_state_of_the_art_opt_memory_usage / 8) +
872 (((total_state_of_the_art_opt_memory_usage % 8) == 0) ? 0 : 1)));
877 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 878 #pragma GCC diagnostic pop
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Data structure representing the entire HLS information.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
boost::graph_traits< graph >::out_edge_iterator OutEdgeIterator
out_edge_iterator definition.
static std::string name_function(const tree_managerConstRef &tm, const unsigned int index)
Return the name of the function.
#define DEBUG_LEVEL_PEDANTIC
very verbose debugging print is performed.
This file contains the structures needed to manage a graph that will represent the state transition g...
#define GET_CLASS(obj)
Macro returning the actual type of an object.
const int output_level
The output level.
void parse_discrepancy(const std::string &c_trace_filename, DiscrepancyRef Discrepancy)
RelationshipType
The relationship type.
#define FIXED_METADATA_SIZE
FIXED metadata bit size.
Source must be executed to satisfy target.
#define INDENT_OUT_MEX(outLevel, curOutLevel, mex)
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.
CustomOrderedMap< T, U > CustomMap
virtual structural_objectRef find_member(const std::string &id, so_kind type, const structural_objectRef owner) const =0
Return the object named id of a given type which belongs to or it is associated with the object...
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMapUnstable
std::string NumberToBinaryString(const T number, const size_t precision=0)
Function which print number in binary format.
Data structure describing a basic block at tree level.
#define OUTPUT_LEVEL_MINIMUM
minimum debugging print is performed.
redefinition of map to manage ordered/unordered structures
#define GET_TYPE_NAME(structural_obj)
Macro returning the string name of a type.
#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
#define MAX_METADATA_BITSIZE
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
const std::string get_path() const
Return a unique identifier of the structural object.
Target must be reexecuted.
redefinition of set to manage ordered/unordered structures
#define BB_ENTRY
constant identifying the basic block node of type entry
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
utility function used to read files.
This file contains the structures needed to manage a graph that will represent the state transition g...
const DiscrepancyRef Discr
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
DesignFlowStep_Status Exec() override
Execute the step.
This file collects some utility functions.
HWDiscrepancyAnalysis(const ParameterConstRef parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
std::string GetPath(std::filesystem::path path)
Class specification of the tree_reindex support class.
Class specification of the basic_block structure.
static unsigned int bitnumber(unsigned long long n)
Counts the number of bits in an unsigned int.
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.
Class implementation of the structural_manager.
int debug_level
The debug level.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
refcount< const HLSFlowStepSpecialization > HLSFlowStepSpecializationConstRef
const refcount definition of the class
#define GET_INDEX_CONST_NODE(t)
Data structure definition for high-level synthesis flow.
#define NULL_VERTEX
null vertex definition
Class specification of the manager of the tree structures extracted from the raw file.
HLS specialization of generic_device.
A brief description of the C++ Header File.
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 ...