From f1a317b3846893d8a4b8a7bfc4efe84b4a42736e Mon Sep 17 00:00:00 2001 From: tangxifan Date: Thu, 24 Nov 2022 21:04:04 -0800 Subject: [PATCH] [engine] format --- openfpga/src/base/openfpga_shell.cpp | 7 ++-- openfpga/src/base/openfpga_shell.h | 52 ++++++++++++++++------------ 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/openfpga/src/base/openfpga_shell.cpp b/openfpga/src/base/openfpga_shell.cpp index 8d9d501cf..e9948c1bb 100644 --- a/openfpga/src/base/openfpga_shell.cpp +++ b/openfpga/src/base/openfpga_shell.cpp @@ -1,7 +1,8 @@ +#include "openfpga_shell.h" + +#include "basic_command.h" #include "command_echo.h" #include "command_parser.h" -#include "openfpga_shell.h" -#include "basic_command.h" #include "openfpga_bitstream_command.h" #include "openfpga_context.h" #include "openfpga_sdc_command.h" @@ -12,7 +13,7 @@ #include "vpr_command.h" OpenfpgaShell::OpenfpgaShell() { - shell_.set_name("OpenFPGA"); + shell_.set_name("OpenFPGA"); shell_.add_title(create_openfpga_title().c_str()); /* Add vpr commands */ diff --git a/openfpga/src/base/openfpga_shell.h b/openfpga/src/base/openfpga_shell.h index f192ca5f7..608e0b988 100644 --- a/openfpga/src/base/openfpga_shell.h +++ b/openfpga/src/base/openfpga_shell.h @@ -2,8 +2,9 @@ #define OPENFPGA_SHELL_H #include -#include "shell.h" + #include "openfpga_context.h" +#include "shell.h" /******************************************************************** * This is a shell class built on top of the general-purpose shell @@ -12,30 +13,35 @@ * - It includes all the commands available in OpenFPGA *******************************************************************/ class OpenfpgaShell { - public: /* Contructors */ - OpenfpgaShell(); - public: /* Mutators */ - /* Execute a specific command with options in a line, which is available in the shell - * Note that running a command will be based on the current status of data storage. - * The data storage is impacted by previous commands that have been run. - * If you want a clear start, please call API reset() before running a command. - * Running a command may cause modification to data storage. */ - int run_command(const char* cmd_line); + public: /* Contructors */ + OpenfpgaShell(); - /* Start the shell with options. For detailed usage, please refer to online documentation about openfpgashell - * Depending on the options, a shell may run in - * - an interactive mode, where users can type in commands and get results - * or - * - an batch mode, where users provide a script contains a set of commands to execute - * TODO: the shell always has a clean start (refreshed data storage). - */ - int start(int argc, char** argv); + public: /* Mutators */ + /* Execute a specific command with options in a line, which is available in + * the shell Note that running a command will be based on the current status + * of data storage. The data storage is impacted by previous commands that + * have been run. If you want a clear start, please call API reset() before + * running a command. Running a command may cause modification to data + * storage. */ + int run_command(const char* cmd_line); - /* Reset the data storage and shell status, to ensure a clean start */ - void reset(); - private: /* Internal data */ - openfpga::Shell shell_; - OpenfpgaContext openfpga_ctx_; + /* Start the shell with options. For detailed usage, please refer to online + * documentation about openfpgashell Depending on the options, a shell may run + * in + * - an interactive mode, where users can type in commands and get results + * or + * - an batch mode, where users provide a script contains a set of commands to + * execute + * TODO: the shell always has a clean start (refreshed data storage). + */ + int start(int argc, char** argv); + + /* Reset the data storage and shell status, to ensure a clean start */ + void reset(); + + private: /* Internal data */ + openfpga::Shell shell_; + OpenfpgaContext openfpga_ctx_; }; #endif