add commands

This commit is contained in:
Lin 2024-08-02 03:10:10 -07:00
parent 48a386c9b6
commit 7f426d5939
1 changed files with 24 additions and 23 deletions

View File

@ -924,7 +924,6 @@ ShellCommandId add_write_fabric_pin_physical_location_command_template(
return shell_cmd_id; return shell_cmd_id;
} }
/******************************************************************** /********************************************************************
* - Add a command to Shell environment: read_unique_blocks * - Add a command to Shell environment: read_unique_blocks
* - Add associated options * - Add associated options
@ -937,22 +936,24 @@ ShellCommandId add_read_unique_blocks_command_template(
Command shell_cmd("read_unique_blocks"); Command shell_cmd("read_unique_blocks");
/* Add an option '--file' */ /* Add an option '--file' */
shell_cmd.add_option( CommandOptionId opt_file =
"file", true, shell_cmd.add_option("file", true, "specify the unique blocks xml file");
"unique blocks xml file"); shell_cmd.set_option_require_value(opt_file, openfpga::OPT_STRING);
/* Add an option '--type' */ /* Add an option '--type' */
shell_cmd.add_option("type", true, CommandOptionId opt_type = shell_cmd.add_option(
"the file type of input file"); "type", true, "specify the type of the unique blocks xml file");
shell_cmd.set_option_require_value(opt_type, openfpga::OPT_STRING);
/* Add an option '--verbose' */ /* Add an option '--verbose' */
shell_cmd.add_option("verbose", false, "Show verbose outputs"); shell_cmd.add_option("verbose", false, "Show verbose outputs");
/* Add command 'compact_routing_hierarchy' to the Shell */ /* Add command 'compact_routing_hierarchy' to the Shell */
ShellCommandId shell_cmd_id = shell.add_command( ShellCommandId shell_cmd_id =
shell_cmd, "Preload unique blocks from xml file", hidden); shell.add_command(shell_cmd, "Preload unique blocks from xml file", hidden);
shell.set_command_class(shell_cmd_id, cmd_class_id); shell.set_command_class(shell_cmd_id, cmd_class_id);
shell.set_command_execute_function(shell_cmd_id, read_unique_blocks_template<T>); shell.set_command_execute_function(shell_cmd_id,
read_unique_blocks_template<T>);
/* Add command dependency to the Shell */ /* Add command dependency to the Shell */
shell.set_command_dependency(shell_cmd_id, dependent_cmds); shell.set_command_dependency(shell_cmd_id, dependent_cmds);
@ -960,7 +961,6 @@ ShellCommandId add_read_unique_blocks_command_template(
return shell_cmd_id; return shell_cmd_id;
} }
/******************************************************************** /********************************************************************
* - Add a command to Shell environment: write_unique_blocks * - Add a command to Shell environment: write_unique_blocks
* - Add associated options * - Add associated options
@ -973,22 +973,24 @@ ShellCommandId add_write_unique_blocks_command_template(
Command shell_cmd("write_unique_blocks"); Command shell_cmd("write_unique_blocks");
/* Add an option '--file' */ /* Add an option '--file' */
shell_cmd.add_option( CommandOptionId opt_file =
"file", true, shell_cmd.add_option("file", true, "specify the unique blocks xml file");
"unique blocks xml file"); shell_cmd.set_option_require_value(opt_file, openfpga::OPT_STRING);
/* Add an option '--type' */ /* Add an option '--type' */
shell_cmd.add_option("type", true, CommandOptionId opt_type = shell_cmd.add_option(
"the file type of input file"); "type", true, "specify the type of the unique blocks xml file");
shell_cmd.set_option_require_value(opt_type, openfpga::OPT_STRING);
/* Add an option '--verbose' */ /* Add an option '--verbose' */
shell_cmd.add_option("verbose", false, "Show verbose outputs"); shell_cmd.add_option("verbose", false, "Show verbose outputs");
/* Add command 'compact_routing_hierarchy' to the Shell */ /* Add command 'compact_routing_hierarchy' to the Shell */
ShellCommandId shell_cmd_id = shell.add_command( ShellCommandId shell_cmd_id =
shell_cmd, "Preload unique blocks from xml file", hidden); shell.add_command(shell_cmd, "Preload unique blocks from xml file", hidden);
shell.set_command_class(shell_cmd_id, cmd_class_id); shell.set_command_class(shell_cmd_id, cmd_class_id);
shell.set_command_execute_function(shell_cmd_id, write_unique_blocks_template<T>); shell.set_command_execute_function(shell_cmd_id,
write_unique_blocks_template<T>);
/* Add command dependency to the Shell */ /* Add command dependency to the Shell */
shell.set_command_dependency(shell_cmd_id, dependent_cmds); shell.set_command_dependency(shell_cmd_id, dependent_cmds);
@ -996,7 +998,6 @@ ShellCommandId add_write_unique_blocks_command_template(
return shell_cmd_id; return shell_cmd_id;
} }
template <class T> template <class T>
void add_setup_command_templates(openfpga::Shell<T>& shell, void add_setup_command_templates(openfpga::Shell<T>& shell,
const bool& hidden = false) { const bool& hidden = false) {
@ -1253,15 +1254,15 @@ void add_setup_command_templates(openfpga::Shell<T>& shell,
* Command 'read_unique_blocks' * Command 'read_unique_blocks'
*/ */
add_read_unique_blocks_command_template<T>( add_read_unique_blocks_command_template<T>(
shell, openfpga_setup_cmd_class, std::vector<openfpga::ShellCommandId>(), hidden); shell, openfpga_setup_cmd_class, std::vector<openfpga::ShellCommandId>(),
hidden);
/******************************** /********************************
* Command 'write_unique_blocks' * Command 'write_unique_blocks'
*/ */
add_write_unique_blocks_command_template<T>( add_write_unique_blocks_command_template<T>(
shell, openfpga_setup_cmd_class, std::vector<openfpga::ShellCommandId>(), hidden); shell, openfpga_setup_cmd_class, std::vector<openfpga::ShellCommandId>(),
hidden);
} }
} /* end namespace openfpga */ } /* end namespace openfpga */