01 March 2017, 15:54 | #1 |
Registered User
Join Date: Dec 2014
Location: germany
Posts: 439
|
Memory/bus access pattern on 68000
Hi,
can the 68000 use two consecutive bus cycles (even and odd) in case it was blocked from access the cycle before? Background: According to the HRM, when doing an BD-blit, the pattern is Code:
B0 - - B1 D0 - B2 D1 - D2 BTW, another (related) question: In the errata to the HRM, the cycle diagram for the above is given as Code:
- B0 - - B1 D0 - B2 D1 - D2 Last edited by chb; 01 March 2017 at 16:36. |
01 March 2017, 19:57 | #2 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
|
Quote:
I interpret the cycle diagram as saying that once the blitter has started its pipeline (and before it enters the final cycles) the pattern will be B(N+1) DN -. I think the errata is just clarifying that a BD-blit will start one cycle later than e.g. an AD-blit. My reading of the attached DMA visualization from WinUAE (I've grown quite fond of them ) seem to support this. I don't know for sure, but I don't think the 68k can ever use both the even and odd slots, but I could certainly be wrong. The following code was running (+some mouse checking etc.) when the screenshot was taken (only blitter DMA was enabled): Code:
move.l #custom, a6 move.l #-1, bltafwm(a6) moveq #0, d0 move.w d0, bltbmod(a6) move.w d0, bltdmod(a6) move.w #SRCB!DEST!$00, bltcon0(a6) move.w d0, bltcon1(a6) move.l #buf, d0 move.l d0, bltbpt(a6) move.l d0, bltdpt(a6) move.w #200*64, bltsize(a6) rept 1024*8 moveq #0, d0 endr waitblit |
|
01 March 2017, 22:02 | #3 |
Registered User
Join Date: Dec 2014
Location: germany
Posts: 439
|
Thanks a lot! Yes, it makes totally sense that the two consecutive idle cycles appear only at the beginning - I should have read the paragraph more carefully, actually it's titled "pipeline register" for a reason . Still interesting what happens when the blitter has two idle cycles, some modes with fill enabled should have this behavior, e.g. D only with fill. I'll check in UAE.
|
01 March 2017, 22:50 | #4 |
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
|
I am not 100% certain here, but I believe that the limiting factor is the 68000 microcode itself. It is written in such a way that the 68000 will not attempt memory accesses more often than every 4th cycle. Because of this, the CPU will not be able to utilize two free bus cycles that are directly after each other. (If it could, then CPU code would run significantly quicker during the no-display-DMA period compared to the 1-4bpl DMA period.)
|
01 March 2017, 23:14 | #5 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
|
Quote:
(I press shift+f12 and then type "v -3" enter, "g" and close the debugging window - Note: this seems to crash WinUAE 3.3.0 in some configurations... Haven't investigated further). |
|
01 March 2017, 23:16 | #6 |
Registered User
Join Date: Dec 2014
Location: germany
Posts: 439
|
I was thinking that maybe there's some internal flexible pipelining going on, e.g. a storage operation can be deffered to a later time, so that a cycle like CxCxCxCx (bus cycles, C cpu, x something with higher priority) can become CxCxxCCx. So not faster, only more flexible, and interleaving better with some blitter operations.
The original motivation was to find a blitter operation that, when running without other dma, does not slow down the cpu (using only every second cycle), apart from Zero-check or D only operations. I wasn't shure what happens if the cycle diagram gets e.g. B1 D0 - - B2 D1 - - B3 D2 - -, if both idle cycles are usable or only one, but I can check with UAE dma debugger, that's actually a good idea. EDIT: paraj, thanks a lot for the code! Last edited by chb; 01 March 2017 at 23:30. |
01 March 2017, 23:32 | #7 |
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
|
As far as I know there is no such pipelining within the 68000. Will be interested to hear if you find out otherwise
|
02 March 2017, 09:01 | #8 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
|
Quote:
I found this article about memory controller design for the 68k interesting: http://www.bigmessowires.com/2011/08...roller-design/ |
|
02 March 2017, 09:07 | #9 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
|
Quote:
https://github.com/tonioni/WinUAE/bl...itter.cpp#L100 which matches the observed BD- pattern. |
|
02 March 2017, 09:14 | #10 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
|
(Didn't remember to answer earlier)
68000 memory access is always 4 cycles (EDIT: or more if DMA steals cycles from CPU) but it can start in any 2 cycle boundary. There is no pipelining, previous or next instruction has no effect on current instruction execution timing. Quote:
If A channel is disabled, it becomes idle cycle. Blitter also has 2 extra idle cycles at the start of each blit. |
|
02 March 2017, 18:02 | #11 |
Registered User
Join Date: Dec 2014
Location: germany
Posts: 439
|
@all Thanks a lot for your help and the valuable information! Seems like my original idea does not work. Quite a pity that there's no cpu-over-blitter-priority mode, would come in handy in a couple of scenarios...
|
12 March 2017, 01:20 | #12 | |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,604
|
Quote:
If BLTPRI is on, only a very few blit types and weird minterms give cycles to the CPU, even when there are zero bitplanes etc stealing higher priority DMA cycles. B->D minterm is one of the weird minterms In other words, since B has the same capabilities as A (but C does not), if you used B for data instead, the blit would finish sooner. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
memory access speed question | Lord Riton | Coders. General | 42 | 27 February 2019 14:26 |
32-bit access on 16-bit bus? | NorthWay | Coders. Asm / Hardware | 7 | 04 September 2013 00:46 |
Break on Memory Access? | Khyron | support.WinUAE | 3 | 21 August 2010 00:10 |
access emulated memory | ara | support.WinUAE | 6 | 03 April 2010 13:05 |
[68000 ASM] Move memory to memory | AmigaBoy | Coders. General | 7 | 08 December 2009 08:16 |
|
|