From aa99f1b17474f7e7005f63d2fc29b082b9412fd9 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Mon, 21 Jul 2025 07:57:14 +0200 Subject: [PATCH] add "spectre_device_model" attr in spectre netlister code --- src/spectre_netlist.c | 4 ++-- xschem_library/devices/res.sym | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/spectre_netlist.c b/src/spectre_netlist.c index 42b192cf..c83a0e88 100644 --- a/src/spectre_netlist.c +++ b/src/spectre_netlist.c @@ -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); diff --git a/xschem_library/devices/res.sym b/xschem_library/devices/res.sym index b03f4db0..f8ed211c 100644 --- a/xschem_library/devices/res.sym +++ b/xschem_library/devices/res.sym @@ -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 {}