vcd icon indicating copy to clipboard operation
vcd copied to clipboard

MAX_CHANNEL reached and segfault with SystemC output

Open nantunest opened this issue 3 years ago • 5 comments

Hi, nice work. I was trying to display a vcd file which is output from a SystemC execution. It didn`t and shows the message:

Fatal error. Send the VCD on https://github.com/yne/vcd/issues Reason: MAX_CHANNEL reached (400), rebuild with -DMAX_CHANNEL=...

I tried to increase the MAX_CHANNEL to 100000. With that I received a segfault counter.txt

nantunest avatar May 24 '22 03:05 nantunest

Yes, in your file example, channel number is made of 5 character aaaaa wich mean up to 7339040224 entries

The only solution would be to store the channel list as HashMap<string,Channel>

I'll keep this refactor in mind. It'll be usefull for many other cases.

yne avatar May 26 '22 11:05 yne

I made a hashmap based version, but the ordering are not kept during listing so I won't merge https://github.com/yne/vcd/pull/19 for now

but here is a built asset: vcd.zip

yne avatar May 27 '22 07:05 yne

Yes, in your file example, channel number is made of 5 character aaaaa wich mean up to 7339040224 entries

The only solution would be to store the channel list as HashMap<string,Channel>

I'll keep this refactor in mind. It'll be usefull for many other cases.

Is it something normal to have this quantity of channels? Wha does the channel number mean? Should it be the quantity of signals in the plot?

nantunest avatar May 27 '22 13:05 nantunest

VCD Channels are numbered with 1 character, if all the 86 allowed character are taken, you can use 2 character to go up to 7396 channel etc. In your VCD, the first channel is numbered with an "aaaaa" name, so it's quite a huge number.

yne avatar May 27 '22 15:05 yne

The new HashMap version seems to be working very well, but it now requires a khash.h + kvec.h headers from klib

I used git submodule to avoid duplicating the code, but I could also copy those two headers file in my repo (I find this dirty, but that's subjectiv)

@uffejakobsen : from a maintainer perspective, could having a git submodule be problematic ?

yne avatar Dec 17 '22 23:12 yne