[core] format

This commit is contained in:
tangxifan 2023-01-06 17:50:47 -08:00
parent 12134f4106
commit 401b640852
6 changed files with 58 additions and 59 deletions

View File

@ -1,6 +1,7 @@
#include "openfpga_spice_command_template.h"
#include "openfpga_spice_command.h"
#include "openfpga_spice_command_template.h"
/* begin namespace openfpga */
namespace openfpga {

View File

@ -24,8 +24,8 @@
* - TODO: generate_spice_sb_routing_testbench : generate SPICE testbenches for
*routing circuit inside switch blocks
*******************************************************************/
#include "shell.h"
#include "openfpga_spice_template.h"
#include "shell.h"
/* begin namespace openfpga */
namespace openfpga {
@ -37,8 +37,7 @@ namespace openfpga {
*******************************************************************/
template <class T>
ShellCommandId add_write_fabric_spice_command_template(
openfpga::Shell<T>& shell,
const ShellCommandClassId& cmd_class_id,
openfpga::Shell<T>& shell, const ShellCommandClassId& cmd_class_id,
const std::vector<ShellCommandId>& dependent_cmds) {
Command shell_cmd("write_fabric_spice");
@ -59,7 +58,8 @@ ShellCommandId add_write_fabric_spice_command_template(
ShellCommandId shell_cmd_id = shell.add_command(
shell_cmd, "generate SPICE netlists modeling full FPGA fabric");
shell.set_command_class(shell_cmd_id, cmd_class_id);
shell.set_command_execute_function(shell_cmd_id, write_fabric_spice_template<T>);
shell.set_command_execute_function(shell_cmd_id,
write_fabric_spice_template<T>);
/* Add command dependency to the Shell */
shell.set_command_dependency(shell_cmd_id, dependent_cmds);

View File

@ -1,13 +1,13 @@
#ifndef OPENFPGA_SPICE_TEMPLATE_H
#define OPENFPGA_SPICE_TEMPLATE_H
#include "vtr_log.h"
#include "vtr_time.h"
#include "command_exit_codes.h"
#include "spice_api.h"
#include "command.h"
#include "command_context.h"
#include "command_exit_codes.h"
#include "globals.h"
#include "spice_api.h"
#include "vtr_log.h"
#include "vtr_time.h"
/* begin namespace openfpga */
namespace openfpga {

View File

@ -5,9 +5,10 @@
* - generate_fabric_verilog : generate Verilog netlists about FPGA fabric
* - generate_fabric_verilog_testbench : TODO: generate Verilog testbenches
*******************************************************************/
#include "openfpga_verilog_command_template.h"
#include "openfpga_verilog_command.h"
#include "openfpga_verilog_command_template.h"
/* begin namespace openfpga */
namespace openfpga {

View File

@ -20,8 +20,7 @@ namespace openfpga {
*******************************************************************/
template <class T>
ShellCommandId add_write_fabric_verilog_command_template(
openfpga::Shell<T>& shell,
const ShellCommandClassId& cmd_class_id,
openfpga::Shell<T>& shell, const ShellCommandClassId& cmd_class_id,
const std::vector<ShellCommandId>& dependent_cmds) {
Command shell_cmd("write_fabric_verilog");
@ -67,7 +66,8 @@ ShellCommandId add_write_fabric_verilog_command_template(
ShellCommandId shell_cmd_id = shell.add_command(
shell_cmd, "generate Verilog netlists modeling full FPGA fabric");
shell.set_command_class(shell_cmd_id, cmd_class_id);
shell.set_command_execute_function(shell_cmd_id, write_fabric_verilog_template<T>);
shell.set_command_execute_function(shell_cmd_id,
write_fabric_verilog_template<T>);
/* Add command dependency to the Shell */
shell.set_command_dependency(shell_cmd_id, dependent_cmds);
@ -82,8 +82,7 @@ ShellCommandId add_write_fabric_verilog_command_template(
*******************************************************************/
template <class T>
ShellCommandId add_write_full_testbench_command_template(
openfpga::Shell<T>& shell,
const ShellCommandClassId& cmd_class_id,
openfpga::Shell<T>& shell, const ShellCommandClassId& cmd_class_id,
const std::vector<ShellCommandId>& dependent_cmds) {
Command shell_cmd("write_full_testbench");
@ -165,7 +164,8 @@ ShellCommandId add_write_full_testbench_command_template(
ShellCommandId shell_cmd_id = shell.add_command(
shell_cmd, "generate full testbenches for an fpga fabric");
shell.set_command_class(shell_cmd_id, cmd_class_id);
shell.set_command_execute_function(shell_cmd_id, write_full_testbench_template<T>);
shell.set_command_execute_function(shell_cmd_id,
write_full_testbench_template<T>);
/* add command dependency to the shell */
shell.set_command_dependency(shell_cmd_id, dependent_cmds);
@ -180,8 +180,7 @@ ShellCommandId add_write_full_testbench_command_template(
*******************************************************************/
template <class T>
ShellCommandId add_write_preconfigured_fabric_wrapper_command_template(
openfpga::Shell<T>& shell,
const ShellCommandClassId& cmd_class_id,
openfpga::Shell<T>& shell, const ShellCommandClassId& cmd_class_id,
const std::vector<ShellCommandId>& dependent_cmds) {
Command shell_cmd("write_preconfigured_fabric_wrapper");
@ -243,8 +242,8 @@ ShellCommandId add_write_preconfigured_fabric_wrapper_command_template(
ShellCommandId shell_cmd_id = shell.add_command(
shell_cmd, "generate a wrapper for a pre-configured fpga fabric");
shell.set_command_class(shell_cmd_id, cmd_class_id);
shell.set_command_execute_function(shell_cmd_id,
write_preconfigured_fabric_wrapper_template<T>);
shell.set_command_execute_function(
shell_cmd_id, write_preconfigured_fabric_wrapper_template<T>);
/* add command dependency to the shell */
shell.set_command_dependency(shell_cmd_id, dependent_cmds);
@ -259,8 +258,7 @@ ShellCommandId add_write_preconfigured_fabric_wrapper_command_template(
*******************************************************************/
template <class T>
ShellCommandId add_write_preconfigured_testbench_command_template(
openfpga::Shell<T>& shell,
const ShellCommandClassId& cmd_class_id,
openfpga::Shell<T>& shell, const ShellCommandClassId& cmd_class_id,
const std::vector<ShellCommandId>& dependent_cmds) {
Command shell_cmd("write_preconfigured_testbench");
@ -339,8 +337,7 @@ ShellCommandId add_write_preconfigured_testbench_command_template(
*******************************************************************/
template <class T>
ShellCommandId add_write_simulation_task_info_command_template(
openfpga::Shell<T>& shell,
const ShellCommandClassId& cmd_class_id,
openfpga::Shell<T>& shell, const ShellCommandClassId& cmd_class_id,
const std::vector<ShellCommandId>& dependent_cmds) {
Command shell_cmd("write_simulation_task_info");
@ -385,7 +382,8 @@ ShellCommandId add_write_simulation_task_info_command_template(
ShellCommandId shell_cmd_id = shell.add_command(
shell_cmd, "generate an interchangable simulation task configuration file");
shell.set_command_class(shell_cmd_id, cmd_class_id);
shell.set_command_execute_function(shell_cmd_id, write_simulation_task_info_template<T>);
shell.set_command_execute_function(shell_cmd_id,
write_simulation_task_info_template<T>);
/* Add command dependency to the Shell */
shell.set_command_dependency(shell_cmd_id, dependent_cmds);
@ -411,8 +409,8 @@ void add_verilog_command_templates(openfpga::Shell<T>& shell) {
* 'build_fabric' */
std::vector<ShellCommandId> fabric_verilog_dependent_cmds;
fabric_verilog_dependent_cmds.push_back(build_fabric_cmd_id);
add_write_fabric_verilog_command_template<T>(shell, openfpga_verilog_cmd_class,
fabric_verilog_dependent_cmds);
add_write_fabric_verilog_command_template<T>(
shell, openfpga_verilog_cmd_class, fabric_verilog_dependent_cmds);
/********************************
* Command 'write_full_testbench'
@ -421,8 +419,8 @@ void add_verilog_command_templates(openfpga::Shell<T>& shell) {
* 'build_fabric' */
std::vector<ShellCommandId> full_testbench_dependent_cmds;
full_testbench_dependent_cmds.push_back(build_fabric_cmd_id);
add_write_full_testbench_command_template<T>(shell, openfpga_verilog_cmd_class,
full_testbench_dependent_cmds);
add_write_full_testbench_command_template<T>(
shell, openfpga_verilog_cmd_class, full_testbench_dependent_cmds);
/********************************
* Command 'write_preconfigured_fabric_wrapper'

View File

@ -4,16 +4,16 @@
/********************************************************************
* This file includes functions to compress the hierachy of routing architecture
*******************************************************************/
#include "vtr_log.h"
#include "vtr_time.h"
#include "command_exit_codes.h"
#include "openfpga_scale.h"
#include "command.h"
#include "command_context.h"
#include "verilog_api.h"
#include "read_xml_pin_constraints.h"
#include "read_xml_bus_group.h"
#include "command_exit_codes.h"
#include "globals.h"
#include "openfpga_scale.h"
#include "read_xml_bus_group.h"
#include "read_xml_pin_constraints.h"
#include "verilog_api.h"
#include "vtr_log.h"
#include "vtr_time.h"
/* begin namespace openfpga */
namespace openfpga {
@ -72,8 +72,7 @@ int write_fabric_verilog_template(T& openfpga_ctx, const Command& cmd,
* A wrapper function to call the full testbench generator of FPGA-Verilog
*******************************************************************/
template <class T>
int write_full_testbench_template(const T& openfpga_ctx,
const Command& cmd,
int write_full_testbench_template(const T& openfpga_ctx, const Command& cmd,
const CommandContext& cmd_context) {
CommandOptionId opt_output_dir = cmd.option("file");
CommandOptionId opt_bitstream = cmd.option("bitstream");
@ -146,8 +145,8 @@ int write_full_testbench_template(const T& openfpga_ctx,
*FPGA-Verilog
*******************************************************************/
template <class T>
int write_preconfigured_fabric_wrapper_template(const T& openfpga_ctx,
const Command& cmd,
int write_preconfigured_fabric_wrapper_template(
const T& openfpga_ctx, const Command& cmd,
const CommandContext& cmd_context) {
CommandOptionId opt_output_dir = cmd.option("file");
CommandOptionId opt_fabric_netlist = cmd.option("fabric_netlist_file_path");