Hi Bill, Just sent you an RFC with 2 FSMs. Had to fight a bit with graphviz. Not finished yet. I will continue working on it if you think that makes sense... Christophe.
On 9 May 2016 at 17:15, Bill Fischofer <bill.fischo...@linaro.org> wrote: > As we discussed in our call, we can both play around with graphviz and see > if a prettier diagram can be constructed that is perhaps clearer, possibly > with two separate FSMs. > > On Mon, May 9, 2016 at 9:39 AM, Christophe Milard < > christophe.mil...@linaro.org> wrote: > >> >> >> On 9 May 2016 at 16:28, Bill Fischofer <bill.fischo...@linaro.org> wrote: >> >>> >>> >>> On Mon, May 9, 2016 at 7:58 AM, Christophe Milard < >>> christophe.mil...@linaro.org> wrote: >>> >>>> I am a bit confused by this diagram: It feels to me that timers and >>>> timeout have separate lives (even , if of course some dependency exist). >>>> From this diagram, it feels like these 2 separate objects (timers and >>>> time out events) share states...? do they? >>>> >>> >>> Actually they do, which is what this diagram is trying to express. When >>> a timer is set one of the arguments is the timeout event that should be >>> associated with it, so it is an error to attempt to free that event while >>> it is associated with a set timer (results are undefined if you do). >>> Timers are somewhat unique in this respect. >>> >> >> Sorry, Bill I still don't get it: Aren't you saying here that these are 2 >> separate FSMs, but that these 2 separate FSMs are actually >> actionned/"triggered" by (partly) the same events? There is nothing wrong >> with that... Then they should be represented as 2 separated FSM with the >> same event names on the transitions triggered by the same events... >> Or I am very confused... >> >> Christophe. >> >>> >>> >>>> In my head, and from the understanding I had, it feels that the to 4 >>>> top states are for timers, whereas time-out events have only 2 states: >>>> Unallocated or allocated. >>>> It feels you are doing 1 FSM out of two. Maybe , it should be two FSM >>>> (keeping the same transition names to show the dependancy.) >>>> >>>> And I guess there is a typo at "odp_timeout_freee(). >>>> >>> >>> Thanks. I'll fix that in the next version. >>> >>> >>>> >>>> Christophe >>>> >>>> On 7 May 2016 at 18:15, Bill Fischofer <bill.fischo...@linaro.org> >>>> wrote: >>>> >>>>> Signed-off-by: Bill Fischofer <bill.fischo...@linaro.org> >>>>> --- >>>>> doc/images/.gitignore | 1 + >>>>> doc/images/timer_fsm.gv | 38 >>>>> ++++++++++++++++++++++++++++++++++++++ >>>>> doc/users-guide/Makefile.am | 1 + >>>>> 3 files changed, 40 insertions(+) >>>>> create mode 100644 doc/images/timer_fsm.gv >>>>> >>>>> diff --git a/doc/images/.gitignore b/doc/images/.gitignore >>>>> index a19aa75..72cf7ec 100644 >>>>> --- a/doc/images/.gitignore >>>>> +++ b/doc/images/.gitignore >>>>> @@ -1,2 +1,3 @@ >>>>> resource_management.svg >>>>> pktio_fsm.svg >>>>> +timer_fsm.svg >>>>> diff --git a/doc/images/timer_fsm.gv b/doc/images/timer_fsm.gv >>>>> new file mode 100644 >>>>> index 0000000..f8cb21a >>>>> --- /dev/null >>>>> +++ b/doc/images/timer_fsm.gv >>>>> @@ -0,0 +1,38 @@ >>>>> +digraph timer_state_machine { >>>>> + rankdir=LR; >>>>> + size="12,20"; >>>>> + node [fontsize=28]; >>>>> + edge [fontsize=28]; >>>>> + node [shape=doublecircle]; Timer_Unalloc >>>>> + Timeout_Unalloc >>>>> + Timeout_Delivered; >>>>> + node [shape=rectangle]; Timeout_Queued; >>>>> + node [shape=circle]; >>>>> + Timer_Unalloc -> Timer_Alloc [label="odp_timer_alloc()"]; >>>>> + Timer_Alloc -> Timer_Unalloc [label="odp_timer_free()"]; >>>>> + Timer_Alloc -> Timer_Set [label="odp_timer_set_abs()"]; >>>>> + Timer_Alloc -> Timer_Set [label="odp_timer_set_rel()"]; >>>>> + Timer_Set -> Timer_Alloc [label="odp_timer_cancel()"]; >>>>> + Timer_Set -> Timeout_Alloc >>>>> + [label="odp_timer_cancel()" constraint=false]; >>>>> + Timer_Set -> Timeout_Queued [label="=>odp_queue_enq()"]; >>>>> + Timeout_Queued -> Timeout_Delivered [label="odp_schedule()"]; >>>>> + Timeout_Unalloc -> Timeout_Alloc >>>>> + [label="odp_timeout_alloc()" >>>>> constraint=false]; >>>>> + Timeout_Alloc -> Timeout_Unalloc >>>>> + [label="odp_timeout_free()" constraint=false]; >>>>> + Timeout_Alloc -> Timer_Set >>>>> + [label="odp_timer_set_abs()" >>>>> constraint=false]; >>>>> + Timeout_Alloc -> Timer_Set >>>>> + [label="odp_timer_set_rel()"]; >>>>> + Timeout_Delivered -> Timer_Unalloc [label="odp_timer_free()"]; >>>>> + Timeout_Delivered -> Timer_Set [label="odp_timer_set_abs()"]; >>>>> + Timeout_Delivered -> Timer_Set [label="odp_timer_set_rel()"]; >>>>> + Timeout_Delivered -> Timeout_Delivered >>>>> + [label="odp_timeout_from_event()"]; >>>>> + Timeout_Delivered -> Timeout_Delivered >>>>> + [label="odp_timeout_timer()"]; >>>>> + Timeout_Delivered -> Timeout_Unalloc >>>>> + [label="odp_event_free() / >>>>> odp_timeout_freee()" >>>>> + constraint=false]; >>>>> +} >>>>> diff --git a/doc/users-guide/Makefile.am b/doc/users-guide/Makefile.am >>>>> index 74caa96..6bb0131 100644 >>>>> --- a/doc/users-guide/Makefile.am >>>>> +++ b/doc/users-guide/Makefile.am >>>>> @@ -30,6 +30,7 @@ IMAGES = $(top_srcdir)/doc/images/overview.svg \ >>>>> $(top_srcdir)/doc/images/release_git.svg \ >>>>> $(top_srcdir)/doc/images/segment.svg \ >>>>> $(top_srcdir)/doc/images/simple_release_git.svg \ >>>>> + $(top_srcdir)/doc/images/timer_fsm.svg \ >>>>> $(top_srcdir)/doc/images/tm_hierarchy.svg \ >>>>> $(top_srcdir)/doc/images/tm_node.svg >>>>> >>>>> -- >>>>> 2.5.0 >>>>> >>>>> _______________________________________________ >>>>> lng-odp mailing list >>>>> lng-odp@lists.linaro.org >>>>> https://lists.linaro.org/mailman/listinfo/lng-odp >>>>> >>>> >>>> >>> >> >
_______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp