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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news.mb-net.net!open-news-network.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Duration for GNAT on ARM Date: Tue, 23 Dec 2014 23:42:51 +0100 Organization: cbb software GmbH Message-ID: <14woqdx7yg0ry.eghy2k6aafqc.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: U4QLlmK9N8crXOB/8z60pA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.giganews.com comp.lang.ada:191516 Date: 2014-12-23T23:42:51+01:00 List-Id: On Tue, 23 Dec 2014 21:21:57 +0000, Simon Wright wrote: > You use -gnatS to get GNAT to output a representation of package > Standard. > > If you do this with a native compiler, you get (typically) > > type Duration is delta 0.000000001 > range -((2 ** 63 - 1) * 0.000000001) .. > +((2 ** 63 - 1) * 0.000000001); > for Duration'Small use 0.000000001; > > However, if I do this with both GNAT GPL 2014 and FSF GCC 4.9.1 > cross-compiling to arm-eabi for the STM32F4 family (Cortex M4), I get > > type Duration is delta 0.020 > range -((2 ** 31 - 1) * 0.020) .. > +((2 ** 31 - 1) * 0.020); > for Duration'Small use 0.020; > > I can understand the 32-bit vs 64-bit part - a misguided attempt at > efficiency, perhaps - but who gets to say that the clock runs at 50 Hz? E.g. those who have time source derived from timer interrupts. > On the STM32's with STMicroelectronics' HAL, the tick is 1 kHz. But does the RTL assumed by the compiler use this clock? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de