From: Bart Veer <bartv@ecoscentric.com>
To: oyvind.harboe@zylin.com
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] HAL_DELAY_US() default implementation
Date: Sun, 26 Jun 2005 14:26:00 -0000 [thread overview]
Message-ID: <20050626142647.175E565C0A4@smtp.ecoscentric.com> (raw)
In-Reply-To: <1119425206.20805.21.camel@localhost.localdomain> (message from =?ISO-8859-1?Q?=D8yvind?= Harboe on Wed, 22 Jun 2005 09:26:46 +0200)
>>>>> "Oyvind" == =?ISO-8859-1?Q?=D8yvind?= Harboe <ISO-8859-1> writes:
Oyvind> Ref
Oyvind> http://ecos.sourceware.org/ml/ecos-patches/2005-06/msg00033.html
Oyvind> Looks good.
Oyvind> Thoughts on a default implementation:
Oyvind> - Add calibration by default on startup. There are so many
Oyvind> things affecting the performance: type of ram/flash,
Oyvind> caches, off-frequency crystals(e.g. 64MHz instead of 66
Oyvind> MHz crystal), etc. I'm not entirely convinced that the
Oyvind> calibration number can be put in the source and committed
Oyvind> to CVS. E.g. for the AT91 there are 5 HALs X 3 types of
Oyvind> code memory(internal, external & flash) 15 calibration
Oyvind> numbers. The number of combinations for all the eCos HAL's
Oyvind> could easy reach thousands.
Oyvind> - Calibration can be disabled by specifying the number in
Oyvind> a CDL option. This number is extracted by running the app
Oyvind> in the debugger and setting a breakpoint at the end of the
Oyvind> calibration loop.
Oyvind> - The calibration algorithm must have some sort of way to
Oyvind> estimating the accuracy to determine when the calibration
Oyvind> should terminate. Integer math.
For most platforms I do not think this level of complexity is
necessary. Usually the memory speed will be irrelevant because the
busy loop will run entirely out of icache. Off-frequency crystals are
a possibility, but the difference between 64MHz and 66MHz is just
three percent. For the purposes of HAL_DELAY_US() i.e. interacting
with hardware, as long as the code assumes the faster speed the
difference may not be worth worrying about.
If complicated calibration really is needed then this can be done by
individual HALs. I would much prefer not to see an expensive
calibration loop in any generic code. When porting eCos it is far too
easy to just quickly use some existing suboptimal code instead of
doing the job properly, leading to problems down the road.
Bart
--
Bart Veer eCos Configuration Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2005-06-26 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-22 7:26 Øyvind Harboe
2005-06-26 14:26 ` Bart Veer [this message]
2005-06-26 17:11 ` Øyvind Harboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050626142647.175E565C0A4@smtp.ecoscentric.com \
--to=bartv@ecoscentric.com \
--cc=ecos-discuss@sources.redhat.com \
--cc=oyvind.harboe@zylin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).