![]() |
PandA-2024.02
|
#include <SimulationTool.hpp>


Public Types | |
| using | type_t = enum { UNKNOWN=0, MODELSIM, XSIM, VERILATOR } |
| supported synthesis tools More... | |
Public Member Functions | |
| SimulationTool (const ParameterConstRef &Param, const std::string &top_fname, const std::string &inc_dirs) | |
| Constructor. More... | |
| virtual | ~SimulationTool () |
| Destructor. More... | |
| virtual void | CheckExecution () |
| Checks if the current specification can be executed or not. More... | |
| virtual std::string | GenerateSimulationScript (const std::string &top_filename, std::list< std::string > file_list) |
| Generates the proper simulation script. More... | |
| virtual void | Simulate (unsigned long long &accum_cycles, unsigned long long &n_testcases) |
| Performs the simulation and returns the number of cycles. More... | |
| void | DetermineCycles (unsigned long long int &accum_cycles, unsigned long long &n_testcases) |
| Determines the average number of cycles for the simulation(s) More... | |
| virtual void | Clean () const |
| Remove files created during simulation FIXME: this should become pure virtual. More... | |
Static Public Member Functions | |
| static type_t | to_sim_type (const std::string &str) |
| static SimulationToolRef | CreateSimulationTool (type_t type, const ParameterConstRef &Param, const std::string &suffix, const std::string &top_fname, const std::string &inc_dirs) |
| Factory method. More... | |
Protected Member Functions | |
| virtual std::string | GenerateScript (std::ostream &script, const std::string &top_filename, const std::list< std::string > &file_list)=0 |
| Performs the actual writing. More... | |
| std::string | GenerateLibraryBuildScript (std::ostream &script, const std::string &libtb_filename, std::string &beh_cflags) const |
Protected Attributes | |
| const ParameterConstRef | Param |
| class containing all the parameters More... | |
| int | debug_level |
| debug level of the class More... | |
| unsigned int | output_level |
| verbosity level of the class More... | |
| const std::string | top_fname |
| std::string | generated_script |
| generated script More... | |
| std::string | log_file |
| log file More... | |
| const std::string | inc_dirs |
| comma separated list of include dirs More... | |
Definition at line 53 of file SimulationTool.hpp.
| using SimulationTool::type_t = enum { UNKNOWN = 0, MODELSIM, XSIM, VERILATOR } |
supported synthesis tools
Definition at line 57 of file SimulationTool.hpp.
|
explicit |
Constructor.
Definition at line 85 of file SimulationTool.cpp.
References ~SimulationTool().

|
virtualdefault |
|
virtual |
Checks if the current specification can be executed or not.
for default, nothing to do
Reimplemented in VIVADO_xsim_wrapper, modelsimWrapper, and VerilatorWrapper.
Definition at line 122 of file SimulationTool.cpp.
|
virtual |
Remove files created during simulation FIXME: this should become pure virtual.
Reimplemented in VIVADO_xsim_wrapper, modelsimWrapper, and VerilatorWrapper.
Definition at line 468 of file SimulationTool.cpp.
|
static |
Factory method.
this point should never be reached
Definition at line 97 of file SimulationTool.cpp.
References THROW_ERROR, and UNKNOWN.
Referenced by GenerateSimulationScripts::Exec().

| void SimulationTool::DetermineCycles | ( | unsigned long long int & | accum_cycles, |
| unsigned long long & | n_testcases | ||
| ) |
Determines the average number of cycles for the simulation(s)
| accum_cycles | is the total number of accumulated cycles |
| n_testcases | is the number of testcases simulated |
Definition at line 159 of file SimulationTool.cpp.
References output_level, OUTPUT_LEVEL_PEDANTIC, OUTPUT_LEVEL_VERBOSE, Param, PRINT_OUT_MEX, SplitString(), THROW_ASSERT, THROW_ERROR, and times().
Referenced by Simulate().


|
protected |
Definition at line 351 of file SimulationTool.cpp.
References cxa_prefix_mangled(), ends_with(), flopoco::filename, Param, relocate_compiler_path(), starts_with(), STR_CST_string_separator, STR_CST_testbench_generation_basename, and top_fname.
Referenced by VerilatorWrapper::GenerateScript(), modelsimWrapper::GenerateScript(), and VIVADO_xsim_wrapper::GenerateScript().


|
protectedpure virtual |
Performs the actual writing.
Implemented in VIVADO_xsim_wrapper, modelsimWrapper, and VerilatorWrapper.
Referenced by GenerateSimulationScript().

|
virtual |
Generates the proper simulation script.
Definition at line 280 of file SimulationTool.cpp.
References add(), generated_script, GenerateScript(), GetCurrentPath(), GetPath(), Param, relocate_compiler_path(), and starts_with().

|
virtual |
Performs the simulation and returns the number of cycles.
remove previous simulation results
Definition at line 127 of file SimulationTool.cpp.
References ToolManager::configure(), DetermineCycles(), ToolManager::execute(), generated_script, Param, test_panda::parameters, and THROW_ERROR.

|
static |
Definition at line 64 of file SimulationTool.cpp.
References THROW_ERROR.
Referenced by GenerateSimulationScripts::Exec().

|
protected |
debug level of the class
Definition at line 66 of file SimulationTool.hpp.
Referenced by modelsimWrapper::GenerateScript(), modelsimWrapper::modelsimWrapper(), VerilatorWrapper::VerilatorWrapper(), and VIVADO_xsim_wrapper::VIVADO_xsim_wrapper().
|
protected |
generated script
Definition at line 74 of file SimulationTool.hpp.
Referenced by GenerateSimulationScript(), and Simulate().
|
protected |
comma separated list of include dirs
Definition at line 80 of file SimulationTool.hpp.
Referenced by VerilatorWrapper::GenerateScript(), modelsimWrapper::GenerateScript(), and VIVADO_xsim_wrapper::GenerateScript().
|
protected |
log file
Definition at line 77 of file SimulationTool.hpp.
Referenced by VerilatorWrapper::GenerateScript(), modelsimWrapper::GenerateScript(), and VIVADO_xsim_wrapper::GenerateScript().
|
protected |
verbosity level of the class
Definition at line 69 of file SimulationTool.hpp.
Referenced by DetermineCycles(), and modelsimWrapper::GenerateScript().
|
protected |
class containing all the parameters
Definition at line 63 of file SimulationTool.hpp.
Referenced by DetermineCycles(), GenerateLibraryBuildScript(), VerilatorWrapper::GenerateScript(), modelsimWrapper::GenerateScript(), VIVADO_xsim_wrapper::GenerateScript(), GenerateSimulationScript(), and Simulate().
|
protected |
Definition at line 71 of file SimulationTool.hpp.
Referenced by GenerateLibraryBuildScript().
1.8.13