From 7f426d59394a760908402cd0d07eca94fc43dfa4 Mon Sep 17 00:00:00 2001 From: Lin Date: Fri, 2 Aug 2024 03:10:10 -0700 Subject: [PATCH] add commands --- .../base/openfpga_setup_command_template.h | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/openfpga/src/base/openfpga_setup_command_template.h b/openfpga/src/base/openfpga_setup_command_template.h index 42816029c..01e2f78cb 100644 --- a/openfpga/src/base/openfpga_setup_command_template.h +++ b/openfpga/src/base/openfpga_setup_command_template.h @@ -924,7 +924,6 @@ ShellCommandId add_write_fabric_pin_physical_location_command_template( return shell_cmd_id; } - /******************************************************************** * - Add a command to Shell environment: read_unique_blocks * - Add associated options @@ -937,22 +936,24 @@ ShellCommandId add_read_unique_blocks_command_template( Command shell_cmd("read_unique_blocks"); /* Add an option '--file' */ - shell_cmd.add_option( - "file", true, - "unique blocks xml file"); + CommandOptionId opt_file = + shell_cmd.add_option("file", true, "specify the unique blocks xml file"); + shell_cmd.set_option_require_value(opt_file, openfpga::OPT_STRING); /* Add an option '--type' */ - shell_cmd.add_option("type", true, - "the file type of input file"); + CommandOptionId opt_type = shell_cmd.add_option( + "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' */ shell_cmd.add_option("verbose", false, "Show verbose outputs"); /* Add command 'compact_routing_hierarchy' to the Shell */ - ShellCommandId shell_cmd_id = shell.add_command( - shell_cmd, "Preload unique blocks from xml file", hidden); + ShellCommandId shell_cmd_id = + 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_execute_function(shell_cmd_id, read_unique_blocks_template); + shell.set_command_execute_function(shell_cmd_id, + read_unique_blocks_template); /* Add command dependency to the Shell */ shell.set_command_dependency(shell_cmd_id, dependent_cmds); @@ -960,7 +961,6 @@ ShellCommandId add_read_unique_blocks_command_template( return shell_cmd_id; } - /******************************************************************** * - Add a command to Shell environment: write_unique_blocks * - Add associated options @@ -973,22 +973,24 @@ ShellCommandId add_write_unique_blocks_command_template( Command shell_cmd("write_unique_blocks"); /* Add an option '--file' */ - shell_cmd.add_option( - "file", true, - "unique blocks xml file"); + CommandOptionId opt_file = + shell_cmd.add_option("file", true, "specify the unique blocks xml file"); + shell_cmd.set_option_require_value(opt_file, openfpga::OPT_STRING); /* Add an option '--type' */ - shell_cmd.add_option("type", true, - "the file type of input file"); + CommandOptionId opt_type = shell_cmd.add_option( + "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' */ shell_cmd.add_option("verbose", false, "Show verbose outputs"); /* Add command 'compact_routing_hierarchy' to the Shell */ - ShellCommandId shell_cmd_id = shell.add_command( - shell_cmd, "Preload unique blocks from xml file", hidden); + ShellCommandId shell_cmd_id = + 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_execute_function(shell_cmd_id, write_unique_blocks_template); + shell.set_command_execute_function(shell_cmd_id, + write_unique_blocks_template); /* Add command dependency to the Shell */ shell.set_command_dependency(shell_cmd_id, dependent_cmds); @@ -996,7 +998,6 @@ ShellCommandId add_write_unique_blocks_command_template( return shell_cmd_id; } - template void add_setup_command_templates(openfpga::Shell& shell, const bool& hidden = false) { @@ -1253,15 +1254,15 @@ void add_setup_command_templates(openfpga::Shell& shell, * Command 'read_unique_blocks' */ add_read_unique_blocks_command_template( - shell, openfpga_setup_cmd_class, std::vector(), hidden); + shell, openfpga_setup_cmd_class, std::vector(), + hidden); /******************************** * Command 'write_unique_blocks' */ add_write_unique_blocks_command_template( - shell, openfpga_setup_cmd_class, std::vector(), hidden); - - + shell, openfpga_setup_cmd_class, std::vector(), + hidden); } } /* end namespace openfpga */