BLITTER RE-CREATION THOUGHTS

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

Re: BLITTER RE-CREATION THOUGHTS

Post by exxos »

mfro wrote: Mon Aug 05, 2019 2:24 pm From what I understand (from variable names etc.) this is the Suska implementation of the blitter?
Yep.

mfro wrote: Mon Aug 05, 2019 2:24 pm As this works fine in the Suska board itself, I would assume the problems have something to do with the integration of the IP core.
I don't think it does though. If you look at suska benchmarks its scores seems to suggest its more running like a 16MHz machine.. and blitting ends up like 200% over a stock machine to start with (with blitter disabled) So your starting from in effect a 200% blitting speed.

Now turning the blitter on... so if you take 600% as suska blitting score and drop it down to a 100% base line CPU speed, it means the blitting test is half of 600% , 300% which is what we see. So in both cases there seems to be a 50% discrepancy in the blitter tests.
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
mfro
Posts: 122
Joined: Thu Dec 13, 2018 7:32 am

Re: BLITTER RE-CREATION THOUGHTS

Post by mfro »

exxos wrote: Mon Aug 05, 2019 2:54 pm ... If you look at suska benchmarks its scores seems to suggest its more running like a 16MHz machine...
Yes. You did recognise that the Suska RAM is clocked at 32 MHz?
Without looking into details, I would assume the core needs some adaption if transplanted to a machine with much slower RAM?
And remember: Beethoven wrote his first symphony in C.
User avatar
exxos
Site Admin
Site Admin
Posts: 23705
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: BLITTER RE-CREATION THOUGHTS

Post by exxos »

mfro wrote: Mon Aug 05, 2019 2:58 pm Yes. You did recognise that the Suska RAM is clocked at 32 MHz?
Without looking into details, I would assume the core needs some adaption if transplanted to a machine with much slower RAM?
That is what we are looking at now. We see ROM related tests are close to 100%, but more RAM related tests are not. Icky and I already talked about this via email a lot and I worked out the core would need to be running at least 28.5MHz to get to 100% speeds. But the bus access is still being synced to 8MHz... you can't run the suska core at 32MHz as is screws up the 8MHz bus access... So it would need 2 clocks to work.. and a huge code re-write. Either way, the code for it is like I said before, it just to slow to work at 8MHz. So we need Ijors core to try.
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
Cyprian
Posts: 389
Joined: Fri Dec 22, 2017 9:16 am
Location: Poland

Re: BLITTER RE-CREATION THOUGHTS

Post by Cyprian »

exxos wrote: Mon Aug 05, 2019 3:09 pm But the bus access is still being synced to 8MHz... you can't run the suska core at 32MHz as is screws up the 8MHz bus access... So it would need 2 clocks to work
just to clarify, the BLiTTER is clocked with 8Mhz but the bus is 4MHz, but only every other cycle is granted.It means that we have 4 cycles for one bus access
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
exxos
Site Admin
Site Admin
Posts: 23705
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: BLITTER RE-CREATION THOUGHTS

Post by exxos »

Does anyone knows how to patch the suska code to work properly on the ST ?
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
mfro
Posts: 122
Joined: Thu Dec 13, 2018 7:32 am

Re: BLITTER RE-CREATION THOUGHTS

Post by mfro »

Cyprian wrote: Mon Aug 05, 2019 3:39 pm
exxos wrote: Mon Aug 05, 2019 3:09 pm But the bus access is still being synced to 8MHz... you can't run the suska core at 32MHz as is screws up the 8MHz bus access... So it would need 2 clocks to work
just to clarify, the BLiTTER is clocked with 8Mhz but the bus is 4MHz, but only every other cycle is granted.It means that we have 4 cycles for one bus access
This is true.

But if you look at the Suska blitter core (wf101643ip_top_soc.vhd), you can see that processes operate on both clock edges of the 8 MHz clock (probably some wouldn't call that proper synchronous design, but that's how it's done for now), effectively doubling frequency.

Of course you can't do 'outside' bus cycles at 'odd' edges, but you can do other things internally.
And remember: Beethoven wrote his first symphony in C.
User avatar
mfro
Posts: 122
Joined: Thu Dec 13, 2018 7:32 am

Re: BLITTER RE-CREATION THOUGHTS

Post by mfro »

Maybe it helps when we examine what the blitter really does:
Blitter.png
Blitter.png (120.36 KiB) Viewed 4776 times
For each blit cycle and depending on the intended operation, worst case it needs to read the source word, read the destination word, do the logic op and write the destination word. It can't do memory accesses any faster than the CPU as it is bound to the same bus protocol and speed.

Now, why is it faster than the CPU doing the same?

- It does not need to read instructions from memory inbetween
- Skew requires a shift on the source data. the 68000 is very slow when shifting, the blitter can do this (barrel shifter) any width in a single cycle.

If you want that blit cycle at maximum speed, you need to align the memory accesses together as close as possible and try to fit internal operations (source skew shifting, halftone logic op, logic op and endmask masking operations) in between.

I would assume this is not optimal in your implementation. Maybe/probably you need to clock the blitter internally at higher speed (not a real problem, since your FPGA has probably unused PLLs that can provide that clock) to gain additional clock cycles for this internal operations.
And remember: Beethoven wrote his first symphony in C.
User avatar
exxos
Site Admin
Site Admin
Posts: 23705
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: BLITTER RE-CREATION THOUGHTS

Post by exxos »

Icky is working on just that. We are trying to clock the core at 32Mhz and clock the state machine (8MHz access) to still be a 8MHz clock.

Technically I did this with a real blitter years ago during booster work. I clocked the blitter at 16MHz when not accessing the bus. it gave 1% higher speeds, but its to be expected. But based on that, we could clock the suska core at 100mhz and it shouldn't really matter.

I still think its just the inefficiency of the code causing the requirement for a faster clock. I doubt the compiler can beat a pure logic design.
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
mfro
Posts: 122
Joined: Thu Dec 13, 2018 7:32 am

Re: BLITTER RE-CREATION THOUGHTS

Post by mfro »

exxos wrote: Tue Aug 06, 2019 8:26 am Icky is working on just that. We are trying to clock the core at 32Mhz and clock the state machine (8MHz access) to still be a 8MHz clock.
I would just clock the complete blitter (including the bus logic state machine) with 32 MHz. Then make sure signals going to the 8MHz side are kept stable for 4 (or whatever clock multiplication factor you have) clock cycles. Otherwise you'll likely run into lots of unnecessary headaches with clock domain crossings.
exxos wrote: Tue Aug 06, 2019 8:26 am I still think its just the inefficiency of the code causing the requirement for a faster clock. I doubt the compiler can beat a pure logic design.
No. 'Pure logic design' ist what synthesis generates. It can't do anything different than what you tell it to do, however.

If I understand correctly, you basically took a state machine designed for 32 MHz memory bus speed and transplanted it into a design where RAM needs four times longer to respond. You can't possibly expect the compiler to somehow 'magically' rewrite your state machine to adapt to this severely modified conditions?
And remember: Beethoven wrote his first symphony in C.
User avatar
exxos
Site Admin
Site Admin
Posts: 23705
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: BLITTER RE-CREATION THOUGHTS

Post by exxos »

mfro wrote: Tue Aug 06, 2019 9:15 am If I understand correctly, you basically took a state machine designed for 32 MHz memory bus speed and transplanted it into a design where RAM needs four times longer to respond. You can't possibly expect the compiler to somehow 'magically' rewrite your state machine to adapt to this severely modified conditions?
When talking to Wolfgang he said it was a "drop in replacement" so I literally took it as that. I did not know at the time that was incorrect and it was designed for a 32MHz bus. So no, I don't magically expect it to work, we are not stupid!
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.
Post Reply

Return to “FPGA DEVELOPMENT”