« Return to Thread: RE: Digest Number 1127

RE: Digest Number 1127

by Corey, Richard :: Rate this Message:

Reply to Author | View in Thread

Why wouldn't everyone always enable cache?

 

Sometimes predictability or determinism is more important than average
speed.

 

If testing and  _proving_   consistent behavior is more important than
average throughput (i.e. safety-critical or high-regulated
applications), cache indeterminacy may invalidate all the V&V testing.
"Failure to certify" trumps "performance".  Reducing the number of
variables makes thorough testing easier.  

 

1.  Suppose you have to prove that you will   _always_   meet a certain
deadline (for example in an ISR).  If you tested in such a way that the
ISR code was always found in cache, and then in the field it rarely was
not, your test would have passed but the system would have failed.

 

2.  Sometimes in control loops, jitter in a delay can disrupt the
system.  A loop that was "slow but steady" could be tuned and behave
predictably.  A loop that was sometimes fast and sometimes slow may
behave too unpredictably.

 

3. Just in general, "determinism" increases confidence.  When the "worst
case" is all-important, you need to be sure that your testing and
experience caught all possible worst-cases, so you want as few variables
as possible.  In safety-critical apps, you would like the worst-case and
best case to be the same, so you could know that "it will always do
exactly the same thing, and we tested the heck out of that thing".  

 

You might suggest "test with cache turned off and then turn it on in
delivered code", but sometimes "faster" can cause problems not
previously seen - like exposing an unanticipated race condition, or
buffer underflow at "just the wrong time".  When safety matters, you
really do have to ship what you tested.

 

Embedded control apps can have unusual needs.

 

Rick Corey

 

Rick Corey  | Software Engineer | Crane Aerospace & Electronics | Home:
425-741-5857 |
Desk: 1 425-743-8469 | M: +1 908-887-0722  | F: +1 425-743-8540 |
richard.corey@...
<mailto:richard.corey@...>  

 

________________________________

From: MPC500@... [mailto:MPC500@...]
Sent: Wednesday, January 07, 2009 12:29 PM
To: MPC500@...
Subject: [MPC500] Digest Number 1127

 

MPC500
<http://groups.yahoo.com/group/MPC500;_ylc=X3oDMTJkdTIwa21oBF9TAzk3MzU5N
zE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNoZHIEc2xrA2hwaARzd
GltZQMxMjMxMzYwMTM5>

Messages In This Digest (2 Messages)

1a.

AN2789 - MPC5500 Configuration and Initialization From: stevenaschroeder


1b.

Re: AN2789 - MPC5500 Configuration and Initialization From: Dobbin Allan


View All Topics
<http://groups.yahoo.com/group/MPC500/messages;_ylc=X3oDMTJmNG1vNmY1BF9T
Azk3MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNkbXNnBHNs
awNhdHBjBHN0aW1lAzEyMzEzNjAxNDA-?xm=1&m=p&tidx=1>  | Create New Topic
<http://groups.yahoo.com/group/MPC500/post;_ylc=X3oDMTJmbWI0aXZ2BF9TAzk3
MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNkbXNnBHNsawNu
dHBjBHN0aW1lAzEyMzEzNjAxNDA->  

Messages

1a.

AN2789 - MPC5500 Configuration and Initialization
<http://groups.yahoo.com/group/MPC500/message/3975;_ylc=X3oDMTJxOHZibnVs
BF9TAzk3MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BG1zZ0lkAzM5
NzUEc2VjA2Rtc2cEc2xrA3Ztc2cEc3RpbWUDMTIzMTM2MDE0MA-->

Posted by: "stevenaschroeder" stevenaschroeder@...
<mailto:stevenaschroeder@...?Subject=%20Re%3AAN2789%20-%20MPC5500%
20Configuration%20and%20Initialization>   stevenaschroeder
<http://profiles.yahoo.com/stevenaschroeder>

Wed Jan 7, 2009 9:23 am (PST)

I have been experimenting with Freescales, MPC5500 initialization code
and wonder if someone could clarify a few things for me. Running down
the list of configuration functions:

cfg_CACHE - If I understand, the cache is not active out of reset, so
this simply enables it. (1) Why wouldn't you want to do this? (2) If
you know the particular part has cache, is there a need to check
L1CFG0?

