Remove identifier from bit string and guarantee lower case #19
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Yehowshua/FastWaveBackend#19
Loading…
Reference in a new issue
No description provided.
Delete branch "bitparsing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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).
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 supportedBut 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:
bc7c6913ce/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 returnString
, you probably don't need the initialto_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?
bc7c6913ce/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.