2020-02-27 13:33:09 -06:00
|
|
|
#ifndef VERILOG_TESTBENCH_OPTIONS_H
|
|
|
|
#define VERILOG_TESTBENCH_OPTIONS_H
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* Include header files required by the data structure definition
|
|
|
|
*******************************************************************/
|
|
|
|
#include <string>
|
2021-06-14 12:37:49 -05:00
|
|
|
#include "verilog_port_types.h"
|
2020-02-27 13:33:09 -06:00
|
|
|
|
|
|
|
/* Begin namespace openfpga */
|
|
|
|
namespace openfpga {
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* Options for Verilog Testbench generator
|
|
|
|
* Typicall usage:
|
|
|
|
* VerilogTestbench verilog_tb_opt();
|
|
|
|
* // Set options
|
|
|
|
* ...
|
|
|
|
*
|
|
|
|
*******************************************************************/
|
|
|
|
class VerilogTestbenchOption {
|
|
|
|
public: /* Public constructor */
|
|
|
|
/* Set default options */
|
|
|
|
VerilogTestbenchOption();
|
|
|
|
public: /* Public accessors */
|
|
|
|
std::string output_directory() const;
|
2020-10-12 13:31:51 -05:00
|
|
|
std::string fabric_netlist_file_path() const;
|
2020-02-27 14:24:26 -06:00
|
|
|
std::string reference_benchmark_file_path() const;
|
2020-05-29 19:07:21 -05:00
|
|
|
bool fast_configuration() const;
|
2020-02-27 13:33:09 -06:00
|
|
|
bool print_formal_verification_top_netlist() const;
|
|
|
|
bool print_preconfig_top_testbench() const;
|
|
|
|
bool print_top_testbench() const;
|
|
|
|
bool print_simulation_ini() const;
|
|
|
|
std::string simulation_ini_path() const;
|
2020-05-22 15:40:05 -05:00
|
|
|
bool explicit_port_mapping() const;
|
2020-11-22 17:01:31 -06:00
|
|
|
bool include_signal_init() const;
|
|
|
|
bool support_icarus_simulator() const;
|
2021-06-14 12:37:49 -05:00
|
|
|
e_verilog_default_net_type default_net_type() const;
|
2021-06-25 11:33:29 -05:00
|
|
|
float time_unit() const;
|
2020-02-27 13:33:09 -06:00
|
|
|
bool verbose_output() const;
|
|
|
|
public: /* Public validator */
|
|
|
|
bool validate() const;
|
|
|
|
public: /* Public mutators */
|
|
|
|
void set_output_directory(const std::string& output_dir);
|
|
|
|
/* The reference verilog file path is the key parameters that will have an impact on other options:
|
|
|
|
* - print_preconfig_top_testbench
|
|
|
|
* - print_top_testbench
|
|
|
|
* If the file path is empty, the above testbench generation will not be enabled
|
|
|
|
*/
|
2020-02-27 14:24:26 -06:00
|
|
|
void set_reference_benchmark_file_path(const std::string& reference_benchmark_file_path);
|
2020-10-12 13:31:51 -05:00
|
|
|
/* The fabric netlist file path is an optional parameter
|
|
|
|
* to allow users to specify a fabric netlist at another location
|
|
|
|
*/
|
|
|
|
void set_fabric_netlist_file_path(const std::string& fabric_netlist_file_path);
|
2020-02-27 13:33:09 -06:00
|
|
|
void set_print_formal_verification_top_netlist(const bool& enabled);
|
|
|
|
/* The preconfig top testbench generation can be enabled only when formal verification top netlist is enabled */
|
|
|
|
void set_print_preconfig_top_testbench(const bool& enabled);
|
2020-05-29 19:07:21 -05:00
|
|
|
void set_fast_configuration(const bool& enabled);
|
2020-02-27 13:33:09 -06:00
|
|
|
void set_print_top_testbench(const bool& enabled);
|
|
|
|
void set_print_simulation_ini(const std::string& simulation_ini_path);
|
2020-05-22 15:40:05 -05:00
|
|
|
void set_explicit_port_mapping(const bool& enabled);
|
2020-11-22 17:01:31 -06:00
|
|
|
void set_include_signal_init(const bool& enabled);
|
|
|
|
void set_support_icarus_simulator(const bool& enabled);
|
2021-06-14 12:37:49 -05:00
|
|
|
void set_default_net_type(const std::string& default_net_type);
|
2021-06-25 11:33:29 -05:00
|
|
|
void set_time_unit(const float& time_unit);
|
2020-02-27 13:33:09 -06:00
|
|
|
void set_verbose_output(const bool& enabled);
|
|
|
|
private: /* Internal Data */
|
|
|
|
std::string output_directory_;
|
2020-10-12 13:31:51 -05:00
|
|
|
std::string fabric_netlist_file_path_;
|
2020-02-27 14:24:26 -06:00
|
|
|
std::string reference_benchmark_file_path_;
|
2020-05-29 19:07:21 -05:00
|
|
|
bool fast_configuration_;
|
2020-02-27 13:33:09 -06:00
|
|
|
bool print_formal_verification_top_netlist_;
|
|
|
|
bool print_preconfig_top_testbench_;
|
|
|
|
bool print_top_testbench_;
|
|
|
|
/* Print simulation ini is enabled only when the path is not empty */
|
|
|
|
std::string simulation_ini_path_;
|
2020-05-22 15:40:05 -05:00
|
|
|
bool explicit_port_mapping_;
|
2020-11-22 17:01:31 -06:00
|
|
|
bool support_icarus_simulator_;
|
|
|
|
bool include_signal_init_;
|
2021-06-14 12:37:49 -05:00
|
|
|
e_verilog_default_net_type default_net_type_;
|
2021-06-25 11:33:29 -05:00
|
|
|
float time_unit_;
|
2020-02-27 13:33:09 -06:00
|
|
|
bool verbose_output_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} /* End namespace openfpga*/
|
|
|
|
|
|
|
|
#endif
|