diff --git a/doc/xschem_man/developer_info.html b/doc/xschem_man/developer_info.html index f42e9d05..714a6b08 100644 --- a/doc/xschem_man/developer_info.html +++ b/doc/xschem_man/developer_info.html @@ -1102,12 +1102,12 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns" for faster operation. do a 'xschem redraw' at end to update screen Example: xschem replace_symbol R3 capa.sym +
+ Reset cached instance and symbol cached flags (inst->flags, sym->flags)
This is a low level command, it merely changes the xctx->inst[...].name field.
It is caller responsibility to delete all symbols before and do a reload_symbols
afterward
- - Reset cached instance and symbol cached flags (inst->flags, sym->flags)
internal command: calls resetwin()
@@ -1421,6 +1421,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
+
+
diff --git a/src/actions.c b/src/actions.c
index b0cb8019..9de30ca5 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -884,10 +884,10 @@ int set_text_flags(xText *t)
}
-void reset_flags(void)
+void reset_caches(void)
{
int i;
- dbg(1, "reset_flags()\n");
+ dbg(1, "reset_caches()\n");
for(i = 0; i < xctx->instances; i++) {
set_inst_flags(&xctx->inst[i]);
}
diff --git a/src/netlist.c b/src/netlist.c
index 1ca82de0..5ffc5134 100644
--- a/src/netlist.c
+++ b/src/netlist.c
@@ -1444,7 +1444,11 @@ int prepare_netlist_structs(int for_netl)
else if(!for_netlist && xctx->prep_hi_structs) return 0;
dbg(1, "prepare_netlist_structs(): extraction: %s\n", xctx->sch[xctx->currsch]);
- reset_flags(); /* update cached flags: necessary if some tcleval() is used for cached attrs */
+
+ /* Don't reset caches systematically. Users should call 'xschem reset_caches'
+ * if they play with tcl variables that need to be updated into attributes */
+ /* reset_caches(); */ /* update cached flags: necessary if some tcleval() is used for cached attrs */
+
set_modify(-2); /* to reset floater cached values */
/* delete instance pins spatial hash, wires spatial hash, node_hash, wires and inst nodes.*/
if(for_netlist) {
diff --git a/src/scheduler.c b/src/scheduler.c
index 9f1e37db..4c8e1470 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -3543,6 +3543,15 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
}
+ /* reset_caches
+ * Reset cached instance and symbol cached flags (inst->flags, sym->flags) */
+ else if(!strcmp(argv[1], "reset_caches"))
+ {
+ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
+ reset_caches();
+ Tcl_ResetResult(interp);
+ }
+
/* reset_symbol inst symref
* This is a low level command, it merely changes the xctx->inst[...].name field.
* It is caller responsibility to delete all symbols before and do a reload_symbols
@@ -3564,15 +3573,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
Tcl_ResetResult(interp);
}
- /* reset_flags
- * Reset cached instance and symbol cached flags (inst->flags, sym->flags) */
- else if(!strcmp(argv[1], "reset_flags"))
- {
- if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
- reset_flags();
- Tcl_ResetResult(interp);
- }
-
/* resetwin create_pixmap clear_pixmap force w h
* internal command: calls resetwin() */
else if(!strcmp(argv[1], "resetwin"))
diff --git a/src/xschem.h b/src/xschem.h
index ed9bb28a..f9b2576b 100644
--- a/src/xschem.h
+++ b/src/xschem.h
@@ -1220,7 +1220,7 @@ extern int set_rect_flags(xRect *r);
extern int set_text_flags(xText *t);
extern int set_inst_flags(xInstance *inst);
extern int set_sym_flags(xSymbol *sym);
-extern void reset_flags(void);
+extern void reset_caches(void);
extern const char *get_text_floater(int i);
extern int set_rect_extraptr(int what, xRect *drptr);
extern unsigned char *base64_decode(const char *data, const size_t input_length, size_t *output_length);