BLITTER RE-CREATION THOUGHTS

Progress on our FPGA cores.
User avatar
exxos
Site Admin
Site Admin
Posts: 23497
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: BLITTER RE-CREATION THOUGHTS

Post by exxos »

Cyprian wrote: Fri Oct 16, 2020 8:17 pm there the CPU starts the BLiTTER 4 cycles (1 bus access) later.
Interesting.. so how many bus cycles does it take each line then ?
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
Icky
Site Admin
Site Admin
Posts: 3986
Joined: Sun Sep 03, 2017 10:57 am
Location: UK

Re: BLITTER RE-CREATION THOUGHTS

Post by Icky »

Cyprian wrote: Fri Oct 16, 2020 8:17 pm great news looks almost perfect.
I wonder about two things:
- "1st image" - the right part - marked "Sprahlaphobia". CPU bars (white/grey/red) above the BLiTTER activity are skewed but should be straight like those below the BLiTTER activity area. Looks like something delays the CPU by 4 cycles (one bus access) each line.
I will take a look at that. Thanks for the pointer.
Cyprian wrote: Fri Oct 16, 2020 8:17 pm - "2nd image" are you sure they are marked correctly? For me the right part, marked "Sprahlaphobia" is actually the real STE, and the left part is "Sprahlaphobia" - there the CPU starts the BLiTTER 4 cycles (1 bus access) later.
Yes you are right. I have the two screenshots on the 2nd picture round the wrong way.

So from your descriptions there seems to be a 4 cycle delay indicated in both images.
User avatar
Cyprian
Posts: 387
Joined: Fri Dec 22, 2017 9:16 am
Location: Poland

Re: BLITTER RE-CREATION THOUGHTS

Post by Cyprian »

@exxos @Icky
unfortunately I have a busy day ahead, I'll try write more tomorrow evening .
Long short story: 1) I have a suspicion about your FPGA BLiTTER register $FFFF8A38, write to it could introduce 4 CPU cycle delay (red part before the BLiTTER is fired). 2) In general the FPGA BLiTTER cycles look ok, but internal split between bus mastering and data access looks strange (blue green black pattern in the 2nd screen)
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
http://260ste.atari.org
User avatar
Cyprian
Posts: 387
Joined: Fri Dec 22, 2017 9:16 am
Location: Poland

Re: BLITTER RE-CREATION THOUGHTS

Post by Cyprian »

1st image / BLiT_H6a.s
1st_image.png
1st_image.png (247.03 KiB) Viewed 4492 times
"The green stairs" - One green step is 1 bus cycle long (4 low res pixels / 4 CPU clocks)

Top - real STE
Red box has 4 bus cycles width (four green steps). Below is the code responsible:

Code: Select all

; $FFFF8240:	SHIFTER Color Rgister 0
; $FFFF8A38:	BLiTTER Y-Count (count of words in my case)
	move.w D6,(A3)		; A3: $FFFF8240 	D6: $F00	/ RED COLOR
	move.w D0,(A0)		; A0: $FFFF8A38		D0: 128*50 	/ WORDS COUNT
	move.w D3,(A3)		; A3: $FFFF8240		D3: $FFF	/ WHITE COLOR
Bottom - Sparklaphobia
Red box has 5 bus cycles width (five green steps)
This is one bus cycle more than real STE, and it could be caused by additional waitstate? in "move.w D0,(A0)" (write to the BLiTTER register)



2nd image / BLiT_H6a4f
2st_image.png
2st_image.png (745.21 KiB) Viewed 4492 times
The red line (just below a red box) is responsible for starting the BLiTTER. I highlighted it with the green stairs

Top - real STE
The green stairs have 5 steps. They start 1 bus cycle earlier than red box. Below is the code responsible:

Code: Select all

; $FFFF8A38:	BLiTTER Y-Count (count of words in my case)
; $FFFF8240:	SHIFTER Color Rgister 0
; $FFFF8A3C:	BLiTTER Line Number Register 	
	move.w D0,(A0)		; A0: $FFFF8A38		D0:	(63*15)+1	/ WORDS COUNT
	move.w D6,(A3)		; A3: $ffff8240		D6: $F00 		/ RED COLOR
	move.b D1,(A1)		; A1: $FFFF8A3C		D1: $80			/ BLiTTER START
	nop
Bottom - Sparklaphobia
The green stairs have 6 steps. They start in the same spot/column as than red box.
1) The delay is caused by issue with "move.w D0,(A0)" as above
2) 6 green steps - it means that the Sparklaphobia starts one bus cycle later than the BLiTTER
3) The red arrows show green spot which is in the different place (one bus cycle later) maybe due to point 2)


Attached (BLiT_R1.zip - binary plus source code) you can find a new test which writes some data to the BiTTER without starting it. We could see whether the BLiTTER/Sparklaphobia access time is the same or different.
There are five red boxes:
3x Red/Green boxes - this is a control area (only the CPU)
2x Red boxes - test write to the BLiTTER/Sparklaphobia. The first box - write to BLiTTER Y COUNT, the second one - BLiTTER Halftone.
BLiT_R1.png
BLiT_R1.png (2.34 KiB) Viewed 4492 times
Usage:
BLiT_R1
SPACE - quit
1 - 50Hz
2 - 60Hz


