6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Apr 25, 2024 8:44 am

All times are UTC




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Feb 03, 2004 10:36 pm 
Offline

Joined: Thu Aug 14, 2003 11:01 pm
Posts: 23
Is it possible to do parallel processing with 6502s?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 04, 2004 4:42 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8427
Location: Southern California
Alright, since nobody else has jumped in--

Quote:
Is it possible to do parallel processing with 6502s?

Sure. It seems like we've talked about that on the forum, but I can't find it now.

One way to do it would be to use dual-port memory for two processors. I've never heard of memory with more than two ports though if you wanted to have three or more processors using it.

There has been some talk of having two processors running on oposite phases of the system clock so they can each access things on the bus in turn, similar to how the Apple II did the video. (The processor accessed memory during the usual phase-2-high time and the video could access the same memory during the phase-2-low time, so both could access the same memory seemingly at the same time without slowing down and without using dual-port memory.) Actually you could have multiple non-overlapping clocks, each with the duty cycle being a little less than the inverse of the number of processors you wanted to have sharing the same memory. Obviously there's a speed penalty though.

Of course one thing you can do is to offload some I/O jobs from the main processor onto microcontrollers that are fine for tiny jobs but can't handle the overall job. For example, if you had to do a ton of bit-banging to keep an SMBus serial interface busy with a 6502, it might be better to just interface to a PIC microcontroller and let the PIC babysit the SMBus interface while the 6502 does something else productive.

But if you really want several 6502's working in parallel, I think you'd be better off making separate computers, even if they're on the same board, and making some kind of miniature network to tie them together.

The one thing I don't know how to deal with is how to split up jobs between the various processors such that the "administrative" overhead and all the communicating between computers doesn't take up so much of the time that you lose the performance advantage you had hoped to gain in having parallel processors. I suppose it depends on what kind of work you want to do with the system. Maybe the administrative overhead would eat up a pretty small percentage of the gains if you want to do something like Fourier transforms on large arrays. Then each separate computer could take its job and go off in its corner and not bother the master computer for a long time. This is one subject I'd like to hear more of from someone experienced with multiprocessor programming. (Edit: Andre Fachat answered this in post #17 of this topic.)

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Last edited by GARTHWILSON on Tue Nov 02, 2010 4:36 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 04, 2004 10:21 pm 
Offline

Joined: Sun Jan 19, 2003 12:27 am
Posts: 11
I have a Rockwell databook from 1984 or so that has advance information on a part (6529?) with two '02 cores operating out of phase. That would have been a fun part. Anybody know if these saw the light of day?

-Dave


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Feb 05, 2004 6:03 am 
Offline

Joined: Thu Jan 16, 2003 12:55 pm
Posts: 64
Location: Indianapolis
I wrote some multi-processor code.. sort-of.

On an SNES program, I had 2 CPUs doing distinct parts of the same task. In this case, it was necessary. The main CPU (a 65816) was running music playing code that results in about 16 bytes of data (control data for a synth).

