-
Notifications
You must be signed in to change notification settings - Fork 8
Fix sample index and label handling #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
GetSampleNumber returns 0 for the first sample, so we don't need to subtract one when using AdvanceToAbsPosition. Doing so on recent versions of Logic results in the analyzer completely failing to analyze the waveform since subtracting 1 from a 0 value U64 results in the U64 equaling UINT64_MAX
I found a few other related issues that I'm going to add fixes for in this PR. |
The end of the transaction is always the same sample as clock for the cycle that is being parsed.
* Ensure strings are null initialized and terminated * Remove data bit accounting for waveform view * Fix corruption of dummy label on waveform view
8a39eef
to
ce4ebfc
Compare
Thanks for the contribution, I will check and merge them tomorrow. |
Not subtracting 1 causes an error in the simulation, tested in Logic 2, KingstVIS, and newest Logic 2 Update.
It has been a while since I started the project, so my memory may be off, but its definitely there for a reason. I believe AdvanceToNextEdge is always called the first iteration, and I can confirm mCurrentSample is not 0 the first time its executed, at least for the clock/polarity config I was using. So I'm not sure how it was causing the analyzer to fail. Can you tell me what the analyzer settings you were using? And were you using the simulator, or device when you experience the crashes? I'm not sure why but I can't get logic 1 to attach a debugger right now, and logic 2 isn't hitting any breakpoints, I remember I had trouble with it before but don't really want to go through it all again. So for now I think the best thing to do is just do a check for zero. |
Apparently -1 was causing issues for a user in newer versions of logic.
I am capturing from a real device, with the following settings. Note: In my local modifications I have changed "Dummy Clocks" to "Dummy Cycles" to make configuration a bit easier.
I was able to debug in Logic 2, and from what I remember
Here's what it looks like on my modified version with real data in Logic 2. Everything is aligned and analyzed as expected. Perhaps this is a difference between KingVTS and Logic 2? |
I do like Dummy cycles more, its definitely more appropriate. Thanks for posting your settings, I'll try them out tomorrow. Ah ok I see what you mean now, I had it lining up to the start of the next clock cycle to give more room for the labels when zooming out, or else you just see "D". |
I am planning to submit this as a PR, just fell down the priority list.
What about just dropping the D/Data labels entirely? It should be obvious from context that this is data. |
Sure that sounds good to me, I've already got the project open so I made the quick change. |
Were you still going to make another pull request? |
GetSampleNumber returns 0 for the first sample, so we don't need to subtract one when using AdvanceToAbsPosition. Doing so on recent versions of Logic results in the analyzer completely failing to analyze the waveform since subtracting 1 from a 0 value U64 results in the U64 equaling UINT64_MAX