40 TS68040 2116A–HIREL–09/02
Exception Processing The TS68040 provides the same extensions to the exception stacking p rocess as the
TS6803 0. If the M bi t in th e status r egister is set , the m as ter sta ck poi nte r is u se d for al l
task-re lated ex ceptio ns. When a nontas k-relate d exce ption occ urs (i. e., an i nterrupt),
the M bit is cle ared, and the i nterrupt stac k pointer is used . This feature allows a task’s
stack area to be carried within a single processor control block, and new tasks may be
initiated by simply reloading the master stack pointer and setting the M bit.
The externally generated exceptions are interrupts, bus errors, and reset conditions.
The interrupts are requests from external devices for processor action; whereas, the bus
error and res et signals are used for ac cess control and proces sor initialization. T he
internally generated exceptions come from instructions, address errors, tracing, or
breakpoints. The TRAP, TRAPcc, TRAPVcc, FTRAPcc , CHK, CHK2, and DIV instruc-
tions c an a ll gen er ate ex ce pti ons as p ar t of thei r in str uc ti on e xe cut io n. Tr acing behav es
like a very high-priority, internally generated interrupt whenever it is processed. The
other internally generated exceptions are caused by unimplemented floating-point
instruc tions, i llegal inst ructions , instructi on fetche s from o dd address es, and p rivilege
violations. Finally, the MMU can generate exceptions, for access violations and for when
invalid descriptors are encountered during table searches.
Exception processing for the TS68040 occurs on the following sequence:
1. an internal copy is made of the status register,
2. the vector number of the exception is determined,
3. current processor status is saved,
4. the exception vector offset is determined by multiplying the vector number by
four.
This offset is then added to the contents of the VBR to determine the memory address
of the exception vector. The instruction at the address given in the exception vector is
fetched, and normal instruction decoding and execution is started.
Memory Management
Units The full address ing r ange of t he TS6804 0 is 4G bytes ( 4,294,9 67,296 b ytes) . However ,
most TS68040 systems implement a much smaller physical memory. Nonetheless, by
using virtual memory techniques, the system can be made to appear to have a full
4G bytes of ph ysic al mem ory availa ble to each user program . The in depende nt inst ruc-
tion and data MMUs fully support demand paged virtual-memory operating systems with
either 4K or 8K page sizes. In addition to its main function of memory management,
each MMU protects supervisor areas from accesses by user programs and also pro-
vides write protection on a page-by-page basis. For maximum efficiency, each MMU
operates in parallel with other processor activities.
Translation Mechanism Because logical-to-physical address translation is one of the most frequently executed
opera tions of the TS68 040 MMUs, th is task ha s bee n optimiz ed. Each MM U in itiates
address translation by se arching for a descr iptor containi ng the address tr anslation
informa tion in th e ATC. If the desc riptor does not reside in the ATC, the n the MMU pe r-
forms external bus cycles via the bus controller to search the translation tables in
physical memory. After being located, the page descriptor is loaded into the ATC, and
the add ress is cor rectly tr anslat ed for the acce ss, prov ided no exc eption c onditio ns are
encountered.