cfg_FMPLL - The Reference refers to setting the clock with your final
values with RFD+1, then reducing RFD after lock. (1) Why would you
want to set the clock to a series of rates, waiting for locks, such as
the 132MHz example? (2) What is the significance of inhibiting the
cache?

cfg_SRAM - To initialize the SRAM's ECC. Not doing this is probably
bad--more than just loosing ECC, it may flip bits incorrectly on read?

cfg_FLASH - What has changed at this point to allow less internal
flash wait states?

cfg_MMU - If BAM's flat setup of the MMU is adequate, is there any
reason to worry about this?

Thanks in advance.
Steve

Back to top

Reply to sender
<mailto:stevenaschroeder@...?Subject=Re%3AAN2789%20-%20MPC5500%20C
onfiguration%20and%20Initialization> | Reply to group
<mailto:MPC500@...?Subject=%20Re%3AAN2789%20-%20MPC5500%20Co
nfiguration%20and%20Initialization> | Reply via web post
<http://groups.yahoo.com/group/MPC500/post;_ylc=X3oDMTJxcThhdWwyBF9TAzk3
MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BG1zZ0lkAzM5NzUEc2Vj
A2Rtc2cEc2xrA3JwbHkEc3RpbWUDMTIzMTM2MDE0MA--?act=reply&messageNum=3975>
Messages in this topic
<http://groups.yahoo.com/group/MPC500/message/3803;_ylc=X3oDMTM1ZWswbTBr
BF9TAzk3MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BG1zZ0lkAzM5
NzUEc2VjA2Rtc2cEc2xrA3Z0cGMEc3RpbWUDMTIzMTM2MDE0MAR0cGNJZAMzODAz> (5)

1b.

Re: AN2789 - MPC5500 Configuration and Initialization
<http://groups.yahoo.com/group/MPC500/message/3976;_ylc=X3oDMTJxNGdycWg5
BF9TAzk3MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BG1zZ0lkAzM5
NzYEc2VjA2Rtc2cEc2xrA3Ztc2cEc3RpbWUDMTIzMTM2MDE0MA-->

Posted by: "Dobbin Allan" Allan.Dobbin@...
<mailto:Allan.Dobbin@...?Subject=%20Re%3A%20AN2789%20-%20MPC55
00%20Configuration%20and%20Initialization>   allandobbin2000
<http://profiles.yahoo.com/allandobbin2000>

Wed Jan 7, 2009 9:54 am (PST)

I am not familiar with any of these specific files, but will try to
answer some from a general perspective:

cache - correct, cache is disabled out of reset. To enable cache you
have to write the L1CSR0 to turn on the cache, plus you have to make
specific memory cachable within its MMU setting - note that some of the
MMU settings already be cachable out of reset. (1) Why would you want
to enable cache - cache is only one access cycle so your code will
executes faster. Note that Idd will increase when you use the cache.
(2) There is no need to check L1CFG0 - this is constant data for each
part in the family and merely confirms the size of the cache.

FMPLL - this allows you to set you sysclk to your desired rate. (1)
Changing PREDIV and MFD forces the PLL to re-lock which means the
frequency swings either side of the final locking frequency. If you are
setting the max sysclk i.e. 132, the sysclk would swing above that value
briefly during the locking phase and its possible the part could fail if
the frequency is too high. To prevent this, you get it to lock with the
post divider (RFD) at +1 (i.e. divide by 2) i.e. 66MHz so that max freq
is not violated. Once the PLL has locked, you set RFD to desired value
to get desired frequency (i.e. 132M) and since the post divider is
outside of the VCO loop, there is no relocking or overshoot during this
second step. (2) can't think of a good reason why cache is inhibited
here.

SRAM ECC - you HAVE to init the SRAM after a power up (not required
after a RESET) by performing a 64-bit write. Failing to do so means
that the 72-bit SRAM word (64-bit data plus 8-bit ECC checksum) has
incorrect checksum and any accesses other than a 64-bit write will cause
it to fail and generate an exception or bus error. Not initialising the
SRAM doesn't mean bits will flip, it means you simply cannot read or
write the SRAM.

cfg_FLASH - the Flash comes out of reset with maximum wait-states.
Refer to the ref manual, but even at max sysclk frequency, maximum wait
states are not required, so to get improved performance from the flash,
you would set the minimum possible wait-states for your operating
frequency.

cfg_MMU - I'm not familiar with the details of the files but reasons for
changing MMU would be to enable cache or VLE for specific regions, to
set memory blocks for external memory or even to re-arrange the entire
memory map to suit your own prefferential memory map if so desired.

