Skip to content

Commit

Permalink
Tests: Override --std=c++11 in EL2/swerv tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnyder committed Jan 29, 2024
1 parent 281de7a commit 5f8186b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions t/t_cores_el2_cmark.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
setenv('RV_ROOT', File::Spec->rel2abs($Self->{t_dir}."/../submodules/Cores-SweRV-EL2"));
setenv('VERILATOR', "$ENV{VERILATOR_ROOT}/bin/verilator");

# Find compiler flag needed
my $fc = $Self->file_contents("$ENV{VERILATOR_ROOT}/include/verilated.mk");
$fc =~ /CFG_CXXFLAGS_STD_NEWEST = (\S+)/ or die;
my $CFG_CXXFLAGS_STD_NEWEST = $1;

# This will run the canned CoreMark (even if you have a riscv64-unknown-elf
# toolchain on your path), from ICCM but otherwise using the default core
# configuration. Running from ICCM is faster and hopefully more exciting.
Expand All @@ -21,6 +26,9 @@
run(cmd => ["make -j4 -C $Self->{obj_dir} -f $ENV{RV_ROOT}/tools/Makefile",
"VERILATOR='$ENV{VERILATOR} --debug-check -Wno-IMPLICITSTATIC "
.join(' ',$Self->driver_verilator_flags()),"'",
# Because Cores-SweRV-EH2/tools/Makefile has -std=c++11 which is too old
# Unfortunately it's too late in the Makefile to pass in VERILATOR above
"VERILATOR_DEBUG='-CFLAGS $CFG_CXXFLAGS_STD_NEWEST'",
"CONF_PARAMS=-iccm_enable=1",
"GCC_PREFIX=none TEST=cmark_iccm",
"VERILATOR_MAKE_FLAGS=VM_PARALLEL_BUILDS=1 verilator"],
Expand Down
8 changes: 8 additions & 0 deletions t/t_cores_swerv_cmark.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
setenv('RV_ROOT', File::Spec->rel2abs($Self->{t_dir}."/../submodules/Cores-SweRV"));
setenv('VERILATOR', "$ENV{VERILATOR_ROOT}/bin/verilator");

# Find compiler flag needed
my $fc = $Self->file_contents("$ENV{VERILATOR_ROOT}/include/verilated.mk");
$fc =~ /CFG_CXXFLAGS_STD_NEWEST = (\S+)/ or die;
my $CFG_CXXFLAGS_STD_NEWEST = $1;

# This will run the canned CoreMark (even if you have a riscv64-unknown-elf
# toolchain on your path), from ICCM but otherwise using the default core
# configuration. Running from ICCM is faster and hopefully more exciting.
Expand All @@ -21,6 +26,9 @@
run(cmd => ["make -j4 -C $Self->{obj_dir} -f $ENV{RV_ROOT}/tools/Makefile",
"VERILATOR='$ENV{VERILATOR} --debug-check -Wno-IMPLICITSTATIC "
.join(' ',$Self->driver_verilator_flags()),"'",
# Because Cores-SweRV-EH2/tools/Makefile has -std=c++11 which is too old
# Unfortunately it's too late in the Makefile to pass in VERILATOR above
"VERILATOR_DEBUG='-CFLAGS $CFG_CXXFLAGS_STD_NEWEST'",
"CONF_PARAMS=-iccm_enable=1",
"GCC_PREFIX=none TEST=cmark_iccm",
"VERILATOR_MAKE_FLAGS=VM_PARALLEL_BUILDS=1 verilator"],
Expand Down

0 comments on commit 5f8186b

Please sign in to comment.