Skip to content

Commit

Permalink
sim: Add banner
Browse files Browse the repository at this point in the history
  • Loading branch information
saursin committed Oct 8, 2023
1 parent 0bb7fd0 commit 8cf3e5f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sim/atomsim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ struct Atomsim_config
bool trace_flag = false; // enable tracing
bool dump_on_ebreak_flag= false; // Dump registers at ebreak (Used by SCAR)
bool no_color_flag = false; // Disable colored output
bool no_banner_flag = false; // Disable banner flag


// input file
std::string ifile = "";
Expand Down
3 changes: 2 additions & 1 deletion sim/interactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ int Atomsim::run_interactive_mode()
}
else
{
std::cout << "Unknown command \"" << cmd << "\"" << std::endl;
if(cmd != "")
std::cout << "Unknown command \"" << cmd << "\"" << std::endl;
}
}

Expand Down
11 changes: 11 additions & 0 deletions sim/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
// define atomsim version
#define ATOMSIM_VERSION "v2.2"

#define ATOMSIM_BANNER \
" ___ __ _____ \n" \
" / _ |/ /____ __ _ / __(_)_ _ \n" \
" / __ / __/ _ \\/ ' \\_\\ \\/ / ' \\\n" \
"/_/ |_\\__/\\___/_/_/_/___/_/_/_/_/ "

// Global Variables
// (use extern in other files)

Expand Down Expand Up @@ -66,6 +72,7 @@ void parse_commandline_args(int argc, char**argv, Atomsim_config &sim_config, Ba
("version", "Show version information")
("soctarget", "Show current AtomSim SoC target")
("no-color", "Don't show colored output", cxxopts::value<bool>(sim_config.no_color_flag)->default_value(default_sim_config.no_color_flag?"true":"false"))
("no-banner", "Don't show banner", cxxopts::value<bool>(sim_config.no_banner_flag)->default_value(default_sim_config.no_banner_flag?"true":"false"))
("i,input", "Specify an input file", cxxopts::value<std::string>(sim_config.ifile))
;

Expand Down Expand Up @@ -162,6 +169,10 @@ int main(int argc, char ** argv)

// Parse commandline arguments
parse_commandline_args(argc, argv, sim_config, backend_config);

// Print banner
if(!sim_config.no_banner_flag)
printf("%s %s\n", ATOMSIM_BANNER, ATOMSIM_VERSION);

int exitcode=0;
try
Expand Down

0 comments on commit 8cf3e5f

Please sign in to comment.