2022-07-28 14:43:58 +00:00
|
|
|
Copyright - Yehowshua Immanuel
|
2022-05-21 21:55:27 +00:00
|
|
|
|
2022-10-20 13:26:58 +00:00
|
|
|
# Status
|
2023-07-25 17:10:14 +00:00
|
|
|
July 25 2022: Haven't worked on this in a while. It seems the Zoq is now pushing forward on this codebase.
|
|
|
|
Check out his frontend here: https://gitlab.com/TheZoq2/surfer
|
2022-10-20 13:26:58 +00:00
|
|
|
|
2022-07-28 14:43:58 +00:00
|
|
|
# A High performance, VCD Parser written in Rust
|
2022-04-14 04:50:37 +00:00
|
|
|
|
2022-10-26 18:07:58 +00:00
|
|
|
I have abandoned eGUI and will be building the following UI in
|
|
|
|
[Rust Tauri](https://github.com/ThePerfectComputer/FastWaveFrontend-Tauri).
|
2022-09-13 23:35:23 +00:00
|
|
|
|
2022-10-26 18:07:58 +00:00
|
|
|
It should work just fine in Windows and Linux also.
|
|
|
|
|
|
|
|

|
2022-09-13 23:35:23 +00:00
|
|
|
|
2022-08-12 00:04:06 +00:00
|
|
|
# Current Features
|
2022-08-11 23:58:43 +00:00
|
|
|
|
2022-08-12 00:04:06 +00:00
|
|
|
- Robust Error Handling
|
|
|
|
|
|
|
|
FastWave currently offers highly robust error handling(at least on the sample
|
|
|
|
VCD files in this repository) which GTKWave doesn't have. For
|
|
|
|
example, selecting the ``UTILIZATON_ENABLED`` signal after opening
|
|
|
|
[test2x2_regex22_string1.vcd](./test-vcd-files/xilinx_isim/test2x2_regex22_string1.vcd)
|
|
|
|
(one of the sample xilinx vcd test files) in GtkWave, will crash GtkWave since
|
|
|
|
this signal is malformed. FastWave on the otherhand simply notes that the
|
|
|
|
signal is malformed.
|
|
|
|
|
|
|
|
# Performance
|
|
|
|
|
|
|
|
## Methods
|
|
|
|
I have been testing performance on a 3.04GB VCD file that can be found
|
2022-08-11 23:58:43 +00:00
|
|
|
[here](https://drive.google.com/file/d/1pfm2qo2l8fGTHHJ8TLrg1vSGaV_TUbp2/view?usp=sharing).
|
|
|
|
|
2022-08-12 00:04:06 +00:00
|
|
|
For getting the GtkWave results, I fired up GtkWave, clicked on
|
|
|
|
``File``->``Open New Window``, and selected the VCD file linked to above.
|
2022-08-11 23:58:43 +00:00
|
|
|
I started my stopwatch as soon as I pressed enter to beging loading the VCD
|
|
|
|
file, and stopped my stopwatch once the GtkWave titlebar reached 100%.
|
2022-08-05 00:29:49 +00:00
|
|
|
|
2022-08-11 23:58:43 +00:00
|
|
|
To get the memory consumption, I opened Activity Monitor on Mac, and recorded
|
|
|
|
the GtkWave memory usage before and after loading the large VCD file, and
|
|
|
|
took the difference.
|
|
|
|
|
|
|
|
I noticed that when running FastWave in the VsCode terminal as opposed
|
|
|
|
to the MacOS system terminal or the Lapce terminal, FastWave is notably
|
|
|
|
slower.
|
|
|
|
|
2022-08-12 00:04:06 +00:00
|
|
|
## Results
|
2022-08-11 23:58:43 +00:00
|
|
|
|
2022-10-26 18:21:19 +00:00
|
|
|
LZ4 should really improve memory usage once I add it. Note that GTKWave uses LZ4 on the fly.
|
|
|
|
|
2022-08-11 23:58:43 +00:00
|
|
|
| Software | Time(s) | Memory(MB) |
|
|
|
|
|----------|---------|------------|
|
2022-08-18 02:10:00 +00:00
|
|
|
| FastWave | ~27.30 | 1100+ |
|
2022-08-11 23:59:41 +00:00
|
|
|
| GtkWave | ~30 | 89.8 |
|
2022-05-22 00:40:46 +00:00
|
|
|
|
2022-07-28 14:43:58 +00:00
|
|
|
|
|
|
|
# Current Limitations
|
|
|
|
Unable to handle VCD files that have signals with more than
|
|
|
|
2^32 - 1 = 4,294,967,295 deltas/changes.
|
2022-04-14 04:50:37 +00:00
|
|
|
|
2022-08-12 00:04:06 +00:00
|
|
|
# Running
|
2022-04-14 04:50:37 +00:00
|
|
|
|
2022-08-01 16:29:25 +00:00
|
|
|
This repository comes with several smaller VCD files emitted from
|
|
|
|
various EDA tools. If you want a larger VCD file, grab one from
|
2022-04-14 04:50:37 +00:00
|
|
|
[here](https://drive.google.com/file/d/1pfm2qo2l8fGTHHJ8TLrg1vSGaV_TUbp2/view?usp=sharing).
|
|
|
|
|
2022-09-14 20:54:35 +00:00
|
|
|
Here are some examples you can run:
|
2022-04-14 04:50:37 +00:00
|
|
|
The first build of the program may take some time.
|
|
|
|
|
2022-09-14 20:54:35 +00:00
|
|
|
1. ``cargo run --release --example parse_vcd tests/vcd-files/aldec/SPI_Write.vcd``
|
|
|
|
2. ``cargo run --release --example vcd``
|
2022-04-14 04:50:37 +00:00
|
|
|
|
2022-06-22 01:06:51 +00:00
|
|
|
You can run all the tests with ``cargo test``
|
|
|
|
|
2022-08-04 18:29:29 +00:00
|
|
|
# Testing on Bad Files
|
|
|
|
You may wish to test the parser on a malformed VCD just to make
|
|
|
|
sure that the parser gives useful/sane errors.
|
|
|
|
|
|
|
|
Here's a command to test on a malformed VCD:
|
2022-09-09 06:59:33 +00:00
|
|
|
``cargo run --release --example parse_vcd tests/vcd-files/VCD_file_with_errors.vcd``
|
2022-08-04 18:29:29 +00:00
|
|
|
|
|
|
|
|
2022-05-19 02:57:42 +00:00
|
|
|
# TODO
|
2022-08-01 16:29:25 +00:00
|
|
|
|
2022-08-18 02:10:00 +00:00
|
|
|
## Features and Other
|
2022-09-02 21:00:14 +00:00
|
|
|
- [ ] add documenting comments
|
2022-09-13 23:35:23 +00:00
|
|
|
- [ ] make signal query private until later?
|
2022-09-14 17:37:50 +00:00
|
|
|
- [ ] add signal query code to example once interface is finalized
|
2022-09-13 23:35:23 +00:00
|
|
|
- [ ] change crate name to vcd_fast_parse
|
2022-09-06 14:29:36 +00:00
|
|
|
- [ ] perhaps we should be looking up signal values on the VCD class
|
|
|
|
- [ ] perhaps we should be returning signal trees from the VCD class
|
2022-09-02 21:00:14 +00:00
|
|
|
- [ ] add lz4 compression support and compare memory perf before and after
|
2022-09-06 14:29:36 +00:00
|
|
|
- [ ] may need to refactor with allow for get_mut for dynamic
|
|
|
|
compression-decompression for multiple signal structs
|
|
|
|
at once to allow for multi-threading
|
2022-09-02 21:00:14 +00:00
|
|
|
- [ ] test against large waveforms from the
|
|
|
|
[verilog-vcd-parser](https://github.com/ben-marshall/verilog-vcd-parser)
|
|
|
|
tool
|
2022-08-18 02:10:00 +00:00
|
|
|
- [ ] (a bit of work) consolidate error messages in validation phase
|
2022-09-02 21:00:14 +00:00
|
|
|
- [ ] once the access patterns of the GUI frontend are well understood,
|
|
|
|
create specific functions and restrict as many types to private
|
|
|
|
as possible
|
2022-07-20 14:38:56 +00:00
|
|
|
- [ ] Print out git commit or release number.
|
2022-09-02 21:00:14 +00:00
|
|
|
- [ ] do a read through all the code - look for uneeded code
|
2022-08-11 23:58:43 +00:00
|
|
|
- [ ] Move part of the performance section to another markdown file.
|
2022-06-19 13:44:57 +00:00
|
|
|
|
2022-08-01 16:29:25 +00:00
|
|
|
## Repairs
|
2022-09-08 13:59:24 +00:00
|
|
|
- [ ] replace str bracket indices with get(slice)
|
2022-08-01 16:29:25 +00:00
|
|
|
- [ ] make a custom date parser for possibly up to 18 different versions(that is, for each possible tool).
|
2022-07-14 22:52:12 +00:00
|
|
|
- [ ] Consolidate error messages and add cursors throughout.
|
2022-09-06 14:29:36 +00:00
|
|
|
- [ ] Add file and line to the enum errors.
|
2022-08-01 16:29:25 +00:00
|
|
|
- [ ] Fix warnings especially usage and restriction warnings once I'm
|
|
|
|
able to successfully parse all sample VCDs.
|
|
|
|
|
|
|
|
## Code Consistency
|
2022-08-11 23:58:43 +00:00
|
|
|
- [ ] Change error messages to line and filenames. Go through all calls to unwrap.
|
|
|
|
- [ ] search for any unwraps or any direct vectors indexing
|
|
|
|
- [ ] Handle TODOs
|
|
|
|
- [ ] Remove debug code/comments.
|
2022-08-01 16:29:25 +00:00
|
|
|
|
2022-08-18 02:10:00 +00:00
|
|
|
## Documentation
|
|
|
|
- [ ] Document indexing structure with diagram and possibly include the rational
|
|
|
|
|
2022-08-01 16:29:25 +00:00
|
|
|
## Marketing
|
2022-10-20 13:26:58 +00:00
|
|
|
- [ ] Send survey to community
|