Skip to content

Commit

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

* Getter Tcl functions

* Incremented patch version

---------

Co-authored-by: alaindargelas <[email protected]>
  • Loading branch information
alaindargelas and alaindargelas authored Aug 23, 2024
1 parent 88afab8 commit 49ca3ee
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ set(VERSION_MINOR 0)
# Add the spdlog directory to the include path
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/spdlog/include ${CMAKE_CURRENT_SOURCE_DIR}/third_party/exprtk ${CMAKE_CURRENT_SOURCE_DIR}/third_party/scope_guard)

set(VERSION_PATCH 420)
set(VERSION_PATCH 421)


option(
Expand Down
28 changes: 28 additions & 0 deletions src/Compiler/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,34 @@ bool Compiler::RegisterCommands(TclInterpreter* interp, bool batchMode) {
};
interp->registerCmd("get_state", get_state, this, nullptr);

auto get_design_name = [](void* clientData, Tcl_Interp* interp, int argc,
const char* argv[]) -> int {
Compiler* compiler = (Compiler*)clientData;
std::string name = compiler->ProjManager()->projectName();
Tcl_AppendResult(interp, strdup(name.c_str()), nullptr);
return TCL_OK;
};
interp->registerCmd("get_design_name", get_design_name, this, nullptr);

auto get_top_module = [](void* clientData, Tcl_Interp* interp, int argc,
const char* argv[]) -> int {
Compiler* compiler = (Compiler*)clientData;
std::string name = compiler->ProjManager()->DesignTopModule();
Tcl_AppendResult(interp, strdup(name.c_str()), nullptr);
return TCL_OK;
};
interp->registerCmd("get_top_module", get_top_module, this, nullptr);

auto get_top_simulation_module = [](void* clientData, Tcl_Interp* interp,
int argc, const char* argv[]) -> int {
Compiler* compiler = (Compiler*)clientData;
std::string name = compiler->ProjManager()->SimulationTopModule();
Tcl_AppendResult(interp, strdup(name.c_str()), nullptr);
return TCL_OK;
};
interp->registerCmd("get_top_simulation_module", get_top_simulation_module,
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 49ca3ee

Please sign in to comment.