- Allan

________________________________

From: MPC500@... <mailto:MPC500%40yahoogroups.com>
[mailto:MPC500@... <mailto:MPC500%40yahoogroups.com> ] On
Behalf
Of stevenaschroeder
Sent: Wednesday, January 07, 2009 11:24 AM
To: MPC500@... <mailto:MPC500%40yahoogroups.com>
Subject: [MPC500] AN2789 - MPC5500 Configuration and Initialization

I have been experimenting with Freescales, MPC5500 initialization code
and wonder if someone could clarify a few things for me. Running down
the list of configuration functions:

cfg_CACHE - If I understand, the cache is not active out of reset, so
this simply enables it. (1) Why wouldn't you want to do this? (2) If
you know the particular part has cache, is there a need to check
L1CFG0?

cfg_FMPLL - The Reference refers to setting the clock with your final
values with RFD+1, then reducing RFD after lock. (1) Why would you
want to set the clock to a series of rates, waiting for locks, such as
the 132MHz example? (2) What is the significance of inhibiting the
cache?

cfg_SRAM - To initialize the SRAM's ECC. Not doing this is probably
bad--more than just loosing ECC, it may flip bits incorrectly on read?

cfg_FLASH - What has changed at this point to allow less internal
flash wait states?

cfg_MMU - If BAM's flat setup of the MMU is adequate, is there any
reason to worry about this?

Thanks in advance.
Steve

[Non-text portions of this message have been removed]

Back to top

Reply to sender
<mailto:Allan.Dobbin@...?Subject=Re%3A%20AN2789%20-%20MPC5500%
20Configuration%20and%20Initialization> | Reply to group
<mailto:MPC500@...?Subject=%20Re%3A%20AN2789%20-%20MPC5500%2
0Configuration%20and%20Initialization> | Reply via web post
<http://groups.yahoo.com/group/MPC500/post;_ylc=X3oDMTJxbXBtcGtvBF9TAzk3
MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BG1zZ0lkAzM5NzYEc2Vj
A2Rtc2cEc2xrA3JwbHkEc3RpbWUDMTIzMTM2MDE0MA--?act=reply&messageNum=3976>
Messages in this topic
<http://groups.yahoo.com/group/MPC500/message/3803;_ylc=X3oDMTM1N2dxb2E3
BF9TAzk3MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BG1zZ0lkAzM5
NzYEc2VjA2Rtc2cEc2xrA3Z0cGMEc3RpbWUDMTIzMTM2MDE0MAR0cGNJZAMzODAz> (5)

Recent Activity

Visit Your Group
<http://groups.yahoo.com/group/MPC500;_ylc=X3oDMTJlaGZyaTdwBF9TAzk3MzU5N
zE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwN2dGwEc2xrA3ZnaHAEc
3RpbWUDMTIzMTM2MDE0MA-->

Yahoo! News

