diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2022-11-25 16:18:02 +0100 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2022-11-25 16:18:02 +0100 |
commit | 2450e6be2223b4895bfa239364996c882c0229af (patch) | |
tree | c2a62ef34cee2b7eabe906a2ef4c4fe8982ec9c7 /kernel/yosys.cc | |
parent | c55c514cdbd5a7968c17689876f2ced282071f9c (diff) | |
download | yosys-2450e6be2223b4895bfa239364996c882c0229af.tar.gz yosys-2450e6be2223b4895bfa239364996c882c0229af.tar.bz2 yosys-2450e6be2223b4895bfa239364996c882c0229af.zip |
Add TCL interactive shell mode
Diffstat (limited to 'kernel/yosys.cc')
-rw-r--r-- | kernel/yosys.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/yosys.cc b/kernel/yosys.cc index a56a066fe..4a22d0a7b 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -740,13 +740,19 @@ static int tcl_yosys_cmd(ClientData, Tcl_Interp *interp, int argc, const char *a return TCL_OK; } +int yosys_tcl_iterp_init(Tcl_Interp *interp) +{ + if (Tcl_Init(interp)!=TCL_OK) + log_warning("Tcl_Init() call failed - %s\n",Tcl_ErrnoMsg(Tcl_GetErrno())); + Tcl_CreateCommand(interp, "yosys", tcl_yosys_cmd, NULL, NULL); + return TCL_OK ; +} + extern Tcl_Interp *yosys_get_tcl_interp() { if (yosys_tcl_interp == NULL) { yosys_tcl_interp = Tcl_CreateInterp(); - if (Tcl_Init(yosys_tcl_interp)!=TCL_OK) - log_warning("Tcl_Init() call failed - %s\n",Tcl_ErrnoMsg(Tcl_GetErrno())); - Tcl_CreateCommand(yosys_tcl_interp, "yosys", tcl_yosys_cmd, NULL, NULL); + yosys_tcl_iterp_init(yosys_tcl_interp); } return yosys_tcl_interp; } |