enjoy-digital / litescope

Small footprint and configurable embedded FPGA logic analyzer
Other
160 stars 38 forks source link

Add edges #10

Closed bunnie closed 5 years ago

bunnie commented 6 years ago

I've added edge triggering support to litescope. It's not pretty, but it seems to work at least in my basic tests.

Definitely needs a lot more testing and API work, so I'd recommend you pull this to a dev branch and test it before merging, but wanted you to have a look at the code in case you had any helpful suggestions or spotted anything I might have done wrong.

bunnie commented 6 years ago

I've now added two-trigger sequencing. So now you can pick two sets of triggers and have them occur in sequence, or you can ignore one or both of them by configuring the hitcount.

This is pretty rough code, but it works at least for the purpose I need it for. The edge code is pretty clean but the multi-trigger code is ugly.

Probably it should be recoded to allow for a fully configurable number of triggers, at the moment, it's limited to two because I haven't figured out how to dynamically add FSM states based upon a number of triggers parameter. Or rather, I was more concerned about getting two triggers to work before generalizing to N triggers.

Now that it's gotten here, a logical next step would be to refactor to allow for N triggers, but also, this hugely blows up the amount of logic used by the analyzer front end, so really I should devise a "toy" application to test this instead of my full application design. I'm trying to stay focused on my application design, so I'm just going to send this PR now for you to review/pick ideas from or totally reject if you think the approach is just wrong.

enjoy-digital commented 6 years ago

Thanks for that. I'm not going to merge directly but as discussed together this has given me ideas and motivation to improve the code. Some changes i just did:

I'll try to add the hard edges detection and hitcount features. Do you see others limitations or features that would be useful for you?

bunnie commented 6 years ago

This is amazing. Which commit/branch should I look at to try out your latest version with the storage directly in the sampling clock domain?

-b.

On 05/29/2018 06:00 AM, enjoy-digital wrote:

Thanks for that. I'm not going to merge directly but as discussed together this has given me ideas and motivation to improve the code. Some changes i just did:

  • remove the cd_ratio parameter and operate the Storage directly in the sampling clock domain.
  • add multi-triggering support. (this allow defining multi-triggering condition, and allow to do rising/falling edge detection in software).
  • some others cleanup/simplification.

I'll try to add the hard edges detection and hitcount features. Do you see others limitations or features that would be useful for you?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/enjoy-digital/litescope/pull/10#issuecomment-392609253, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHT9-qYLtKCQsXBj1A6RvX8aNNqJbejks5t3HN7gaJpZM4UPYZx.

-- ^'~*-,._.^'~-,._.^`'~-,..^`'~*-,..^'~*-,._.^'~-,._.^`'~-,._.^`'

enjoy-digital commented 6 years ago

You can use the master branch.

enjoy-digital commented 5 years ago

Closing since changes described in https://github.com/enjoy-digital/litescope/pull/10#issuecomment-392609253 are implemented.