aquiles viza
02/22/2024, 4:07 PMX on the devices when extracting a netlist for lvs.
In the example, the lvs.sh script uses netgen to perform it but fails. When `sed`is used to add the X on schematic netlist, netgen works.
I've found that to perform lvs with magic the netlist extracted by xschem should use X prefix, while klayout don't.
Can magic be configured in a way to avoid using X prefix?Stefan Schippers
02/22/2024, 4:38 PMformat attribute that defines the spice netlist for simulation and (when needed) a lvs_format for Layout vs Schematic checking (for example avoiding some parameters and the X prefix).
The LVS netlist option in xschem Simuation menu does two things:
• set a tcl lvs_netlist variable to true. This will uncomment the toplevel .subckt and .ends lines (for simulation these top subckt wrapper lines must be commented).
• do the command xschem set format lvs_format. This instructs the xschem netlister to use the lvs_format attribute in the symbols (if existing) for LVS checking.
Nothing prevents from adding a netgen_format and do a set format netgen_format before doing the netlist for netgen.
Recommended solution
Another (better) clever option is to add @spiceprefix in front of the lvs_format definition of all gf180mcu symbols. Xschem has the option Simulation->LVS->Use spiceprefix attribute to enable or not this prefix.Tim Edwards
02/22/2024, 5:32 PMaquiles viza
02/22/2024, 5:35 PMset lvs_netlist 1 is used, the X dissapears and I don't know why.
$ rm nmos5f_prefix.spice
$ xschem --rcfile xschemrc -r --netlist --no_x --quit \
        --netlist_path . \
        --netlist_filename nmos5f_prefix.spice \
        --preinit 'set lvs_netlist 0' \
        nmos5f.sch
$ cat nmos5f_prefix.spice
** sch_path: /workspaces/ic-makefile/samples/nmos5f/spiceprefix-not-working/nmos5f.sch
**.subckt nmos5f D S G
*.iopin D
*.iopin S
*.iopin G
XM2 D G S S nfet_03v3 L=0.7u W=5u nf=1 ad='int((nf+1)/2) * W/nf * 0.18u' as='int((nf+2)/2) * W/nf * 0.18u' pd='2*int((nf+1)/2) * (W/nf + 0.18u)'
+ ps='2*int((nf+2)/2) * (W/nf + 0.18u)' nrd='0.18u / W' nrs='0.18u / W' sa=0 sb=0 sd=0 m=1
**.ends
.end
-----
$ rm nmos5f_prefix.spice
$ xschem --rcfile xschemrc -r --netlist --no_x --quit \
        --netlist_path . \
        --netlist_filename nmos5f_prefix.spice \
        --preinit 'set lvs_netlist 1' \
        nmos5f.sch
# cat nmos5f_prefix.spice
** sch_path: /workspaces/ic-makefile/samples/nmos5f/spiceprefix-not-working/nmos5f.sch
.subckt nmos5f D S G
*.PININFO D:B S:B G:B
M2 D G S S nfet_03v3 L=0.7u W=5u nf=1 m=1
.ends
.endStefan Schippers
02/22/2024, 5:39 PM@spiceprefix in front of the lvs_format attribute (as it is for regular spice sim format) so it can be enabled or disabled simply by the LVS submenu. @aquiles viza the gf180mcu MOS symbols do have the @spiceprefix on the format attribute but not on the lvs_format. I added the @spiceprefix in image above to verify it works.
type=nmos
format="@spiceprefix@name @pinlist @model L=@L W=@W
+ nf=@nf ad=@ad as=@as pd=@pd ps=@ps
+ nrd=@nrd nrs=@nrs sa=@sa sb=@sb sd=@sd
+ m=@m"
lvs_format="@name @pinlist @model L=@L W=@W nf=@nf m=@m"
template="name=M1
L=0.28u
W=0.22u
nf=1
m=1
ad=\\"'int((nf+1)/2) * W/nf * 0.18u'\\"
pd=\\"'2*int((nf+1)/2) * (W/nf + 0.18u)'\\"
as=\\"'int((nf+2)/2) * W/nf * 0.18u'\\"
ps=\\"'2*int((nf+2)/2) * (W/nf + 0.18u)'\\"
nrd=\\"'0.18u / W'\\" nrs=\\"'0.18u / W'\\"
sa=0 sb=0 sd=0
model=nfet_03v3
spiceprefix=Xaquiles viza
02/22/2024, 5:47 PM$ rm nmos5f_prefix.spice
$ xschem --rcfile xschemrc -r --netlist --no_x --quit \
        --netlist_path . \
        --netlist_filename nmos5f_prefix.spice \
        --preinit 'set lvs_netlist 0' \
        nmos5f.sch
$ cat nmos5f_prefix.spice
** sch_path: /workspaces/ic-makefile/samples/nmos5f/spiceprefix-not-working/nmos5f.sch
**.subckt nmos5f D S G
*.iopin D
*.iopin S
*.iopin G
XM2 D G S S nfet_03v3 L=0.7u W=5u nf=1 ad='int((nf+1)/2) * W/nf * 0.18u' as='int((nf+2)/2) * W/nf * 0.18u'
+ pd='2*int((nf+1)/2) * (W/nf + 0.18u)' ps='2*int((nf+2)/2) * (W/nf + 0.18u)' nrd='0.18u / W' nrs='0.18u / W'
+ sa=0 sb=0 sd=0 m=1
**.ends
.end
--------
$ rm nmos5f_prefix.spice
$ xschem --rcfile xschemrc -r --netlist --no_x --quit \
        --netlist_path . \
        --netlist_filename nmos5f_prefix.spice \
        --preinit 'set lvs_netlist 1' \
        nmos5f.sch
$ cat nmos5f_prefix.spice
** sch_path: /workspaces/ic-makefile/samples/nmos5f/spiceprefix-not-working/nmos5f.sch
.subckt nmos5f D S G
*.PININFO D:B S:B G:B
XM2 D G S S nfet_03v3 L=0.7u W=5u nf=1 ad='int((nf+1)/2) * W/nf * 0.18u' as='int((nf+2)/2) * W/nf * 0.18u'
+ pd='2*int((nf+1)/2) * (W/nf + 0.18u)' ps='2*int((nf+2)/2) * (W/nf + 0.18u)' nrd='0.18u / W' nrs='0.18u / W'
+ sa=0 sb=0 sd=0 m=1
.ends
.end
This was the expected behaviour.
But I think is right to be more explicit adding the lvs_format attribute.Linen is a search-engine friendly community platform. We offer integrations with existing Slack/Discord communities and make those conversations Google-searchable.
Powered by