[engine] format

This commit is contained in:
tangxifan 2022-11-24 21:04:04 -08:00
parent 24a174c7a4
commit f1a317b384
2 changed files with 33 additions and 26 deletions

View File

@ -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 */

View File

@ -2,8 +2,9 @@
#define OPENFPGA_SHELL_H
#include <string>
#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<OpenfpgaContext> 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<OpenfpgaContext> shell_;
OpenfpgaContext openfpga_ctx_;
};
#endif