[SKiDL BUG] svg skin not compatible with netlistsvg
See original GitHub issueskin.svg file has no correct format for netlistsvg.
netlistsvg error:
/usr/local/lib/node_modules/netlistsvg/built/Skin.js:11
return e[1]['s:pid'].startsWith(prefix);
^
TypeError: Cannot read property 'startsWith' of undefined
at /usr/local/lib/node_modules/netlistsvg/built/Skin.js:11:38
at arrayFilter (/usr/local/lib/node_modules/netlistsvg/node_modules/lodash/lodash.js:596:11)
at Function.filter (/usr/local/lib/node_modules/netlistsvg/node_modules/lodash/lodash.js:9241:14)
at Object.getPortsWithPrefix (/usr/local/lib/node_modules/netlistsvg/built/Skin.js:9:23)
at Cell.buildElkChild (/usr/local/lib/node_modules/netlistsvg/built/Cell.js:213:36)
at /usr/local/lib/node_modules/netlistsvg/built/elkGraph.js:12:18
at Array.map (<anonymous>)
at Object.buildElkGraph (/usr/local/lib/node_modules/netlistsvg/built/elkGraph.js:11:33)
at Object.render (/usr/local/lib/node_modules/netlistsvg/built/index.js:43:29)
at render (/usr/local/lib/node_modules/netlistsvg/bin/netlistsvg.js:23:9)
at parseFiles (/usr/local/lib/node_modules/netlistsvg/bin/netlistsvg.js:57:9)
at fs.readFile (/usr/local/lib/node_modules/netlistsvg/bin/netlistsvg.js:41:17)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
I think s:pid should be in the same root <g> tag i.e.
<g s:type="PMOS_GSD_1_" s:width="112.5" s:height="132.0" transform="translate(60.0,72.0)">
<s:alias val="PMOS_GSD_1_" />
<path d="M 27.0 0.0 L 15.0 -4.5 L 15.0 4.5 L 27.0 0.0" style="stroke-width:1.0"
class="$cell_id symbol pen_fill" />
<circle cx="19.5" cy="0.0" r="33.0" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 3.0 0.0 L -30.0 0.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M 3.0 -22.5 L 3.0 22.5" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 9.0 21.0 L 30.0 21.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M 9.0 15.0 L 9.0 27.0" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 9.0 -6.0 L 9.0 6.0" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 9.0 -21.0 L 30.0 -21.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M 9.0 -27.0 L 9.0 -15.0" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 30.0 -30.0 L 30.0 -21.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M 30.0 30.0 L 30.0 0.0 L 9.0 0.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M -60.0 0.0 L -30.0 0.0" style="stroke-width:1.0" class="$cell_id symbol" />
<text class='pin_num_text' text-anchor='end' x='-30.0' y='0.0'
transform='rotate(0 -30.0 0.0) translate(-6.0 -2.25)' style='font-size:15.0px'> 1 </text>
<path d="M 30.0 60.0 L 30.0 30.0" style="stroke-width:1.0" class="$cell_id symbol" />
<text class='pin_num_text' text-anchor='end' x='30.0' y='30.0'
transform='rotate(-90 30.0 30.0) translate(-6.0 -2.25)' style='font-size:15.0px'> 2 </text>
<path d="M 30.0 -72.0 L 30.0 -30.0" style="stroke-width:1.0" class="$cell_id symbol" />
<text class='pin_num_text' text-anchor='start' x='30.0' y='-30.0'
transform='rotate(-90 30.0 -30.0) translate(6.0 -2.25)' style='font-size:15.0px'> 3 </text>
<text class='part_ref_text' text-anchor='start' x='60.0' y='-15.0'
transform='rotate(0 60.0 -15.0) translate(0.0 7.5)' style='font-size:15.0px' s:attribute="ref"> X
</text>
<text class='part_name_text' text-anchor='start' x='60.0' y='15.0'
transform='rotate(0 60.0 15.0) translate(0.0 7.5)' style='font-size:15.0px' s:attribute="value"> X
</text>
<g s:x="0.0" s:y="0" s:pid="1" s:position="left"/>
<g s:x="30.0" s:y="60" s:pid="2" s:position="bottom"/>
<g s:x="30.0" s:y="-72" s:pid="3" s:position="top"/>
</g>
not working because extra <g transform…:
<g s:type="PMOS_GSD_1_" s:width="112.5" s:height="132.0" >
<s:alias val="PMOS_GSD_1_"/>
<g transform="translate(60.0,72.0)">
<path d="M 27.0 0.0 L 15.0 -4.5 L 15.0 4.5 L 27.0 0.0" style="stroke-width:1.0" class="$cell_id symbol pen_fill" />
<circle cx="19.5" cy="0.0" r="33.0" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 3.0 0.0 L -30.0 0.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M 3.0 -22.5 L 3.0 22.5" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 9.0 21.0 L 30.0 21.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M 9.0 15.0 L 9.0 27.0" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 9.0 -6.0 L 9.0 6.0" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 9.0 -21.0 L 30.0 -21.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M 9.0 -27.0 L 9.0 -15.0" style="stroke-width:3.0" class="$cell_id symbol " />
<path d="M 30.0 -30.0 L 30.0 -21.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M 30.0 30.0 L 30.0 0.0 L 9.0 0.0" style="stroke-width:1.0" class="$cell_id symbol " />
<path d="M -60.0 0.0 L -30.0 0.0" style="stroke-width:1.0" class="$cell_id symbol"/>
<text class='pin_num_text' text-anchor='end' x='-30.0' y='0.0' transform='rotate(0 -30.0 0.0) translate(-6.0 -2.25)' style='font-size:15.0px' > 1 </text>
<path d="M 30.0 60.0 L 30.0 30.0" style="stroke-width:1.0" class="$cell_id symbol"/>
<text class='pin_num_text' text-anchor='end' x='30.0' y='30.0' transform='rotate(-90 30.0 30.0) translate(-6.0 -2.25)' style='font-size:15.0px' > 2 </text>
<path d="M 30.0 -72.0 L 30.0 -30.0" style="stroke-width:1.0" class="$cell_id symbol"/>
<text class='pin_num_text' text-anchor='start' x='30.0' y='-30.0' transform='rotate(-90 30.0 -30.0) translate(6.0 -2.25)' style='font-size:15.0px' > 3 </text>
<text class='part_ref_text' text-anchor='start' x='60.0' y='-15.0' transform='rotate(0 60.0 -15.0) translate(0.0 7.5)' style='font-size:15.0px' s:attribute="ref" > X </text>
<text class='part_name_text' text-anchor='start' x='60.0' y='15.0' transform='rotate(0 60.0 15.0) translate(0.0 7.5)' style='font-size:15.0px' s:attribute="value" > X </text>
</g>
<g s:x="0.0" s:y="72.0" s:pid="1" s:position="left"/>
<g s:x="90.0" s:y="132.0" s:pid="2" s:position="bottom"/>
<g s:x="90.0" s:y="0.0" s:pid="3" s:position="top"/>
</g>
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
NetlistSVG — pcbdl documentation - Google
netlistsvg is used by pcbdl to render a graphical output of the schematics. It uses the “analog skin” to get something similar to...
Read more >everything.schedule.xml - GitHub
</abstract> <description><p>Carry bugs are fairly common, and usually too small to have big impact, or so they are considered. This one was no...
Read more >Bookmarks
GitHub - xesscorp/skidl: SKiDL is a module that extends Python with the ability to design electronic circuits. https://greenteapress.com/wp/modsimpy/ · Home - ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had a real hard time getting your example (or any example) to work because of my installation of
node
andnpm
. An old version ofnetlistsvg
is installed when you usenpm install netlistsvg
. When you usenpm install github:nturley/netlistsvg
to install the newest version locally,skidl
still defaults to using the global (but out-of-date) version ofnetlistsvg
. When I tried to update the global version withnpm install github:nturley/netlistsvg -g
, Ubuntu wouldn’t allow it because of directory permissions (even when usingsudo
).So I completely removed
node
andnpm
and reinstalled the latest versions. Then all my examples began working as well as this version of your example:So I think you shouldn’t need your work-around if you get the latest version of
netlistsvg
installed correctly.One problem did arise when the second PMOS transistor in your example was rotated to the right: the
elkjs
module threw an exception. The exception didn’t happen if I rotated the transistor to the left or applied any other type of transformation. I haven’t yet found the cause of this error.If you think your problems might also be caused by an out-of-date installation of
node
,npm
, ornetlistsvg
, then here are the steps I used to re-install on Ubuntu:If you’re sure you have the newest version of
netlistsvg
, then we’ll have to keep looking for a solution. But I got exactly the same error running your example as you did when I was using an older version ofnetlistsvg
.I finally got back to this and verified that your fix works for all my test cases and also solves the problem with the rotated transistor. I’ve checked the changes into the development branch. Thanks!