Merge branch 'master' into SuperChayan
This commit is contained in:
commit
a1d51f6516
|
|
@ -4010,43 +4010,8 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
}
|
||||
if(key=='n' && rstate==0) /* hierarchical netlist */
|
||||
{
|
||||
int err = 0;
|
||||
yyparse_error = 0;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
unselect_all(1);
|
||||
if(set_netlist_dir(0, NULL)) {
|
||||
dbg(1, "callback(): -------------\n");
|
||||
if(xctx->netlist_type == CAD_SPICE_NETLIST)
|
||||
err = global_spice_netlist(1, 1);
|
||||
else if(xctx->netlist_type == CAD_VHDL_NETLIST)
|
||||
err = global_vhdl_netlist(1, 1);
|
||||
else if(xctx->netlist_type == CAD_VERILOG_NETLIST)
|
||||
err = global_verilog_netlist(1, 1);
|
||||
else if(xctx->netlist_type == CAD_TEDAX_NETLIST)
|
||||
err = global_tedax_netlist(1, 1);
|
||||
else
|
||||
tcleval("tk_messageBox -type ok -parent [xschem get topwindow] "
|
||||
"-message {Please Set netlisting mode (Options menu)}");
|
||||
|
||||
dbg(1, "callback(): -------------\n");
|
||||
}
|
||||
else {
|
||||
if(has_x) tcleval("alert_ {Can not write into the netlist directory. Please check} {}");
|
||||
else dbg(0, "Can not write into the netlist directory. Please check");
|
||||
err = 1;
|
||||
}
|
||||
if(err) {
|
||||
if(has_x) {
|
||||
tclvareval(xctx->top_path, ".menubar entryconfigure Netlist -background red", NULL);
|
||||
tclvareval("set tctx::", xctx->current_win_path, "_netlist red", NULL);
|
||||
}
|
||||
|
||||
} else {
|
||||
if(has_x) {
|
||||
tclvareval(xctx->top_path, ".menubar entryconfigure Netlist -background Green", NULL);
|
||||
tclvareval("set tctx::", xctx->current_win_path, "_netlist Green", NULL);
|
||||
}
|
||||
}
|
||||
tcleval("xschem netlist -erc");
|
||||
break;
|
||||
}
|
||||
if(key=='N' && rstate == 0) /* current level only netlist */
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ exp: NUM { $$ = $1;}
|
|||
static void get_expr(double x)
|
||||
{
|
||||
char xx[100];
|
||||
my_snprintf(xx, S(xx), "%.16g", x);
|
||||
my_snprintf(xx, S(xx), "%.15g", x);
|
||||
my_mstrcat(_ALLOC_ID_, &ret, xx, NULL);
|
||||
strptr = str;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3377,6 +3377,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
}
|
||||
}
|
||||
tclsetvar("show_infowindow_after_netlist", saveshow);
|
||||
tcleval("eval_netlist_postprocess");
|
||||
set_netlist_dir(1, savedir);
|
||||
if(done_netlist) {
|
||||
if(messages) {
|
||||
|
|
|
|||
16
src/token.c
16
src/token.c
|
|
@ -1216,7 +1216,7 @@ const char *subst_token(const char *s, const char *tok, const char *new_val)
|
|||
size_t token_pos=0, result_pos=0, result_save_pos = 0, tmp;
|
||||
int quote=0;
|
||||
int done_subst=0;
|
||||
int escape=0, matched_tok=0;
|
||||
int escape=0, matched_tok=0, removed_tok = 0;
|
||||
char *new_val_copy = NULL;
|
||||
size_t new_val_len;
|
||||
|
||||
|
|
@ -1299,6 +1299,7 @@ const char *subst_token(const char *s, const char *tok, const char *new_val)
|
|||
} else { /* remove token (and value if any) */
|
||||
result_pos = result_save_pos;
|
||||
done_subst = 1;
|
||||
removed_tok = 1;
|
||||
}
|
||||
}
|
||||
result_save_pos = result_pos;
|
||||
|
|
@ -1335,11 +1336,13 @@ const char *subst_token(const char *s, const char *tok, const char *new_val)
|
|||
} else { /* remove token (and value if any) */
|
||||
result_pos = result_save_pos;
|
||||
done_subst = 1;
|
||||
removed_tok = 1;
|
||||
}
|
||||
}
|
||||
state=TOK_VALUE;
|
||||
} else if( state == TOK_VALUE && space && !quote && !escape) {
|
||||
state=TOK_BEGIN;
|
||||
if(matched_tok && removed_tok && (c == '\n' || c == ' ') ) continue;
|
||||
}
|
||||
/* state actions */
|
||||
if(state == TOK_BEGIN) {
|
||||
|
|
@ -4488,7 +4491,7 @@ const char *translate(int inst, const char* s)
|
|||
}
|
||||
if(strstr(value1, "expr(") == value1) {
|
||||
char *ptr = strrchr(value1 + 5, ')');
|
||||
dbg(0, "translate(): expr():%s\n", value1);
|
||||
dbg(1, "translate(): expr():%s\n", value1);
|
||||
*ptr = '\0';
|
||||
my_strdup2(_ALLOC_ID_, &value1, eval_expr(
|
||||
translate3(value1 + 5, 1, xctx->inst[inst].prop_ptr, xctx->sym[xctx->inst[inst].ptr].templ, NULL)));
|
||||
|
|
@ -4514,11 +4517,18 @@ const char *translate(int inst, const char* s)
|
|||
} /* while(1) */
|
||||
dbg(2, "translate(): returning %s\n", result);
|
||||
my_free(_ALLOC_ID_, &token);
|
||||
|
||||
/* if result is like: 'tcleval(some_string)' pass it thru tcl evaluation so expressions
|
||||
* can be calculated */
|
||||
my_strdup2(_ALLOC_ID_, &translated_tok, spice_get_node(tcl_hook2(result)));
|
||||
|
||||
if(strstr(translated_tok, "expr(") == translated_tok) {
|
||||
char *ptr = strrchr(translated_tok + 5, ')');
|
||||
dbg(1, "translate(): expr():%s\n", translated_tok);
|
||||
*ptr = '\0';
|
||||
my_strdup2(_ALLOC_ID_, &translated_tok, eval_expr(
|
||||
translate3(translated_tok + 5, 1, xctx->inst[inst].prop_ptr, xctx->sym[xctx->inst[inst].ptr].templ, NULL)));
|
||||
}
|
||||
|
||||
return translated_tok;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8925,6 +8925,15 @@ proc eval_postinit_commands {} {
|
|||
}
|
||||
}
|
||||
|
||||
proc eval_netlist_postprocess {} {
|
||||
global netlist_postprocess
|
||||
if {[info exists netlist_postprocess]} {
|
||||
if {[catch {uplevel #0 $netlist_postprocess} res]} {
|
||||
puts "executing $netlist_postprocess:\n\n$res"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc setup_tcp_xschem { {port_number {}} } {
|
||||
global xschem_listen_port xschem_server_getdata
|
||||
|
||||
|
|
|
|||
|
|
@ -545,7 +545,10 @@
|
|||
# }
|
||||
# }
|
||||
|
||||
|
||||
###########################################################################
|
||||
#### TCL COMMANDS TO BE EXECUTED AFTER GENERATING NETLIST
|
||||
###########################################################################
|
||||
# set netlist_postprocess {textfile $netlist_dir/[xschem get netlist_name fallback]}
|
||||
|
||||
###########################################################################
|
||||
#### WEB URL DOWNLOAD HELPER APPLICATION
|
||||
|
|
|
|||
|
|
@ -59,3 +59,4 @@ T {@#3:net_name} 25 1.25 0 0 0.15 0.15 {layer=15 hide=instance}
|
|||
T {tcleval(vgs=[to_eng \{@#1:spice_get_voltage - @#2:spice_get_voltage \}]
|
||||
vds=[to_eng \{@#0:spice_get_voltage - @#2:spice_get_voltage \}])} 2.5 20 0 1 0.05 0.05 {layer=15 }
|
||||
T {@spice_get_current} 35 20 0 0 0.15 0.15 {layer=17}
|
||||
T {expr( @w + @l )} 50 -30 0 0 0.2 0.2 {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue