Skip to content

Commit

Permalink
Testbench compilation aliasing issue
Browse files Browse the repository at this point in the history
Pretty print type punning requires -fno-strict-aliasing
  • Loading branch information
Ansaya committed Feb 22, 2023
1 parent 009cee9 commit fefd4c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/HLS/simulation/CTestbenchExecution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ DesignFlowStep_Status CTestbenchExecution::Exec()
new CompilerWrapper(parameters, parameters->getOption<CompilerWrapper_CompilerTarget>(OPT_default_compiler),
CompilerWrapper_OptimizationSet::O2));

std::string compiler_flags = "-fwrapv -flax-vector-conversions -msse2 -mfpmath=sse "
std::string compiler_flags = "-fwrapv -flax-vector-conversions -msse2 -mfpmath=sse -fno-strict-aliasing "
"-D'__builtin_bambu_time_start()=' -D'__builtin_bambu_time_stop()=' -D__BAMBU_SIM__ ";
if(!CompilerWrapper::isClangCheck(parameters->getOption<CompilerWrapper_CompilerTarget>(OPT_default_compiler)))
{
Expand Down
5 changes: 3 additions & 2 deletions src/HLS/simulation/testbench_values_c_generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ DesignFlowStep_Status TestbenchValuesCGeneration::Exec()
const CompilerWrapperConstRef compiler_wrapper(
new CompilerWrapper(parameters, parameters->getOption<CompilerWrapper_CompilerTarget>(OPT_default_compiler),
CompilerWrapper_OptimizationSet::O2));
std::string compiler_flags = "-fwrapv -ffloat-store -flax-vector-conversions -msse2 -mfpmath=sse "
"-D'__builtin_bambu_time_start()=' -D'__builtin_bambu_time_stop()=' -D__BAMBU_SIM__ ";
std::string compiler_flags =
"-fwrapv -ffloat-store -flax-vector-conversions -msse2 -mfpmath=sse -fno-strict-aliasing "
"-D'__builtin_bambu_time_start()=' -D'__builtin_bambu_time_stop()=' -D__BAMBU_SIM__ ";
if(!parameters->isOption(OPT_input_format) ||
parameters->getOption<Parameters_FileFormat>(OPT_input_format) == Parameters_FileFormat::FF_C ||
parameters->isOption(OPT_pretty_print))
Expand Down

0 comments on commit fefd4c3

Please sign in to comment.