Closed oscargus closed 1 year ago
I'm now realizing that .to_lowercase
will probably break if there are VCD files with strings in them which as far as I know is supported
But I think this only convert bit strings, i.e., if they start with b. Not sure how strings are encoded though...
Strings are parsed here: https://github.com/ThePerfectComputer/FastWaveBackend/blob/bc7c6913cefef78e5a4c8f1bb7895573bfae53c9/src/vcd/parse/events.rs#L493
so that is not affected by this PR.
Great! Just one more thing for performance: you should probably use .to_ascii_lowercase()
. And since both return String
, you probably don't need the initial to_string
Fixed!
These are just for non-string type signals right? That is, a state machine string signal should still retain its arbitrary cases for example?
Huh, are state signals not encoded as strings?
I should say non-value signals. So X, U, Z, etc...
String such as "STATE_start" and "STATE_stop" should be left untouched IMO
I agree, but I also think this is what this PR does, no? As Oscar said above arbitrary string parsing happens here right? https://github.com/ThePerfectComputer/FastWaveBackend/blob/bc7c6913cefef78e5a4c8f1bb7895573bfae53c9/src/vcd/parse/events.rs#L493
I might also be completely misunderstanding how this code works :D
This PR is only for bits and bit vectors (or whatever the formal name is), yes. Strings are still untouched (as far as I understand the code). The benefit is that the consumer (in this case Surfer) does not have to convert to lower case or check double case variants. As it most likely happens more often in the consumer I thought it made sense to make this change in the provider.
Turns out that the bit string was stored including the identifier.
Also, it is better from an end user perspective that the string is always in lower or upper case, independent of the context in the VCD. Here I arbitrarily selected lower case (which is what Surfer assumes).