Origen-SDK / o2

MIT License
4 stars 0 forks source link

Timing2 #79

Closed coreyeng closed 4 years ago

coreyeng commented 4 years ago

Hello,

Here're some updates to give timesets a bit more flexibility. The structure was based off the STIL spec and is organized more or less as a tree via timeset -> wavetable -> wave group -> wave -> event.

Currently, instantiating timing can be rather verbose. Adding just a couple of waves can get a bit messy.. see the instantiation here. That said, this PR is more just to get the general structure down. I think that this structure can represent any timesets that we'd encounter and should be able to handle complex timings that we see in scan (and modeled off of STIL for that reason).

For this PR, I'm looking more for feedback on timing that we still can't represent. #63 was just to get something on the board and with this I'm hoping to get an interface that can represent anything we'd need. If there doesn't seem to be any missing pieces here for the representation itself, then I'll start adding some more user-friendly features to it. Context managers, some shortcut methods (add_drive_wave, add_verify_wave, etc.), and the like can all be added later as long as the underlying representation is sufficient. Though, crazy timings may still need to fall back to the more verbose API, but I think that'd be expected, and why its there.

The only things I think I'm missing from STIL are inheritance and bases. I did some minor inheritance here, just a wave-to-wave inheritance, to make sure that the structure I had in the backend wasn't going to hit the borrow-checker wall. It seems to hold up alright with a wave creation able to access another wave and its events, so moving up the ladder shouldn't be a problem. This'll also help with the above point in addition to rounding out STIL support.

Some other things that're along for the ride:

coreyeng commented 4 years ago

@Origen-SDK/o2-core-developers Any objections to merging this (after I resolve the conflicts)? I've got a prototype of the tester which I built off of this. I can either just push it to this branch, or merge this and open a new PR is a few days for the tester.

Thanks!