03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BUS INTERFACE UNIT<br />

The WAIT instruction suspends program execution until one of two events occurs: an interrupt<br />

is generated, or the TEST input pin is sampled low. Unlike interrupts, the TEST input pin does<br />

not require that program execution be transferred to a new location (i.e., an interrupt routine is<br />

not executed). In processing the WAIT instruction, program execution remains suspended as long<br />

as TEST remains high (at least until an interrupt occurs). When TEST is sampled low, program<br />

execution resumes.<br />

The TEST input and WAIT instruction provide a mechanism to delay program execution until a<br />

hardware event occurs, without having to absorb the delay associated with servicing an interrupt.<br />

3.6.3 Using a Locked Bus<br />

To address the problems of controlling accesses to shared resources, the BIU provides a hardware<br />

LOCK output. The execution of a LOCK prefix instruction activates the LOCK output.<br />

LOCK goes active in phase 1 of T1 of the first bus cycle following execution of the LOCK prefix<br />

instruction. It remains active until phase 1 of T1 of the first bus cycle following the execution of<br />

the instruction following the LOCK prefix. To provide bus access control in multiprocessor systems,<br />

the LOCK signal should be incorporated into the system bus arbitration logic residing in<br />

the CPU.<br />

During normal multiprocessor system operation, priority of the shared system bus is determined<br />

by the arbitration circuits on a cycle by cycle basis. As each CPU requires a transfer over the system<br />

bus, it requests access to the bus via its resident bus arbitration logic. When the CPU gains<br />

priority (determined by the system bus arbitration scheme and any associated logic), it takes control<br />

of the bus, performs its bus cycle and either maintains bus control, voluntarily releases the<br />

bus or is forced off the bus by the loss of priority.<br />

The lock mechanism prevents the CPU from losing bus control (either voluntarily or by force)<br />

and guarantees that the CPU can execute multiple bus cycles without intervention and possible<br />

corruption of the data by another CPU. A classic use of the mechanism is the “TEST and SET<br />

semaphore,” during which a CPU must read from a shared memory location and return data to<br />

the location without allowing another CPU to reference the same location during the test and set<br />

operations.<br />

Another application of LOCK for multiprocessor systems consists of a locked block move, which<br />

allows high speed message transfer from one CPU’s message buffer to another. During the locked<br />

instruction (i.e., while LOCK is active), a bus hold, DMA or refresh request is recorded, but is<br />

not acknowledged until completion of the locked instruction. However, LOCK has no effect on<br />

interrupts. As an example, a locked HALT instruction causes bus hold, DMA or refresh bus requests<br />

to be ignored, but still allows the CPU to exit the HALT state on an interrupt.<br />

3-40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!