Skip to content
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

ContikiClock enhance controling rTimer resolution and CLOCK_SECOND #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alexrayne
Copy link
Contributor

@alexrayne alexrayne commented May 7, 2020

this patch provide mote control of cooja ContikiClock controling rTimer resolution and CLOCK_SECOND. It work in cooperate with contiki-ng PR #1257 , that provide mote-side resolution control.

Since resolution of mote polling was hard-fixed on 1ms, this accuracy not enough for TSCH stack simulate. A bit changes on slot-operation timing algorithm crushes abylity to syncheonise TSCH motes with each other, since this accuracy can`t be less then 1ms. (Present stack surprisingly takes into sync, bu with the cost of not accurate sync of transmition slot start - it is adjust transmition to 1ms granularity. Looks that sync achieves only with RTIMER_GUARD=0 ).

To provide cooja with accurate syncronise need allow RTIMER_BUSY_WAIT work with accuracy of rtmer, hat demanded by TSCH stack about 32kHz. (but even 8rHz pretty enough)

So for precise resolution, no any cooja sim project changes need to do - it takes mote project RTIMER_CONF_ARCH_SECOND into account, if mote build with PR #1257.
Evaluated roesolution display in log, and saves with .csc project, so, later, this setup loads with project. And if mote have no resolution setup, saved one used as default.

So there:

  • resolution of system clock was hard-fixed on 1kHz, now mote can provide it by simCLOCK_SECOND

  • mote can provide resolution for rTimer by simRtimerResolution_hz. This affects polling period of mote.

    By default cooja polls mote by 1ms. But for accurate process better time precision
    need polling with less then 1ms. rTimer also ordinary much more precise.

  • RTIMER_BUSY_WAIT resolution was downgraded to 1ms. now Mote can provide time for precise wait via simRtimerWaitTime.

…D control from mote

+ resolution of system clock was fixed on 1kHz, now mote cat provide it by simCLOCK_SECOND

+ resolution for rTimer mote can provide by simRtimerResolution_hz. This affects polling periodof mote.
   By default mote polls by 1ms. But for accurate process better time precision
   need polling with less then 1ms. and rTimer ordinary much more precise.

+ RTIMER_BUSY_WAIT resolution was downgrade to 1ms. Mote can provide time for precise wait via simRtimerWaitTime
   it overrides simProcessRunValue polling to requested time
… old resolution config from mote.

    Now mote surely define resolution config - is it used or not.

TODO: If we need define resolution for old projects, have to implement interface visual comtrol. But
   mote config is much easy way to do this.

* It still can be manualy defined resolution setups in project. And will loads and override defaut resolution.
@alexrayne
Copy link
Contributor Author

alexrayne commented May 10, 2020

I drop saving resolution settings into sim project - they are override default old behaviour, if mote is old - not provided resolution. If project have no resolution setting, mote fully controls resolution - so that RTIMER_CONF_ARCH_SECOND surely controls simulation style.

Project`s setting config leaved for later implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant