[core] code format

This commit is contained in:
tangxifan 2023-09-17 13:29:30 -07:00
parent 0ef1e0bde5
commit 72a3c05747
4 changed files with 21 additions and 18 deletions

View File

@ -4,9 +4,9 @@
*******************************************************************/
/* Headers from system goes first */
#include <algorithm>
#include <string>
#include <chrono>
#include <ctime>
#include <string>
/* Headers from vtr util library */
#include "vtr_assert.h"
@ -28,8 +28,8 @@ namespace openfpga { // Begin namespace openfpga
/********************************************************************
* This function write header information to a bitstream file
*******************************************************************/
static void write_xml_module_name_map_file_head(std::fstream& fp,
const bool& include_time_stamp) {
static void write_xml_module_name_map_file_head(
std::fstream& fp, const bool& include_time_stamp) {
valid_file_stream(fp);
fp << "<!--" << std::endl;
@ -47,7 +47,6 @@ static void write_xml_module_name_map_file_head(std::fstream& fp,
fp << std::endl;
}
/********************************************************************
* A writer to output a I/O name mapping to XML format
*

View File

@ -30,7 +30,8 @@ int main(int argc, const char** argv) {
* This is optional only used when there is a second argument
*/
if (3 <= argc) {
status = openfpga::write_xml_module_name_map(argv[2], module_name_map, true, true);
status =
openfpga::write_xml_module_name_map(argv[2], module_name_map, true, true);
VTR_LOG("Write the module name mapping to an XML file: %s.\n", argv[2]);
}

View File

@ -19,11 +19,11 @@
#include "read_xml_fabric_key.h"
#include "read_xml_io_name_map.h"
#include "read_xml_module_name_map.h"
#include "write_xml_module_name_map.h"
#include "read_xml_tile_config.h"
#include "rename_modules.h"
#include "vtr_log.h"
#include "vtr_time.h"
#include "write_xml_module_name_map.h"
/* begin namespace openfpga */
namespace openfpga {
@ -377,8 +377,9 @@ int rename_modules_template(T& openfpga_ctx, const Command& cmd,
* Write module naming rules to a file
*******************************************************************/
template <class T>
int write_module_naming_rules_template(const T& openfpga_ctx, const Command& cmd,
const CommandContext& cmd_context) {
int write_module_naming_rules_template(const T& openfpga_ctx,
const Command& cmd,
const CommandContext& cmd_context) {
CommandOptionId opt_verbose = cmd.option("verbose");
CommandOptionId opt_no_time_stamp = cmd.option("no_time_stamp");
@ -393,12 +394,12 @@ int write_module_naming_rules_template(const T& openfpga_ctx, const Command& cmd
std::string file_name = cmd_context.option_value(cmd, opt_file);
/* Write hierarchy to a file */
return write_xml_module_name_map(file_name.c_str(), openfpga_ctx.module_name_map(),
!cmd_context.option_enable(cmd, opt_no_time_stamp),
cmd_context.option_enable(cmd, opt_verbose));
return write_xml_module_name_map(
file_name.c_str(), openfpga_ctx.module_name_map(),
!cmd_context.option_enable(cmd, opt_no_time_stamp),
cmd_context.option_enable(cmd, opt_verbose));
}
} /* end namespace openfpga */
#endif

View File

@ -845,9 +845,12 @@ ShellCommandId add_write_module_naming_rules_command_template(
/* Add command to the Shell */
ShellCommandId shell_cmd_id = shell.add_command(
shell_cmd, "Output the naming rules for each module of an FPGA fabric to a given file", hidden);
shell_cmd,
"Output the naming rules for each module of an FPGA fabric to a given file",
hidden);
shell.set_command_class(shell_cmd_id, cmd_class_id);
shell.set_command_const_execute_function(shell_cmd_id, write_module_naming_rules_template<T>);
shell.set_command_const_execute_function(
shell_cmd_id, write_module_naming_rules_template<T>);
/* Add command dependency to the Shell */
shell.set_command_dependency(shell_cmd_id, dependent_cmds);
@ -855,7 +858,6 @@ ShellCommandId add_write_module_naming_rules_command_template(
return shell_cmd_id;
}
template <class T>
void add_setup_command_templates(openfpga::Shell<T>& shell,
const bool& hidden = false) {
@ -1093,9 +1095,9 @@ void add_setup_command_templates(openfpga::Shell<T>& shell,
* 'build_fabric' */
std::vector<ShellCommandId> cmd_dependency_write_module_naming_rules;
cmd_dependency_write_module_naming_rules.push_back(build_fabric_cmd_id);
add_write_module_naming_rules_command_template<T>(shell, openfpga_setup_cmd_class,
cmd_dependency_write_module_naming_rules, hidden);
add_write_module_naming_rules_command_template<T>(
shell, openfpga_setup_cmd_class, cmd_dependency_write_module_naming_rules,
hidden);
}
} /* end namespace openfpga */