chipsalliance / treadle

Chisel/Firrtl execution engine
Apache License 2.0
153 stars 31 forks source link

Add support for FST output #101

Open ekiwi opened 5 years ago

ekiwi commented 5 years ago

The fst file format is supported by GTKwave and has the following nice properties:

The biggest downside is the terrible documentation. The best material I have found so far is the paper at the end of the GTKwave manual titled Implementation of an Efficient Method for Digital Waveform Compression. Also the source code from icarus verilog is fairly readable: sys_fst.c, fstapi.h and fstapi.c.

chick commented 5 years ago

Do you have fst files that you would like to be able to process? I looked through the appendix and it seem comprehensible, but a bit elaborate with the database and compression etc. Treadle's basic speed is not that fast so typically any vcd data one is working with is usually not so big as to be prohibitive to process. If I was making more progress on the chisel GUI it might be important because passing wave data from treadle to a rendering agent could be a problem, but there it would probably be better to have a different organization. I'd be happy to talk to you more about this if you'd like

ekiwi commented 5 years ago

I'd be happy to talk to you more about this if you'd like

Sounds good. I mostly want to have a more expressive waveform view.

Let's consider this a tracking issue for now. If I have time after the retreat, I could try to implement a fst writer in Scala.

chick commented 5 years ago

Sounds good to me.

Timmmm commented 8 months ago

I wrote a specification for FST here. I also wrote some incomplete code to read it here and the Surfer project also supports reading FST (code here). Their code looks way better than mine tbh.

Should give a good idea how to write FST files.

ekiwi commented 8 months ago

I wrote a specification for FST here.

Thanks for writing that spec Tim! I actually had a look at it when I was implementing the FST reader for Surfer. (The reader is published as a stand alone library btw: https://crates.io/crates/fst-native).

Unfortunately I never quite finished making a FST writer. The hard part is imho how to efficiently store the change data as it comes from the simulator before reformatting it to write it to disk. As I like to say: VCD is easy to write, hard to read (efficiently). FST is easy to read, but hard to write (efficiently).

Alas, unfortunately treadle has been mostly abandoned. I keep a version of it alive as part of my chiseltest library, but unfortunately I won't have time to add new features.