Btw BLiT_H6a4f usage is:
SPACE - quit
1 - 50Hz
2 - 60Hz
3 - Delay 2
4 - Delay 1
Attachments
BLiT_R1.zip
(2.62 KiB) Downloaded 161 times
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
http://260ste.atari.org
User avatar
Icky
Site Admin
Site Admin
Posts: 3986
Joined: Sun Sep 03, 2017 10:57 am
Location: UK

Re: BLITTER RE-CREATION THOUGHTS

Post by Icky »

Thanks @Cyprian. I know you said you had a busy day yesterday so appreciate the effort. I will take a look with your new program later as I too am distracted by non-Atari things this morning.

Hopefully we can zero in on where the issue is in the core or the board and solve this :)
terriblefire
Moderator Team
Moderator Team
Posts: 5368
Joined: Mon Aug 28, 2017 10:56 pm
Location: Glasgow, UK

Re: BLITTER RE-CREATION THOUGHTS

Post by terriblefire »

Just a side note on verification of this kind of problem. I have some experience with this.

If you have a test case that can be put in the registers of an emulator and simultaneously put in the registers of the new blitter then my approach has been to get a fast PC do the same test in the emulator C code and using a Verilator model then compare RAM.

Then put this test into a for loop N times with each loop generating random inputs that get passed to both tests.

This worked a treat verifying that the Amber CPU had bugs in some of its ALU functions.
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
User avatar
Icky
Site Admin
Site Admin
Posts: 3986
Joined: Sun Sep 03, 2017 10:57 am
Location: UK

Re: BLITTER RE-CREATION THOUGHTS

Post by Icky »

Thanks @terriblefire will look into that as well. My FPGA skills are still growing and this is going to be another learning curve :)
User avatar
Icky
Site Admin
Site Admin
Posts: 3986
Joined: Sun Sep 03, 2017 10:57 am
Location: UK

Re: BLITTER RE-CREATION THOUGHTS

Post by Icky »

A little bit more progress but I think still a long way to go....

After trying out @Cyprian's 3rd program on the Sparkalaphobia I got the below pattern which clearly was not right:

Sparkalaphobia in STFM before modifying clocks - program 3.jpeg
Sparkalaphobia in STFM before modifying clocks - program 3.jpeg (166.42 KiB) Viewed 4420 times

I played around with the clocks and timings and managed to get the third program on the Sparkalaphobia to look like this:

Sparkalaphobia in STFM - program 3.jpeg
Sparkalaphobia in STFM - program 3.jpeg (140.47 KiB) Viewed 4420 times

Which if you compare it to the same program in the same STFM with an original Blitter the pattern there is as follows, which looks identical unless anyone can spot a difference in there:

Original in STFM - program 3.jpeg
Original in STFM - program 3.jpeg (137.04 KiB) Viewed 4420 times

Now running the other two programs there are some very slight differences but one that sticks out is the black square on the first program on the original is at the top right and on the sparkalaphobia its moved just off centre to the left and down a bit.


Original - program 1:
Original in STFM - program 1.jpeg
Original in STFM - program 1.jpeg (152.54 KiB) Viewed 4420 times

Sparkalaphobia - program 1:
Sparkalaphobia in STFM - program 1.jpeg
Sparkalaphobia in STFM - program 1.jpeg (138.41 KiB) Viewed 4420 times

The second program looks like I have got the green stairs in @Cyprian's description down to 5 steps and but they look shifted to the left by one:


Original - program 2:
Original Blitter in STFM - program 2.jpeg
Original Blitter in STFM - program 2.jpeg (115.93 KiB) Viewed 4420 times

Sparkalaphobia - program 2:
Sparkalaphobia in STFM - program 2.jpeg
Sparkalaphobia in STFM - program 2.jpeg (122.47 KiB) Viewed 4420 times

BUT these changes have pushed the GEMBench scores up and we are now in the 99%-100% ranges where as before we were in the 98%-100% ranges across all the tests:

IMG_5817.jpeg
IMG_5817.jpeg (174.5 KiB) Viewed 4420 times
User avatar
Cyprian
Posts: 387
Joined: Fri Dec 22, 2017 9:16 am
Location: Poland

Re: BLITTER RE-CREATION THOUGHTS

Post by Cyprian »

Great progress @Icky

One remark, regarding 2nd image / BLiT_H6a4f (actually the same issue is in the 1st but easier shows it here). The first Sparkalaphobia line is 1 bus access shorter than the BLiTTER's one. The difference is visible in the second line:
- it starts 1 bus cycle earlier (should be 2 bus cycles between each lines beginnings);
- and also green spot should be at the beginning of the second line but in case of Sparkalaphobia, it is on the second position (marked with the red arrow in my previous post);
and also in the first line - the ending "red" should be under "3", in case of Sparkalaphobia it is between "2" and "3"
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
http://260ste.atari.org
User avatar
Icky
Site Admin
Site Admin
Posts: 3986
Joined: Sun Sep 03, 2017 10:57 am
Location: UK

Re: BLITTER RE-CREATION THOUGHTS

Post by Icky »

Thanks @Cyprian that will be my next focus.
Post Reply

Return to “FPGA DEVELOPMENT”