LiamSkirrow / verilogtree

Print out the modular hierarchy of a Verilog design
MIT License
0 stars 0 forks source link

Handle circular hierarchy segfault #28

Closed LiamSkirrow closed 1 year ago

LiamSkirrow commented 1 year ago

verilogtree will segfault if a circular hierarchy is given -> eg mod0 instantiates itself or something...

Need to detect this case, if any module instantiates itself, or if any module instantiates one of its ancestors this will cause an infinite recursive loop that will swallow up lots of memory and ultimately crash...

LiamSkirrow commented 1 year ago

Include a hardcoded hierarchy depth of say ~100. This will detect when a runaway recursion event is occurring and will just end the program. This seems like a simple and convenient fix for this issue without having to keep track of every module that's been added along a chain and then performing comparisons etc...

The value of this hardcoded depth should be settable in the verilogtreeconfig file #22