Skip to content

Commit

Permalink
Info getters (#1685)
Browse files Browse the repository at this point in the history
* Verilator flags

* Getter Tcl functions

* More getter functions
  • Loading branch information
alaindargelas authored Aug 24, 2024
1 parent 49ca3ee commit eb56f3f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Compiler/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,33 @@ bool Compiler::RegisterCommands(TclInterpreter* interp, bool batchMode) {
interp->registerCmd("get_top_simulation_module", get_top_simulation_module,
this, nullptr);

auto get_design_files = [](void* clientData, Tcl_Interp* interp, int argc,
const char* argv[]) -> int {
Compiler* compiler = (Compiler*)clientData;

std::string fileList{};
for (const auto& lang_file : compiler->ProjManager()->DesignFiles()) {
fileList += lang_file.second + " ";
}
Tcl_AppendResult(interp, strdup(fileList.c_str()), nullptr);
return TCL_OK;
};
interp->registerCmd("get_design_files", get_design_files, this, nullptr);

auto get_simulation_files = [](void* clientData, Tcl_Interp* interp, int argc,
const char* argv[]) -> int {
Compiler* compiler = (Compiler*)clientData;

std::string fileList{};
for (const auto& lang_file : compiler->ProjManager()->SimulationFiles()) {
fileList += lang_file.second + " ";
}
Tcl_AppendResult(interp, strdup(fileList.c_str()), nullptr);
return TCL_OK;
};
interp->registerCmd("get_simulation_files", get_simulation_files, this,
nullptr);

auto create_design = [](void* clientData, Tcl_Interp* interp, int argc,
const char* argv[]) -> int {
Compiler* compiler = (Compiler*)clientData;
Expand Down

0 comments on commit eb56f3f

Please sign in to comment.