[core] format

This commit is contained in:
tangxifan 2023-06-18 21:18:35 -07:00
parent cef573529d
commit bdda695cc0
3 changed files with 12 additions and 11 deletions

View File

@ -117,8 +117,8 @@ void fpga_fabric_verilog(
/* Generate FPGA fabric */ /* Generate FPGA fabric */
print_verilog_core_module(netlist_manager, print_verilog_core_module(netlist_manager,
const_cast<const ModuleManager &>(module_manager), const_cast<const ModuleManager &>(module_manager),
src_dir_path, options); src_dir_path, options);
print_verilog_top_module(netlist_manager, print_verilog_top_module(netlist_manager,
const_cast<const ModuleManager &>(module_manager), const_cast<const ModuleManager &>(module_manager),
src_dir_path, options); src_dir_path, options);

View File

@ -25,14 +25,15 @@ namespace openfpga {
* Print the wrapper module for the FPGA fabric in Verilog format * Print the wrapper module for the FPGA fabric in Verilog format
*******************************************************************/ *******************************************************************/
void print_verilog_core_module(NetlistManager& netlist_manager, void print_verilog_core_module(NetlistManager& netlist_manager,
const ModuleManager& module_manager, const ModuleManager& module_manager,
const std::string& verilog_dir, const std::string& verilog_dir,
const FabricVerilogOption& options) { const FabricVerilogOption& options) {
/* Create a module as the top-level fabric, and add it to the module manager /* Create a module as the top-level fabric, and add it to the module manager
*/ */
std::string core_module_name = generate_fpga_core_module_name(); std::string core_module_name = generate_fpga_core_module_name();
ModuleId core_module = module_manager.find_module(core_module_name); ModuleId core_module = module_manager.find_module(core_module_name);
/* It could happen that the module does not exist, just return with no errors */ /* It could happen that the module does not exist, just return with no errors
*/
if (!module_manager.valid_module_id(core_module)) { if (!module_manager.valid_module_id(core_module)) {
return; return;
} }
@ -52,8 +53,8 @@ void print_verilog_core_module(NetlistManager& netlist_manager,
check_file_stream(verilog_fpath.c_str(), fp); check_file_stream(verilog_fpath.c_str(), fp);
print_verilog_file_header( print_verilog_file_header(fp, std::string("Wrapper Verilog module for FPGA"),
fp, std::string("Wrapper Verilog module for FPGA"), options.time_stamp()); options.time_stamp());
/* Write the module content in Verilog format */ /* Write the module content in Verilog format */
write_verilog_module_to_file(fp, module_manager, core_module, write_verilog_module_to_file(fp, module_manager, core_module,

View File

@ -18,9 +18,9 @@
namespace openfpga { namespace openfpga {
void print_verilog_core_module(NetlistManager& netlist_manager, void print_verilog_core_module(NetlistManager& netlist_manager,
const ModuleManager& module_manager, const ModuleManager& module_manager,
const std::string& verilog_dir, const std::string& verilog_dir,
const FabricVerilogOption& options); const FabricVerilogOption& options);
void print_verilog_top_module(NetlistManager& netlist_manager, void print_verilog_top_module(NetlistManager& netlist_manager,
const ModuleManager& module_manager, const ModuleManager& module_manager,