From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: longest path through a task Date: Fri, 29 May 2015 17:31:25 +0100 Organization: A noiseless patient Spider Message-ID: References: <9ad1fcdc-cdf9-4ff0-aa7e-051d53b6736a@googlegroups.com> <7d56e720-5e91-4950-b4ae-29d7ddbdc11a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="8f3bdf433f184ad9fec01bd73e350c65"; logging-data="19532"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Gu4x7y7klbWGot6AdmupsByqG9MRxGMs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:WhLTtqA1DkAxoIJTInAGgHyiOxk= sha1:eRRXOGkBG/n+dYLwmwQj+ZYIpHk= Xref: news.eternal-september.org comp.lang.ada:26071 Date: 2015-05-29T17:31:25+01:00 List-Id: Simon Wright writes: > Just did some measurements (clumsily) using the Cortex-M4 counter as > in [1], and from entering the Ada handler to the triggered task > starting to execute averaged at 1200 cycles (6.7 us) with -Og, 1070 > cycles (5.9 us) with -O2. There is some code in the C handler to > redirect to the Ada handler: see [2], starting at line 236. The code in the C handler takes 150 cycles. So, for my FreeRTOS-based RTS, interrupt to Ada handler is 150 cycles, Ada handler to task is 1200 cycles, grand total 1350 cycles or 7.5 microseconds (core clock 180 MHz). I understand that a 1-millisecond tick is inadequate for some control applications (though the Crazyflie seems to do OK with FreeRTOS); maybe one could use one of the other timers on the STM32F4 to act as the basis for the hard control loop, while retaining the Ada tasking for less demanding aspects?