add "spectre_device_model" attr in spectre netlister code

This commit is contained in:
stefan schippers 2025-07-21 07:57:14 +02:00
parent 5a3c97d64e
commit aa99f1b174
2 changed files with 7 additions and 4 deletions

View File

@ -111,14 +111,14 @@ static int spectre_netlist(FILE *fd, int spectre_stop )
fprintf(fd, "**** end_element\n");
}
/* hash device_model attribute if any */
my_strdup2(_ALLOC_ID_, &val, get_tok_value(xctx->inst[i].prop_ptr, "device_model", 2));
my_strdup2(_ALLOC_ID_, &val, get_tok_value(xctx->inst[i].prop_ptr, "spectre_device_model", 2));
m = val;
if(strchr(val, '@')) m = translate(i, val);
else m = tcl_hook2(m);
if(m[0]) str_hash_lookup(&model_table, model_name(m), m, XINSERT);
else {
my_strdup2(_ALLOC_ID_, &val,
get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr, "device_model", 2));
get_tok_value(xctx->sym[xctx->inst[i].ptr].prop_ptr, "spectre_device_model", 2));
m = val;
if(strchr(val, '@')) m = translate(i, val);
else m = tcl_hook2(m);

View File

@ -1,4 +1,4 @@
v {xschem version=3.4.6 file_version=1.2
v {xschem version=3.4.8RC file_version=1.2
*
* This file is part of XSCHEM,
* a schematic capture and Spice/Vhdl/Verilog netlisting tool for circuit
@ -26,7 +26,7 @@ function0="1"
function1="0"
format="@name @pinlist @value m=@m"
spectre_format="@name ( @pinlist ) @model r=@value"
verilog_format="tran @name (@@P\\\\, @@M\\\\);"
tedax_format="footprint @name @footprint
@ -41,9 +41,12 @@ value=1k
footprint=1206
device=resistor
m=1"
spectre_device_model="load \\"resistor.osdi\\"
model @model resistor"
}
V {}
S {}
F {}
E {}
L 4 0 20 0 30 {}
L 4 0 20 7.5 17.5 {}