From df056f5d70c9cfe67b71efb2ca2077f978664006 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Mon, 27 Jan 2020 17:56:24 -0700 Subject: [PATCH] openfpga shell will stay in interactive mode after executing a script --- libopenfpga/libopenfpgashell/src/shell.h | 2 +- libopenfpga/libopenfpgashell/src/shell.tpp | 17 +++++++++++------ openfpga/src/base/openfpga_link_arch.cpp | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/libopenfpga/libopenfpgashell/src/shell.h b/libopenfpga/libopenfpgashell/src/shell.h index 415fc1b1c..427580010 100644 --- a/libopenfpga/libopenfpgashell/src/shell.h +++ b/libopenfpga/libopenfpgashell/src/shell.h @@ -115,7 +115,7 @@ class Shell { bool valid_command_class_id(const ShellCommandClassId& cmd_class_id) const; public: /* Public executors */ /* Start the interactive mode, where users will type-in command by command */ - void run_interactive_mode(T& context); + void run_interactive_mode(T& context, const bool& quiet_mode = false); /* Start the script mode, where users provide a file which includes all the commands to run */ void run_script_mode(const char* script_file_name, T& context); /* Print all the commands by their classes. This is actually the help desk */ diff --git a/libopenfpga/libopenfpgashell/src/shell.tpp b/libopenfpga/libopenfpgashell/src/shell.tpp index 9d5f8833e..72ebe5168 100644 --- a/libopenfpga/libopenfpgashell/src/shell.tpp +++ b/libopenfpga/libopenfpgashell/src/shell.tpp @@ -239,13 +239,15 @@ ShellCommandClassId Shell::add_command_class(const char* name) { * Public executors ***********************************************************************/ template -void Shell::run_interactive_mode(T& context) { - VTR_LOG("Start interactive mode of %s...\n", - name().c_str()); +void Shell::run_interactive_mode(T& context, const bool& quiet_mode) { + if (false == quiet_mode) { + VTR_LOG("Start interactive mode of %s...\n", + name().c_str()); - /* Print the title of the shell */ - if (!title().empty()) { - VTR_LOG("%s\n", title().c_str()); + /* Print the title of the shell */ + if (!title().empty()) { + VTR_LOG("%s\n", title().c_str()); + } } /* Wait for users input and execute the command */ @@ -306,6 +308,9 @@ void Shell::run_script_mode(const char* script_file_name, T& context) { } } fp.close(); + + /* Return to interactive mode, stay tuned */ + run_interactive_mode(context, true); } template diff --git a/openfpga/src/base/openfpga_link_arch.cpp b/openfpga/src/base/openfpga_link_arch.cpp index 239829e8e..e4bf6bbed 100644 --- a/openfpga/src/base/openfpga_link_arch.cpp +++ b/openfpga/src/base/openfpga_link_arch.cpp @@ -143,6 +143,7 @@ void build_vpr_physical_pb_type_annotation(const DeviceContext& vpr_device_ctx, /* Not found, error out! */ VTR_LOG_ERROR("Unable to find the pb_type '%s' in VPR architecture definition!\n", target_pb_type_names.back().c_str()); + break; } /* Found, we update the annotation by assigning the physical mode */