netlistsvg icon indicating copy to clipboard operation
netlistsvg copied to clipboard

Unable to generate diagram

Open mickey4u opened this issue 3 years ago • 6 comments

After obtaining the json file, I tried to generate the svg but follow error messages

/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:107
    return (haystack.indexOf(needle) > -1);
                     ^

RangeError: Maximum call stack size exceeded
    at String.indexOf (<anonymous>)
    at arrayContains (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:107:22)
    at /usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:113:16
    at baseFindIndex (/usr/local/lib/node_modules/netlistsvg/node_modules/lodash/lodash.js:802:11)
    at Function.findIndex (/usr/local/lib/node_modules/netlistsvg/node_modules/lodash/lodash.js:7280:14)
    at indexOfContains (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:112:14)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:164:17)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)
    at gather (/usr/local/lib/node_modules/netlistsvg/built/FlatModule.js:188:5)

mickey4u avatar Oct 23 '20 17:10 mickey4u

do you have a reproducible example?

nturley avatar Dec 12 '20 03:12 nturley

I have a module that causes the same error. It's untested work in progress, so I suspect there are still some directionality conflicts or similar that trigger this.

cache_readonly_dm.txt

Zottel avatar Aug 02 '21 13:08 Zottel

Your netlist is too big. I've run into this before when my netlist includes very large memory arrays, for instance. Not sure how to fix this.

nobodywasishere avatar Aug 13 '21 16:08 nobodywasishere

The gather function appears to be mostly tail recursive, so rewriting it into a loop without recursion may be the solution.

Zottel avatar Aug 18 '21 08:08 Zottel

Kind of managed to refactor FlatModule.gather into a loop as opposed to a recursion as per @Zottel 's suggestion in PR #121 , it means that the restriction in that computation is now heap memory as opposed to stack memory. It didn't fix my personal use case as I have a super huge array I guess, but it might help someone elses use case maybe. :shrug:

kshaa avatar Apr 01 '22 09:04 kshaa

+1 I also ran into this issue. The arrays in my example are not that big, maybe 100-200 entries.

j2kun avatar Oct 31 '22 20:10 j2kun