57 #include "config_PANDA_DATA_INSTALLDIR.hpp" 59 #define BASHBACKEND_AREA "BASHBACKEND_AREA" 60 #define BASHBACKEND_POWER "BASHBACKEND_POWER" 61 #define BASHBACKEND_DESIGN_DELAY "BASHBACKEND_DESIGN_DELAY" 69 default_data[
"Generic-yosysOpenROAD"] =
"Generic-yosysOpenROAD.data";
72 if(
Param->isOption(OPT_target_device_script))
74 auto xml_file_path =
Param->getOption<std::string>(OPT_target_device_script);
75 if(!std::filesystem::exists(xml_file_path))
77 THROW_ERROR(
"File \"" + xml_file_path +
"\" does not exist!");
84 std::string device_string;
85 if(
device->has_parameter(
"family"))
87 device_string =
device->get_parameter<std::string>(
"family");
91 device_string =
"yosysOpenROAD";
95 THROW_ERROR(
"Device family \"" + device_string +
"\" not supported!");
98 "---Importing default scripts for target device family: " + device_string);
121 for(
const auto& iter_int : list_int)
123 const auto* EnodeC = GetPointer<const xml_element>(iter_int);
129 if(EnodeC->get_name() ==
"application")
132 for(
const auto& iter_sec : list_sec)
134 const auto* nodeS = GetPointer<const xml_element>(iter_sec);
140 if(nodeS->get_name() ==
"section")
142 std::string stringID;
143 if(
CE_XVM(stringID, nodeS))
147 if(stringID ==
"BASH_SYNTHESIS_SUMMARY")
150 for(
const auto& it_item : list_item)
152 const auto* nodeIt = GetPointer<const xml_element>(it_item);
153 if(!nodeIt or nodeIt->get_name() !=
"item")
158 if(
CE_XVM(stringID, nodeIt))
167 boost::replace_all(value,
",",
"");
179 catch(
const char* msg)
181 std::cerr << msg << std::endl;
183 catch(
const std::string& msg)
185 std::cerr << msg << std::endl;
187 catch(
const std::exception& ex)
189 std::cout <<
"Exception caught: " << ex.what() << std::endl;
193 std::cerr <<
"unknown exception" << std::endl;
201 std::ofstream SDC_file(sdc_filename.c_str());
213 if(
Param->isOption(OPT_backend_sdc_extensions))
215 SDC_file <<
"source " +
Param->getOption<std::string>(OPT_backend_sdc_extensions) +
"\n";
224 bool pwr_enabled =
false;
225 if(
Param->isOption(
"power_optimization") &&
Param->getOption<
bool>(
"power_optimization"))
230 auto device_name =
device->get_parameter<std::string>(
"model");
238 for(
auto& step :
steps)
253 area_m->set_resource_value(area_info::LOGIC_AREA,
design_values[BASHBACKEND_AREA]);
259 auto is_time_unit_PS =
260 device->has_parameter(
"USE_TIME_UNIT_PS") &&
device->get_parameter<
int>(
"USE_TIME_UNIT_PS") == 1;
268 (
Param->IsParameter(
"DumpingTimingReport") and
Param->GetParameter<
int>(
"DumpingTimingReport"))) and
279 script <<
"export PANDA_DATA_INSTALLDIR=" <<
relocate_compiler_path(std::string(PANDA_DATA_INSTALLDIR
"/panda/"))
283 for(
const auto& pair :
device->get_device_bash_vars())
285 script <<
": ${" << pair.first <<
":=" << pair.second <<
"}" 287 script <<
"export " << pair.first <<
"\n";
void CheckSynthesisResults() override
Checks the synthesis results and fills the corresponding data structures.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
Collect information about resource area.
File containing functions and utilities to support the printing of debug messagges.
area_infoRef area_m
pointer to the data structure containing information about the resources
#define PARAM_bash_backend_timing_report
DesignParametersRef actual_parameters
set of design parameters with the actual values
constants used in synthesis wrappers
BashBackendFlow(const ParameterConstRef Param, const std::string &flow_name, const generic_deviceRef _device)
Constructor.
void set_execution_time(double execution_time, unsigned int cycles=time_info::cycles_time_DEFAULT)
Collect information about resource performance.
#define CE_XVM(variable, node)
Check existence XML Value Macro. Check if an XML attribute is present in the XML tree.
void InitDesignParameters() override
Evaluates design variables.
void WriteFlowConfiguration(std::ostream &script) override
Writes the proper flow configuration in the output script.
void parse_flow(const XMLDomParserRef parser)
Creates the synthesis flow based on the user's requirements.
time_infoRef time_m
pointer to the data structure containing timing information
const generic_deviceRef device
information about the target device
int debug_level
debugging level of the class
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
~BashBackendFlow() override
Destructor.
#define BASHBACKEND_POWER
map_t parameter_values
Map between the name of the parameter and the corresponding string-based value.
Backend based on a simple bash script.
#define PARAM_bash_backend_report
std::string get_name() const
Get the name of this node.
std::vector< BackendStepRef > steps
ordered list of synthesis steps
This file contains the definition of the parameters for the synthesis tools.
refcount< XMLDomParser > XMLDomParserRef
utility function used to read files.
This file collects some utility functions and macros.
void Exec()
Parse an XML document from a file.
const ParameterConstRef Param
class containing all the parameters
std::list< xml_nodeRef > node_list
type for list of xml nodes
std::map< std::string, std::string > default_data
map between the identifiers of the synthesis flows and the corresponding implementations ...
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
void xparse_utilization(const std::string &fn)
Parses device utilization.
std::string out_dir
name of the output directory
Classes for handling configuration files.
This class describes all classes used to represent a structural object.
static area_infoRef factory(const ParameterConstRef &Param)
Factory method.
std::string component_name
Name of the component.
#define OUTPUT_LEVEL_VERY_PEDANTIC
verbose debugging print is performed.
unsigned int output_level
verbosity level of the class
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
xml_documentRef get_document()
Obtain the parsed document.
#define BASHBACKEND_DESIGN_DELAY
std::map< std::string, double > design_values
results from the synthesis
void create_sdc(const DesignParametersRef dp)
Creates the constraint file.
this class is used to manage the command-line or XML options.
#define LOAD_XVM(variable, node)
LOAD XML Value Macro. Set a variable starting from an XML value. Conversion is performed if needed...
#define PARAM_bash_sources_macro_list
superclass include
node_list const & get_children()
Obtain the list of child nodes.
std::string GetCurrentPath()
Generic device description.
#define PRINT_OUT_MEX(profLevel, curprofLevel, mex)
void CopyStdout(const std::string &filename)
Copy a file to the standard output.
#define OUTPUT_LEVEL_VERBOSE
verbose debugging print is performed.
#define DEBUG_LEVEL_VERBOSE
verbose debugging print is performed.
std::string relocate_compiler_path(const std::string &path, bool resolve_path=false)
static time_infoRef factory(const ParameterConstRef Param)
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...