Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!ogicse!decwrl!ucbvax!hplabs!hpfcso!hpldola!hp-lsd!dave From: dave@hp-lsd.COS.HP.COM (David C. Mueller) Newsgroups: comp.realtime Subject: Re: Predicting Execution Times for Processors with caches Message-ID: <15630004@hp-lsd.COS.HP.COM> Date: 6 Apr 90 21:11:07 GMT References: <765@telesoft.com> Organization: HP Logic Systems Division - ColoSpgs, CO Lines: 35 >So, the question for readers of this newsgroup is : how do you take >unpredictable instruction timings into account in designing your hard >real-time applications? > One possibility is to prototype pieces of code and take performance measurements as the pieces are put together. As you've stated, changes in the flow of code (preempting) does play havoc with the contents of the caches. If my understanding is correct, changing the execution flow is roughly the same as starting with an empty cache (i.e. where the code picks up execution is not in the cache). If this is true, then a worst case execution time for that stream of code can be modeled by running the code in the target system with the caches flushed at the beginning of the run. Other subtle things may have an effect on the execution timing. For example, modifying the target system's memory access time has first order and second order effects on the overall execution time. Obviously having a slower memory access time means slower overall execution time. However, on processors such as the 68020/030 the slower memory access time allows the execution unit portion of the processor to overlap ALU-type operations with the ongoing bus cycle. The 68020/030 can even perform bus cycles in different order (program fetches vs. operand cycles) depending on access times. The bottom line here...simply scaling the instruction cycle count by the clock rate is not 100% accurate. Just as a recommendation...look into some emulation/analysis tools. They offer a quick way to make performance measurements IN YOUR TARGET SYSTEM.. and often times have built in statistical features that allow you to get worst case response times in "real life" examples. As always...contact your local HP representative :-) Dave Mueller