Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sw-sysemu/sys_emu/sys_emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,9 @@ sys_emu::sys_emu(const sys_emu_cmd_options &cmd_options, api_communicate *api_co
chip.cold_reset();


// Configure the simulation parameters
#if EMU_ETSOC1
// Configure the simulation parameters (ET-SoC-1 only)
// Erbium honors ESR defaults set during cold_reset()
for (unsigned shire = 0; shire < EMU_NUM_MINION_SHIRES; ++shire) {
if (((cmd_options.shires_en >> shire) & 1) == 0) {
chip.config_simulated_harts(shire, 0, false, false);
Expand All @@ -433,6 +435,7 @@ sys_emu::sys_emu(const sys_emu_cmd_options &cmd_options, api_communicate *api_co
false, !cmd_options.sp_dis);
}
#endif
#endif // EMU_ETSOC1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either we remove HAS_SVCPROC and use ETSOC1 -- something we said we shouldn't. But this can be considered external to the simulator core so we should use EMU_ETSOC1 and EMU_ERBIUM.

This mixes different types of EMU arguments, let's be consistent.


// Reset the warm-reset part of the system
for (unsigned shire = 0; shire < EMU_NUM_SHIRES; ++shire) {
Expand Down
20 changes: 20 additions & 0 deletions sw-sysemu/sys_emu/sys_emu_parse_args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ static const char * help_msg =
" cacheops Cache operations with undefined behavior\n"
" debug Undefined behavior while in debug mode\n"
" other Other warnings\n"
#if EMU_ETSOC1
" -minions <mask> A mask of Minions that should be enabled in each Shire (default: 1 Minion/Shire)\n"
" -shires <mask> A mask of Shires that should be enabled. (default: 1 Shire)\n"
#endif
#if EMU_ETSOC1
" -single_thread Disable 2nd Minion thread\n"
#endif
#ifndef SDK_RELEASE
#if EMU_ETSOC1
" -mins_dis Minions (not including SP) start disabled\n"
#endif
#if EMU_HAS_SVCPROC
" -sp_dis SP starts disabled\n"
#endif // EMU_HAS_SVCPROC
Expand Down Expand Up @@ -168,12 +174,18 @@ sys_emu::parse_command_line_arguments(int argc, char* argv[])
{"ltrigger_start", required_argument, nullptr, 0},
{"ltrigger_stop", required_argument, nullptr, 0},
{"Werror", optional_argument, nullptr, 0},
#if EMU_ETSOC1
{"minions", required_argument, nullptr, 0},
{"shires", required_argument, nullptr, 0},
{"master_min", no_argument, nullptr, 0}, // deprecated, use -shires <mask> to enable Master Shire and SP
#endif
#if EMU_ETSOC1
{"single_thread", no_argument, nullptr, 0},
#endif
#ifndef SDK_RELEASE
#if EMU_ETSOC1
{"mins_dis", no_argument, nullptr, 0},
#endif
#if EMU_HAS_SVCPROC
{"sp_dis", no_argument, nullptr, 0},
#endif
Expand Down Expand Up @@ -347,6 +359,7 @@ sys_emu::parse_command_line_arguments(int argc, char* argv[])
}
cmd_options.warning.make_error(category);
}
#if EMU_ETSOC1
else if (!strcmp(name, "minions"))
{
sscanf(optarg, "%" PRIx64, &cmd_options.minions_en);
Expand All @@ -359,18 +372,25 @@ sys_emu::parse_command_line_arguments(int argc, char* argv[])
{
SE_WARN("Ignoring deprecated option '-master_min'");
}
#endif
#if EMU_ETSOC1
else if (!strcmp(name, "single_thread"))
{
cmd_options.second_thread = false;
}
#endif
#if EMU_ETSOC1
else if (!strcmp(name, "mins_dis"))
{
cmd_options.mins_dis = true;
}
#endif
#if EMU_HAS_SVCPROC
else if (!strcmp(name, "sp_dis"))
{
cmd_options.sp_dis = true;
}
#endif
else if (!strcmp(name, "reset_pc"))
{
sscanf(optarg, "%" PRIx64, &cmd_options.reset_pc);
Expand Down
5 changes: 2 additions & 3 deletions sw-sysemu/tests/erbium/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ VERBOSE ?= 0
BUILD_DIR := build
EMU := ../../build/erbium_emu
RISCV ?= /opt/et/bin
EMU_ARGS ?= -minions 0xff -mins_dis
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just leave EMU_ARGS empty.


# Verbosity
VERBOSE_0 := @
Expand Down Expand Up @@ -62,7 +61,7 @@ run: $(tests_elf)
@npass=0; nfail=0; \
for test in $(tests); do \
echo "+ running $$test"; \
$(EMU) -l $(EMU_ARGS) -elf_load $(BUILD_DIR)/$$test.elf > $(BUILD_DIR)/$$test.out 2>&1; \
$(EMU) -l -elf_load $(BUILD_DIR)/$$test.elf > $(BUILD_DIR)/$$test.out 2>&1; \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

if grep -q "Signal end test with FAIL" $(BUILD_DIR)/$$test.out; then \
echo " FAIL"; \
nfail=$$((nfail + 1)); \
Expand All @@ -85,7 +84,7 @@ run: $(tests_elf)
# Run individual test
run/%: $(BUILD_DIR)/%.elf
@echo "+ running $*"
@$(EMU) -l $(EMU_ARGS) -elf_load $< > $(BUILD_DIR)/$*.out 2>&1; \
@$(EMU) -l -elf_load $< > $(BUILD_DIR)/$*.out 2>&1; \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

if grep -q "Signal end test with FAIL" $(BUILD_DIR)/$*.out; then \
echo " FAIL"; exit 1; \
elif grep -q "Signal end test with PASS" $(BUILD_DIR)/$*.out; then \
Expand Down