PandA-2024.02
dry_run_evaluation.cpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2017-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
41 #include "dry_run_evaluation.hpp"
43 
44 #include "Parameter.hpp"
45 #include "bambu_results_xml.hpp"
46 #include "hls.hpp"
47 #include "hls_manager.hpp"
48 #include "string_manipulation.hpp"
49 #include "utility.hpp"
50 #include "xml_document.hpp"
51 #include "xml_helper.hpp"
52 
54  const DesignFlowManagerConstRef _design_flow_manager)
55  : EvaluationBaseStep(_parameters, _HLSMgr, _design_flow_manager, HLSFlowStep_Type::DRY_RUN_EVALUATION)
56 {
57  debug_level = parameters->get_class_debug_level(GET_CLASS(*this));
58 }
59 
61 
63 {
64  auto objective_string = parameters->getOption<std::string>(OPT_evaluation_objectives);
65  const auto objective_vector = string_to_container<std::vector<std::string>>(objective_string, ",");
66  for(const auto& objective : objective_vector)
67  {
68  HLSMgr->evaluations[objective] = 0.0;
69  if(objective == "CYCLES")
70  {
71  HLSMgr->evaluations["NUM_EXECUTIONS"] = 1;
72  HLSMgr->evaluations["TOTAL_CYCLES"] = 0.0;
73  }
74  if(objective == "FREQUENCY" or objective == "TIME" or objective == "TOTAL_TIME" or objective == "AREAxTIME")
75  {
76  auto clock_period = parameters->getOption<double>(OPT_clock_period);
77  HLSMgr->evaluations["PERIOD"] = clock_period;
78  }
79  if(objective == "TIME")
80  {
81  auto clock_period = parameters->getOption<double>(OPT_clock_period);
82  HLSMgr->evaluations["CYCLES"] = 0.0;
83  HLSMgr->evaluations["FREQUENCY"] = 1000 / clock_period;
84  }
85  if(objective == "PERIOD")
86  {
87  auto clock_period = parameters->getOption<double>(OPT_clock_period);
88  HLSMgr->evaluations[objective] = clock_period;
89  }
90  }
92 }
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
Data structure representing the entire HLS information.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
DesignFlowStep_Status Exec() override
Execute the step.
constant strings used in bambu results
Auxiliary methods for manipulating string.
HLSFlowStep_Type
Definition: hls_step.hpp:95
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
This file collects some utility functions and macros.
~DryRunEvaluation() override
Destructor.
DryRunEvaluation(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
this class is used to manage the command-line or XML options.
Some macro used to interface with the XML library.
int debug_level
The debug level.
Data structure definition for high-level synthesis flow.
Superclass include.

Generated on Mon Feb 12 2024 13:02:53 for PandA-2024.02 by doxygen 1.8.13