Replies: 3 comments 3 replies
-
This is an interesting idea and an expansion of the use case of the PLE. I designed/wrote the PLE to deliver as many payloads as a user wants (actually, there's is a limit of 1100 as of this writing) in a given cycle. Granted, this doesn't map to any real hardware construct outside of driving a bunch of wires at the same time, but it sure is convenient! To do what you want is very tricky. First, the following requirements much be adhered to:
How the PLE works:
To make the above change, these are the challenges that need to be addressed:
From the above use case, there are a couple of observations:
From those observations, maybe a good first implementation is to have the Scheduleable maintain all of the payloads to be delivered in the order in which they are either appended or based on a given sorting alg:
Of course this requires that the user of the PLE keep track of the scheduleable associated. These are my first thoughts. More discussion to be had! |
Beta Was this translation helpful? Give feedback.
-
After thinking about this thoroughly, yes I agree adding the |
Beta Was this translation helpful? Give feedback.
-
The drawback of this approach is: users have to collect all payloads for appending to Scheduleable before scheduling the PLE. However, not every payload preparing happens at the same place. Payload can be prepared at function A and function B, and they are scheduled in the same cycle! I intend to make PLE manage things like: knowing which scheduleable to be appended new payloads. So PLE may need to maintain a std::map to know which Scheduleable is mapped to the given cycle.
|
Beta Was this translation helpful? Give feedback.
-
Sparta framework is now good at specifying event ordering against other events. However, if the same event is scheduled twice in the same cycle, the ordering follows FIFO: the one being scheduled earlier is executed first.
I ran into a scenario that I need sorta ordering rules to be implemented when the same PLE is scheduled more than once in the same cycle. The ordering rule can be based on the type of the payload. For example, payloads have to be driven following the age order, however they may be always scheduled by the desired order.
I'd like to propose an idea to implement the idea in PLE. When a ordering rule is supplied to a PLE, it's always only a "single" Scheduleable being appended to the Scheduler in a cycle. PLE has to be enhanced with a data structure to stash those payloads scheduled for that cycle. When the Scheduleable is executed by the Scheduler, PLE will drive these payloads at the moment. The idea of implementing ordering is: when a PLE is scheduled, the payload will be appended to the data structure "by the specific ordering" in that cycle.
Any feedback is welcome. My initial thought is adding the ordering algorithm as a template parameter. Those mentioned enhancement will be activated only when a different algorithm is supplied.
Beta Was this translation helpful? Give feedback.
All reactions