Then it would sync with the co-CPU that controls the sound in that system (it's very similar to a 6502, but with MOV instead LDx), transfer those bytes, and I had the co-CPU decode that data and translate it to the right format for the soundchip.

This way of doing I guess would be good if you're doing something that can be broken cleanly into distinct tasks like that. It's more like writing 2 seperate programs.. maybe not what you have in mind.

BTW, about simulating dual-port RAM, there've been some interesting posts about that on the nesdev forum:
http://nesdev.parodius.com/cgi-bin/wwwthreads/showpost.pl?Board=nesdev&Number=802&page=&view=&mode=threaded&sb=#Post802


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Feb 07, 2004 9:01 pm 
Offline

Joined: Fri Jun 27, 2003 8:12 am
Posts: 618
Location: Meadowbrook
Common memory shared with multipel processors sort of urinates me off as I have to deal with this arcade game called Galaga whihc uses 3 seperate Z80s tied into a single 2K RAM memory which is a common memory for both.
The system is amazingly touchy and likes to use capacitor delays for critical RAM timing. I designed an adapter to help out with the one issue, but overall, I think of it as a fairly lousy design.

If one were to do multiple CPUs, I WOULD like to esee each cPU have its own RAM and RO:M system for their tasks, and the coomon RAM to be used to commands and data rather than critical zero page and internal variables for the CPUs. This way also, if any of the processors drop out, it doesnt drive the entire system crazy. You can put in code to handle such events.

_________________
"My biggest dream in life? Building black plywood Habitrails"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 09, 2004 10:19 pm 
Offline

Joined: Thu Aug 14, 2003 11:01 pm
Posts: 23
So kinda sorta like a beowulf cluster (i.e mutiple computers hooked up to make one big one). Thats an easier way to do parallel processing in my opinion, since each processor has its own ram and rom. Although the idea of a shared common ram is sorta beyond me at the moment.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Feb 14, 2004 4:40 am 
Offline

Joined: Sun Dec 28, 2003 11:55 am
Posts: 54
Hey ya'll... I had a thought on this... could the 6522's be used as the interface for multiple cpu's? Like just jerryrigging a connection between a two or more 6522's and it would almost be like connecting two computer via a serial port or the like right?
Lyos Gemini Norezel

_________________
Mundus Vult Decipi et Decipiatur


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Feb 14, 2004 8:20 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8427
Location: Southern California
Right, but it's not necessarily jerryrigging at all.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 15, 2004 8:21 pm 
Offline

Joined: Sun Dec 28, 2003 11:55 am
Posts: 54
Ye... I know... but for me the term "jerryrigging" is used for anything built by amatures and not by factories or the like.
Lyos Gemini Norezel

_________________
Mundus Vult Decipi et Decipiatur


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 29, 2004 6:47 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Lyos Gemini Norezel wrote:
Hey ya'll... I had a thought on this... could the 6522's be used as the interface for multiple cpu's? Like just jerryrigging a connection between a two or more 6522's and it would almost be like connecting two computer via a serial port or the like right?
Lyos Gemini Norezel


This is, in fact, the reason the original 6821 PIA chip had the serial port to begin with, which the 6522 and 6526 chips inherited.

--
Samuel A. Falvo II


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri May 07, 2004 5:32 am 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
Hallo Dave,


> Anybody know if these saw the light of day?

The old IEEE Commodore drives used either one 6502 and one 6504 or two 6502's, running in the way you described.

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Dec 28, 2006 1:11 am 
Offline

Joined: Sat May 20, 2006 2:54 pm
Posts: 43
Location: Brighton, England
Many years back, I added a second processor to an Acorn Atom, running on the oposite phase of the clock. It can work, but the timing becomes much more critical, even at 2MHz! The two processors shared the ROMs and an 8k block of RAM used for inter-processor communications, while each having their own 32k of RAM for running programs. I managed to get both processors runing seperate BASIC programs using the same BASIC ROM.

I never really got into splitting a single task between the two processors, though. I mainly used the second CPU for calculating mandelbrot images in the background while I used the computer for something else (mainly space invaders :) )

I wouldn't like to add more processors in this way, though. I suspect it would be better to add some sort of network if you want to use multiple processors.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Dec 28, 2006 4:37 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Yeah, Commodore's PET-series disk drive units relied on twin processors. I'm not sure if the Commodore VIC-series (e.g., the 1540 through 1581) did or not though.

That being said, "SMP" (since it's basically what it is) is actually the simplest possible method of multiprocessing, since you don't need to invent a network system either. Realistically speaking, 4 CPUs is about as far as you can push a typical bus (at least with Intel and PowerPC processors); beyond that, performance starts to dwindle fast. I suspect 2 CPUs is the limit for the 6502/65816 because of its lack of cache memory and very high bus bandwidth requirements.

That being said, one can combine the benefits of SMP and networked designs by building networked clusters of twin-processor nodes, if required.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Dec 28, 2006 5:37 am 
Offline

Joined: Fri Jun 27, 2003 8:12 am
Posts: 618
Location: Meadowbrook
For me, if I were to go multiple cpus, I would go with the common ram and each cpu while it has its own rom/ram would access the common ram in a round robin fashion. Each one can simply have data or programs passed back and forth with a token id for memory, or the ram can segment for each cpu.

_________________
"My biggest dream in life? Building black plywood Habitrails"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Dec 29, 2006 3:08 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
That's a form of networking.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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: