The simplest way to look at it is to consider what happens when you have a memory shared between a video refresh circuit and a processor. That happens in almost all the classic microcomputers of the '80's, including the IBM PC. The VIC, for one example, had a circuit, not unlike that used in many other systems, that generated refresh addresses to the common memory block at such a rate that the refresh could take place, but on the opposite clock phase from that on which processor accessed memory. One processor, one refresh circuit, no problem . . . so long as the access windows are confined to opposite clock phases. If you have a number of processors sharing a common memory block, or anything else, the clock phases can be used to arbitrate whose turn it is to hit the common resource. If you have two processors with a 1 MHz clock, they need simply be operated from opposite phases of the oscillator. Look upon this as simply dividing the master 2 MHz clock by two and driving the processors with the output of the flipflop that divides it. One processor gets the Q output as its Phase-0 while the other gets /Q as its Phase-0. Since the internals delays are more or less equal, the phases won't overlap. There's a way to make certain there's no contention, but we're not there yet.
Each of the two procesors is operating at its full bandwidth without waits all the time, and so long as the access time of the shared resource, memory perhaps, is sufficiently shorter than the Phase-2 window, everything will be fine. The two processors are in no way aware of one another. Of course, if they have to communicate, they can semaphore one another using the shared memory.
If they are to become aware of one another, it becomes a committee based operation, and efficiency goes down. It's like a corporate engineering team. If you are given a job to do and do it by yourself, it's easy ... you just "do" it. However, if it's a big job and has to get done in a limited time, your boss may decide that several of you must work together. This means the tasks can be divided, but, alas, there have to be those occasional team meetings, so you can make sure you're all on the same page. Sometimes you spend more time coordinating with the others than doing your job.
It's like that with multiprocessor systems as well. If the tasks are to be shared by several processors, they have to be in communication with one another to some extent just to monitor progress.
Perhaps you can understand that have been in the corporate situation I mentioned.
If your processors and the shared resources are fast enough to allow multiple processors to take a swipe at memory every cycle, you can use an approach like what I described earlier, using a "johnson counter" e.g. MC74HC4017 to generate short active (phase 0) phases and long idle phases to various processors during each cycle. They then operate more or less transparently to one another. It's like having email. Instead of going to a meeting, the data you need just magically appears in your mailbox and you can process it as you need to.
If you have overlapping access, it can be done in the same way as the two-processor tactic, with the exception that you have to coordinate whose turn it is to jump in. There has to be significant prioritization of access to the shared resource and things become a lot more burdensome. That's just like the big committee vs the small team.
Give it some thought, it really does work like that.
Uli
|
|