Fashion News
<http://us.ard.yahoo.com/SIG=13o3h1hjf/M=493064.12016309.12445701.867457
8/D=groups/S=1706554205:NC/Y=YAHOO/EXP=1231367340/L=/B=ZumijULaX.Y-/J=12
31360140424163/A=3848621/R=0/SIG=12u6o6g3h/*http:/news.yahoo.com/i/1597;
_ylt=A9FJqa5Gxa5E2jgAYQKVEhkF;_ylu=X3oDMTA2MnU4czRtBHNlYwNzbg-->

What's the word on

fashion and style?

Yahoo! Finance

It's Now Personal
<http://us.ard.yahoo.com/SIG=13onp3da7/M=493064.12016257.12445664.867457
8/D=groups/S=1706554205:NC/Y=YAHOO/EXP=1231367340/L=/B=Z.mijULaX.Y-/J=12
31360140424163/A=4507179/R=0/SIG=12de4rskk/*http:/us.rd.yahoo.com/evt=50
284/*http:/finance.yahoo.com/personal-finance>

Guides, news,

advice & more.

Drive Traffic

Sponsored Search
<http://us.ard.yahoo.com/SIG=13oi6bp1v/M=493064.12016255.12445662.867457
8/D=groups/S=1706554205:NC/Y=YAHOO/EXP=1231367340/L=/B=aOmijULaX.Y-/J=12
31360140424163/A=4025338/R=0/SIG=12jnci1fd/*http:/us.rd.yahoo.com/evt=44
092/*http:/searchmarketing.yahoo.com/srch/index.php>

can help increase

your site traffic.

Need to Reply?

Click one of the "Reply" links to respond to a specific message in the
Daily Digest.

Create New Topic
<http://groups.yahoo.com/group/MPC500/post;_ylc=X3oDMTJlbDE4YjI2BF9TAzk3
MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNmdHIEc2xrA250
cGMEc3RpbWUDMTIzMTM2MDE0MA--> | Visit Your Group on the Web
<http://groups.yahoo.com/group/MPC500;_ylc=X3oDMTJjYjhhc2s5BF9TAzk3MzU5N
zE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNmdHIEc2xrA2hwBHN0a
W1lAzEyMzEzNjAxNDA->  

Messages
<http://groups.yahoo.com/group/MPC500/messages;_ylc=X3oDMTJlNHF1bmN0BF9T
Azk3MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNmdHIEc2xr
A21zZ3MEc3RpbWUDMTIzMTM2MDE0MA-->  | Links
<http://groups.yahoo.com/group/MPC500/links;_ylc=X3oDMTJmMGVnY3M3BF9TAzk
3MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNmdHIEc2xrA2x
pbmtzBHN0aW1lAzEyMzEzNjAxNDA->  

-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu <http://www.freescale.com/mcu>



MARKETPLACE

________________________________

From kitchen basics to easy recipes - join the Group from Kraft Foods
<http://us.ard.yahoo.com/SIG=13r61nkqk/M=493064.12016295.13271503.108355
68/D=groups/S=1706554205:MKP1/Y=YAHOO/EXP=1231367340/L=/B=ZemijULaX.Y-/J
=1231360140424163/A=5530388/R=0/SIG=11nuutlas/*http:/explore.yahoo.com/g
roups/kraftmealsmadesimple/>

Yahoo! Groups
<http://groups.yahoo.com/;_ylc=X3oDMTJkZ29mYjllBF9TAzk3MzU5NzE1BGdycElkA
zYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNmdHIEc2xrA2dmcARzdGltZQMxMjMxM
zYwMTQw>
Change settings via the Web
<http://groups.yahoo.com/group/MPC500/join;_ylc=X3oDMTJmOHAzNXRmBF9TAzk3
MzU5NzE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNmdHIEc2xrA3N0
bmdzBHN0aW1lAzEyMzEzNjAxNDA->  (Yahoo! ID required)
Change settings via email: Switch delivery to Individual
<mailto:MPC500-normal@...?subject=Email%20Delivery:%20Indivi
ual%20Email>  | Switch format to Traditional
<mailto:MPC500-traditional@...?subject=Change%20Delivery%20F
ormat:%20Traditional>  
Visit Your Group
<http://groups.yahoo.com/group/MPC500;_ylc=X3oDMTJkOTdnaW0wBF9TAzk3MzU5N
zE1BGdycElkAzYyNzYzODcEZ3Jwc3BJZAMxNzA2NTU0MjA1BHNlYwNmdHIEc2xrA2hwZgRzd
GltZQMxMjMxMzYwMTQw> | Yahoo! Groups Terms of Use
<http://docs.yahoo.com/info/terms/> | Unsubscribe
<mailto:MPC500-unsubscribe@...?subject=Unsubscribe>

 
<http://geo.yahoo.com/serv?s=97359715/grpId=6276387/grpspId=1706554205/m
sgId=1127/stime=1231360139/nc1=3848621/nc2=4507179/nc3=4025338>


--------------------------------------------------------------------------------

We value your opinion!  How may we serve you better?
Please click the survey link to tell us how we are doing.

http://www.craneae.com/surveys/satisfaction.htm

Your feedback is of the utmost importance to us. Thank you for your time.


--------------------------------------------------------------------------------
>>>>>>>>>> Crane Aerospace & Electronics Confidentiality Statement <<<<<<<<<<
The information contained in this email message may be privileged and is confidential information intended only for the use of the recipient, or any employee or agent responsible to deliver it to the intended recipient. Any unauthorized use, distribution or copying of this information is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender immediately and destroy the original message and all attachments from your electronic files.


This e-mail message has been scanned and cleared by MailMarshal

--------------------------------------------------------------------------------


[Non-text portions of this message have been removed]

 « Return to Thread: RE: Digest Number 1127