diff --git a/libopenfpga/libopenfpgashell/src/shell.tpp b/libopenfpga/libopenfpgashell/src/shell.tpp index 24ef13dea..2bc4a503a 100644 --- a/libopenfpga/libopenfpgashell/src/shell.tpp +++ b/libopenfpga/libopenfpgashell/src/shell.tpp @@ -302,6 +302,14 @@ void Shell::run_script_mode(const char* script_file_name, T& context) { if (cmd_end_pos != std::string::npos) { cmd_part = line.substr(0, cmd_end_pos); } + /* Remove the space at the beginning of the line */ + cmd_part.erase(cmd_part.begin(), std::find_if(cmd_part.begin(), cmd_part.end(), [](int ch) { + return !std::isspace(ch); + })); + /* Remove the space at the end of the line */ + cmd_part.erase(std::find_if(cmd_part.rbegin(), cmd_part.rend(), [](int ch) { + return !std::isspace(ch); + }).base(), cmd_part.end()); /* Process the command only when the line is not empty */ if (!cmd_part.empty()) { execute_command(cmd_part.c_str(), context); diff --git a/openfpga/test_script/and_k6_frac_tileable_adder_register_scan_chain.openfpga b/openfpga/test_script/and_k6_frac_tileable_adder_register_scan_chain.openfpga index 0ef91ab9d..ae10ebb34 100644 --- a/openfpga/test_script/and_k6_frac_tileable_adder_register_scan_chain.openfpga +++ b/openfpga/test_script/and_k6_frac_tileable_adder_register_scan_chain.openfpga @@ -28,8 +28,8 @@ lut_truth_table_fixup #--verbose build_fabric --compress_routing --duplicate_grid_pin --verbose # Repack the netlist to physical pbs -# This must be done before bitstream generator and testbench generation -# Strongly recommend it is done after all the fix-up have been applied + # This must be done before bitstream generator and testbench generation + # Strongly recommend it is done after all the fix-up have been applied repack #--verbose # Build the bitstream