Hi all.
I have this idea to create a multi-processor VMEbus based system, just for a challenge and "beacause why not".
I have a subrack and backplane all ready to go, but the project is a bit of a long term thing, so Im not intending to jump straight in just yet...
I have a document that explains the bus and its protocols for acquiring the bus etc, and I feel quite confident that I will be able to implement the required logic in some CPLDs and GALs without any issue based on this document.
But there is one thing that I havent yet been able to figure out, and that is just how a CPU (or its software) actually goes about acquiring the bus. There are a few different ways I can think of, but Im not sure which (if any) was the "intended" mode of operation, and maybe someone that is familiar with VME bus can help me fill in this detail.
1. Software running on a CPU card knows that it needs to access a peripheral that is located on another card plugged into the bus, so it communicates the need for bus access to its own on-board bus controller (e.g. set a bit in a register to kick off the bus arbitration process), which requests the bus, and perhaps acknowledges that bus access has been obtained through an interrupt that can set a semaphore or release a mutex or something, or maybe the software can sit there and poll a register in the controller to see when bus access has been obtained. Once the software is done accessing the bus it can then reconfigure its bus controller to release the bus.
2. Software "assumes" that it always has access to the bus, and just attempts reads and writes to those peripherals as required. The on-board bus controller determines (e.g. via an address decoder) when bus access is required, obtains the bus, and holds on to it just for that bus transaction. In this mode, bus accesses are completely transparent to the software, and no consideration needs to be made for obtaining or releasing it.
3. Some kind of hybrid of the above. Maybe software at first assumes that it has bus access when ever it wants it, and upon trying to access an external peripheral the on-board bus controller gains access to the bus per #2, and it holds on to it indefinitely. When the software is done accessing the peripheral it reconfigures the bus controller to release the bus as per #1. This allows a CPU card to hold on to the bus until another card wants to access the bus and the bus arbiter signals the current owner to get off the bus.
#1 seems like it would work well in e.g. an RTOS type environment where you can put in a request for the bus and yield the task to go and do other things while bus access is obtained (or perhaps poll a couple of times in case it is acquired immediately), eventually returning to complete what ever it was that needed to be done once bus access is acquired.
#2 and the first part of #3 seems like they would have the potential to stall the CPU for large amounts of time, blocking the CPU from doing *anything* while bus access is obtained and the transaction complete. It would be very necessary to implement a timeout to assert BERR to end a bus transaction in error if the CPU has waited too long for the bus to be obtained, allowing the software to re-try the bus access, or at least allow it to defer the bus access for a little while and go and do other things.
Does anyone have any insight they could share?
Thanks!