24 January 2022, 22:41 | #1 |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
memory read/write penalty
Hey all, I understand there are extra memory access needed to read/write to odd addresses on 68020+ and it’s not possible on 68000/010, but what about for 68020+ with a long word read or write to a 2 byte alignment that is not a 4 byte alignment. Any additional cost for longs at those addresses?
As a side question, for the odd addresses is the penalty 2x access cost? Thanks! |
24 January 2022, 22:53 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
Yeah, 020+ has to read two consecutive 32-bit data if the address is only 1 or 2 byte aligned (not on a 32-bit boundary).
Last edited by a/b; 24 January 2022 at 23:26. Reason: typo... |
24 January 2022, 23:13 | #3 |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
Ok good to know, thanks! Couldn’t find much info except for the odd addresses.
|
25 January 2022, 07:44 | #4 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Not all odd addresses have a penalty. If you access a word that is fully contained inside an aligned long, then it is accessed at full speed. IOW, if the word is at an address of 1 modulo 4.
|
25 January 2022, 13:32 | #5 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,366
|
But what happens when you read word or long sequences from a not aligned memory block? Do you get a possible penalty only for the first read access, but then the following reads can re-use the previous data from the cache and only need to fetch the subsequent words or longwords from memory? Or is there still a cache read penalty?
|
25 January 2022, 14:38 | #6 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
|
Quote:
|
|
25 January 2022, 14:55 | #7 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,366
|
Thanks paraj, good to know that, because I always have my difficulties to understand the timing tables and the exact calculation of required clock cycles, and under WinUAE I can hardly measure with benchmarks how fast a real CPU would execute the code.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Memory Read/Write | xArtx | Coders. C/C++ | 20 | 18 March 2016 13:50 |
read/write error? | backtoskooldaze | support.Hardware | 3 | 07 September 2011 15:22 |
read but wont write | Dave_wb | support.Hardware | 0 | 09 December 2006 14:04 |
Read\Write Errors..... | THX1138 | support.Apps | 10 | 13 October 2004 15:24 |
CD Read Write Errors | Stom | support.WinUAE | 2 | 07 June 2002 18:46 |
|
|