Processor Bus Cycles
Embedded software developers working in fault tolerance of the system workclose to the underlying hardware. Thus a basic understanding of hardwareoperation is useful in developing software that interfaces directly with thehardware. In this article we will focus on some basic processor bus cycles.Understanding of bus cycle operations is useful in designing diagnostics andexception handlers.
The following processor bus cycles are described in detail:
Read Bus Cycle Describes the operations carried out by the processor when a memory read is executed.
Write Bus Cycle Sequence of operations in memory write is described here.
Bus Error Processor initiates a bus cycle, but memory subsystem does not find the addressed memory location.
Read-Modify-Write Bus Cycle This bus cycle is used to perform locking operations in a multiprocessor system. This is an atomic read followed by write operation.
Processor initiates a read bus cycle by floating the address of the memory location on the address lines.
Once the address lines are stable, the processor asserts the address strobe signal on the bus. The address strobe signals the validity of the address lines.
Processor then sets the Read/Write* signal to high, i.e. read.
Now the processor asserts the data strobe signal. This signals to the memory that the processor is ready to read data.
The memory subsystem decodes the address and places the data on the data lines.
The memory subsystem then asserts the data acknowledge signal. This signals to the processor that valid data can now be latched in.
Processor latches in the data and negates the data strobe. This signals to the memory that the data has been latched by the processor.
Processor also negates the address strobe signal.
Memory subsystem now negates the data acknowledgement signal. This signals the end of the read bus cycle.
Processor initiates a write bus cycle by floating the address of the memory location on the address lines.
Once the address lines are stable, the processor asserts the address strobe signal on the bus. The address strobe signals the validity of the address lines.
Processor then sets the Read/Write* signal to low, i.e. write.
The processor then places the data on the data lines.
Now the processor asserts the data strobe signal. This signals to the memory that the processor has valid data for the memory write operation.
The memory subsystem decodes the address and writes the data into the addressed memory location.
The memory subsystem then asserts the data acknowledge signal. This signals to the processor that data has been written to the memory.
Then the processor negates the data strobe, signaling that the data is no longer valid.
Processor also negates the address strobe signal.
Memory subsystem now negates the data acknowledgement signal, signaling an end to the write bus cycle.
Here we cover the example of a read bus cycle that fails due to theaddress being accessed was illegal. The processor aborts the bus cycle andinitiates exception processing.
Processor initiates a read bus cycle by floating the address of the memory location on the address lines.
Once the address lines are stable, the processor asserts the address strobe signal on the bus. The address strobe signals the validity of the address lines.
Processor then sets the Read/Write* signal to high, i.e. read.
Now the processor asserts the data strobe signal. This signals to the memory that the processor is ready to read data.
The memory subsystem decodes the address but finds that there is no memory corresponding to the address.
The memory subsystem, then asserts the bus error signal. This signals to the processor that an illegal address access has been attempted.
Processor aborts the current bus cycle and initiates bus error exception processing.
The current processor context is saved and the processor moves to supervisor mode.
The processor then fetches the bus error vector to obtain the address of the bus error handler.
Control is then transferred to the bus error handler.
A read-modify-write bus cycle is nothing but a read cycle followed by a writecycle to the same address. This bus cycle is important when designingmultiprocessor systems. Since the read and write operations are performed in asingle bus cycle, the processor cannot loose the bus when these operations arebeing carried out. This type of bus cycle is used when dealing with resourcesmanaged by semaphores.
Processor initiates read-modify-write bus cycle by floating the address of the memory location on the address lines.
Once the address lines are stable, the processor asserts the address strobe signal on the bus. The address strobe signals the validity of the address lines.
Processor then sets the Read/Write* signal to high, i.e. read.
Now the processor asserts the data strobe signal. This signals to the memory that the processor is ready to read data.
The memory subsystem decodes the address and places the data on the data lines.
The memory subsystem, then asserts the data acknowledge signal. This signals to the processor that valid data can now be latched in.
Processor latches in the data and negates the data strobe. This signals to the memory that the data has been latched by the processor.
Memory subsystem now negates the data acknowledgement signal, signaling an end to the read part of the bus cycle.
Processor then sets the Read/Write* signal to low, i.e. write.
The processor then places the data on the data lines.
Now the processor asserts the data strobe signal. This signals to the memory that the processor has valid data for the memory write operation.
The memory subsystem decodes the address and writes the data into the addressed memory location.
The memory subsystem then asserts the data acknowledge signal. This signals to the processor that data has been written into the the memory.
Then the processor negates the data strobe, signaling that the data is no longer valid..
Processor also negates the address strobe signal.
Memory subsystem now negates the data acknowledgement signal, signaling an end to the read-modify-write bus cycle.