65 const DesignFlowManagerConstRef _design_flow_manager,
77 switch(relationship_type)
81 const auto c_backend_factory =
83 relationship.insert(c_backend_factory->CreateCBackendStep(
c_backend_info));
109 const auto is_discrepancy =
c_backend_info->type == CBackendInformation::CB_DISCREPANCY_ANALYSIS;
119 std::string compiler_flags =
"-fwrapv -flax-vector-conversions -msse2 -mfpmath=sse -fno-strict-aliasing " 120 "-D'__builtin_bambu_time_start()=' -D'__builtin_bambu_time_stop()=' ";
123 compiler_flags +=
"-ffloat-store ";
131 compiler_flags +=
"-fexcess-precision=standard ";
134 if(
parameters->isOption(OPT_tb_extra_gcc_options))
136 compiler_flags +=
parameters->getOption<std::string>(OPT_tb_extra_gcc_options) +
" ";
139 if(
parameters->isOption(OPT_gcc_optimizations))
142 if(gcc_parameters.find(
"tree-vectorize") != gcc_parameters.end())
144 boost::replace_all(compiler_flags,
"-msse2",
"");
145 compiler_flags +=
"-m32 ";
149 if(is_discrepancy && (!
parameters->isOption(OPT_discrepancy_permissive_ptrs) ||
150 !
parameters->getOption<
bool>(OPT_discrepancy_permissive_ptrs)))
154 compiler_flags +=
"-g -fsanitize=address -fno-omit-frame-pointer -fno-common ";
158 compiler_flags +=
"-fsanitize=undefined -fsanitize-recover=undefined ";
162 std::list<std::string> file_sources = {
c_backend_info->src_filename};
164 if(
parameters->isOption(OPT_no_parse_c_python))
167 for(
const auto& no_parse_file : no_parse_files)
169 file_sources.push_back(no_parse_file);
173 auto exec_name = std::filesystem::path(
c_backend_info->src_filename).replace_extension().string();
176 compiler_wrapper->CreateExecutable(file_sources, exec_name, compiler_flags);
182 exec_name =
"ASAN_OPTIONS='symbolize=1:redzone=2048' " + exec_name;
189 THROW_ERROR(
"Error in generating the expected test results");
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;.
Factory class to create c backend.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
static bool isCurrentOrNewer(CompilerWrapper_CompilerTarget ct, CompilerWrapper_CompilerTarget compare)
Simple class used to drive the backend in order to be able to print c source code.
Auxiliary methods for manipulating string.
bool IsError(const int error_value)
Utility include.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Classes to describe design flow graph.
Target must be reexecuted.
redefinition of set to manage ordered/unordered structures
utility function used to read files.
CompilerWrapper_CompilerTarget
target of the compiler
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
static bool isClangCheck(CompilerWrapper_CompilerTarget ct)
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
void ComputeRelationships(DesignFlowStepSet &design_flow_step_set, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
int PandaSystem(const ParameterConstRef Param, const std::string &system_command, bool host_exec, const std::string &output, const unsigned int type, const bool background, const size_t timeout)
System call forcing execution with bash.
refcount< T > lock() const
DesignFlowStep_Status Exec() override
Execute the step.
This class contains the methods to create a frontend flow step.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Parameters_FileFormat
File formats.
void ComputeRelationships(DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
this class is used to manage the command-line or XML options.
Main class for wrapping the frontend compiler.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
int debug_level
The debug level.
const CBackendInformationConstRef c_backend_info
This class contains the base representation for a generic frontend flow step which works on the whole...
CTestbenchExecution(const ParameterConstRef Param, const HLS_managerRef AppM, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization)
A brief description of the C++ Header File.
#define DEBUG_LEVEL_MINIMUM
minimum debugging print is performed.
Implementation of the wrapper to Gcc for C sources.