comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Duration for GNAT on ARM
Date: Tue, 23 Dec 2014 23:42:51 +0100
Date: 2014-12-23T23:42:51+01:00	[thread overview]
Message-ID: <14woqdx7yg0ry.eghy2k6aafqc.dlg@40tude.net> (raw)
In-Reply-To: ly7fxi5afe.fsf@pushface.org

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


  reply	other threads:[~2014-12-23 22:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 21:21 Duration for GNAT on ARM Simon Wright
2014-12-23 22:42 ` Dmitry A. Kazakov [this message]
2014-12-23 22:52   ` J-P. Rosen
2014-12-24  0:27     ` Simon Wright
2014-12-24  9:40       ` Simon Wright
2014-12-24  0:04   ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox