6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 3:16 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Apr 16, 2023 8:24 pm 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
... with graphics pixel blitters.

This is kind of my response to the graphics ideas in the 24bit parallel colour data to HDMI thread. Especially Proxy's post on multi-MPU systems:
Proxy wrote:
while writing this i thought more about the network idea, and how modern GPUs have so many cores that each of them can take care of a small set of pixels.
so, what if you had more than 2 CPUs? 4x 65C02's for example that all share the same fast single port SRAM with a video circuit. a lot of graphic operations can be split into multiple smaller pieces (like scrolling or drawing shapes).
my idea of connecting them was to have all CPUs run on the same clock with the same phase. but then use extra logic to restrict their time on the bus when PHI2 is high.
Attachment:
gimp-2.10_woQn9hkGhn.png
gimp-2.10_woQn9hkGhn.png [ 29.61 KiB | Viewed 1093 times ]
using bus tranceivers and latches (latches because data is only read on the falling edge of PHI2, so the data needs to be stored), each CPU could get a small part of PHI2=High time without having the CPUs themself run at extreme speeds. but of course the more there is on the bus the faster the support logic needs to run, which comes dangerously close to FPGA territory.

anyways, overall i still think that for these kinds of graphical goals you likely won't get something useable without either progammable logic, a crazy setup like the multicore bus sharing, or both!
i still wish you luck with whatever you might have planned, and i'm eager to see it work!


The major difference between Proxy's diagram and mine (if I've understood correctly) is that I stagger the PHI2 clock signal to each '816 and instead of having a specific video access period I have a memory access window where none of the '816s are accessing memory.
Attachment:
Timing.png
Timing.png [ 39.19 KiB | Viewed 1093 times ]
Think of the yellow signal as being a memory access window. The first 65C816 Board's memory address and data are kept of the main memory bus until time SEL3 where a read or write from main memory can be done.

Similarly 65C816 Board 2 is kept off the main memory bus until time SEL0 where a read or write from main memory can be done.

The blue line indicating PHI2 for each board is asymmetric with PHI2 being low for only 25ns and then high for 75ns. This is done so that there are 50ns to do address decoding and to ensure that the address lines are stable before the memory access in the last 25ns happens. For those wondering the result of a read is latched so that it can continue to be presented to the '816 after the memory access window closes.

Fundamentally this is all there is to it. Any device can do anything it wants as long as it understands it only has a 25ns window in which it can access the main shared memory bus.

That main memory bus includes the video device. The thing that actually produces a pretty video signal.

Attachment:
Sorta Block Diagram.png
Sorta Block Diagram.png [ 30.4 KiB | Viewed 1093 times ]
If the Pixel Blitter is given its own memory access window then it can use that to read from main memory during one access and write into video memory during a second access. Or read from video memory or write into main memory or any other combination. The video back buffer is just addresses on the main memory bus.

(In the picture above I should have labelled 'Address Decode' as 'Address Bus' and 'Main Memory Decode' as 'Main Memory Bus'.)

But now we can get a bit more involved. The Pixel Blitter and the 65C816 Board can share a memory access window provided that they never both try to use it at the same time. That means that whilst the '816 is doing stuff the Pixel Blitter must be disconnected from the main memory bus.

And that means the the '816 cannot access the main memory bus whilst the Pixel Blitter is doing things. (Remember this is only for shared memory access windows. If the '816 is using one memory access window and the Pixel Blitter another then that's fine. They can both run in parallel).

Deny a running '816 access to memory is considered bad form and leads to unhappiness. And that is why each 65C816 Board also has its own private memory. The 512KB SRAM in the diagram. In fact the device access that drives the Pixel Blitter (or any device) can only happen when the '816 is running against private memory. That private memory mode - called Kernal Mode - is accessed by interrupt. Either a software or hardware interrupt. When the '816 runs user programs in main memory - that I've called User Mode. The '816 returns to user mode after an RTI has been called for every interrupt that's currently counted. (Bit of a side design digression there.)

Attachment:
Bigger Block Diagram.png
Bigger Block Diagram.png [ 29.14 KiB | Viewed 1093 times ]
Putting it all together we can now have multiple devices in a memory access window provided that only one ever accesses memory during that window. And there can be multiple devices* running in parallel in separate memory access windows.

And that is how I'm planning on generating 60FPS in a high resolution of 400x300 at 8bpp 8) . Or lower, but usable, frame rates in 800x600.

* This includes an SD card device running in SD mode doing very, very fast block transfers into and out of main memory. That's why there's an SD card on the main memory bus too.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 19, 2023 6:29 am 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1431
Looks nice so far, except for your approach to generating the PHI2 clock signals.

The problem when using 74LVC163 plus 74LVC139 for PHI2 clock generation in a multiprocessor system is,
that there might be spikes in the 74LVC139 outputs.

A more reliable approach for generating the clock signals would be using a ring counter
built from a shift register (like 74LVC164).


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 19, 2023 6:20 pm 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
ttlworks wrote:
Looks nice so far, except for your approach to generating the PHI2 clock signals
Thanks! And I was worried about using an adder and decoder to generate glitch free pulses.

Originally I latched the output of the counter on the opposite edge of the adder clock with a 574. But I've since tried LVC138, LVC139, VHC138 and a VHC139 decoders with inputs from 163 and 393 adders (from the same families) and the decoder outputs are consistently long and glitch free*. I only tested at 100MHz and 40MHz.

It's quite possible that not all manufacture's chips will be equal but the Nexperia LVC and Toshiba VHC jobs I've used have worked well.

* Within the limits of what I can see with my okay'ish Siglent SDS1204.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 19, 2023 6:29 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1043
Location: near Heidelberg, Germany
Typically I use a shift register to create multiple phases of e.g. phi2, e.g. clock the SR with 8 times Phi2. Then use simple combinatorial logic like AND/NAND/OR/... to combine usually only two of the phases for a specific output signal. No worries about delays in counters or adder.

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 19, 2023 7:24 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 988
Location: Potsdam, DE
I've wondered about using a synchronous counter (x163?) to generate combinational pulses which ought to be clean.

Neil


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 20, 2023 8:54 am 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
I've not managed to work out an easy way of getting the values into a '595 shift register on reset. And I can't use a '165 because I need multiple outputs (SEL0, SEL1, SEL2 and SEL3 from my first post).

A bit off topic but I use a pair of '273s for a 12bit ring counter for pixel doubling, tripling, quadrupling in the video device. I can use three '157s to either input the outputs of the '273's previous stage back into itself or use the '157s other inputs to load the '273s from the '816. 12bits is a good number because I can get 1X, 2X, 3X, 4X and 6X pixel stretching by feeding one of the '273's outputs into the count enable of the address adder.

Conventional wisdom suggests using a '161 or '163 to generate combinatorial pulses is not a good idea as the outputs may not update simultaneously. But it's worked for me so I'd suggest experimenting before you commit to using it. Similarly a '138 decoder may glitch slightly before settling, even with simultaneous inputs. But, again, it's worked perfectly for me with the logic families I've used.


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 20, 2023 9:00 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 988
Location: Potsdam, DE
Yeah, it's the basic 'thou shalt not mix clocked and combinational logic'... gets you every time.

Neil


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 20, 2023 11:01 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1043
Location: near Heidelberg, Germany
IIRC the Commodore PET creates various clock signals and then gates them all through a register clocked with 8 or 16 MHz can't remember which. This makes them all in sync, without glitches

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 60 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: