Apparatus enabling observation of internal memory-mapped registers

Abstract: A method and apparatus for observing the contents on internal memory-mapped registers of controllers and co-processors which have been integrated on-chip with a central processing unit ("CPU"). The CPU asserts a first signal when access to internal memory is requested and deactivates a second signal which would normally allow simultaneous access to both internal and external memory locations. In this way, the contents of internal memory may be observed in real time.

Description: The present invention relates to data processing systems according to the preamble of claim 1. In conventional digital data processing systems with n-bit architecture, the central processing unit (CPU) is capable of generating 2 n addresses for referencing instructions or data. For example, a 16-bit computer is capable of generating 2 16 or 65,536 addresses. These addresses are generally used to reference devices which are located outside the CPU environment, so-called peripheral or external devices. The interface between the CPU and the peripheral devices consists of a system bus, including an address bus and a data bus, wherein the CPU, responding to an instruction request, sends an address onto the address bus which is connected to the peripheral device. If the peripheral device is memory storage, then data can be transferred directly between the CPU and memory by means of the data bus. If, however, the peripheral device is something other than a memory device, such as a printer, modem, or a co-processor, then additional hardware is generally required in the peripheral device in order to decode and act on the address reference. In order to avoid the need for this additional hardware, a technique called "memory-mapped I/O" is used. According to this technique, the transfer of data to and from peripheral devices is accomplished by using some of the normally available memory space. Memory addresses are decoded within the peripheral device and thus are used to determine when a specific device is being addressed. Usually, each type of function within the peripheral device is assigned a memory address and may then be accessed by the CPU. For example, the status, control and data registers within the peripheral devices are each assigned a memory address and thus three addresses are required for the CPU to perform an I/O operation with this peripheral device. Using memory-mapped I/O in this fashion allows I/O operations to be performed directly in a high-level language, i.e., an I/O device may be declared as a data structure and then manipulated with the use of pointers. Referring to Fig. 1, in a conventional microprocessor architecture, the sequence of events occurring during a basic CPU access to either memory or peripheral device for a read transaction or a write transaction is performed in two cycles of a bus clock, the cycles commonly being labeled T1 and T2. During the first half of cycle T1, the CPU asserts an Address Strobe signal ADS which indicates that a bus cycle has begun and that a valid address is on the Address Bus. From the beginning of cycle T1 until the completion of the bus cycle, the CPU drives the Address Bus and other relevant control signals. If the bus cycle is not cancelled (e.g. cycle T2 is entered in the next clock cycle), the CPU will assert a Confirm signal CONF in the middle of cycle T1 to indicate that the bus cycle initiated by the Address Strobe ADS is valid. A confirmed bus cycle is completed at the end of cycle T2. In the case of a read operation, the CPU samples the Data Bus at the end of cycle T2. If a bus exception is detected, then data on the Data Bus is ignored. For write operations, valid data is output on the Data Bus to the address indicated on the Address Bus from the middle of cycle T1 until the end of the cycle. The desire for improved microprocessor performance is leading to integration of certain functions which, in the past, had been external to the CPU (e.g. peripheral devices such as controllers and co-processors). Integration of these functions means that the status, control and data registers associated with the newly-integrated functions are located internally to the CPU, not externally as before. Thus, while these registers may still be referenced as memory-mapped, the CPU access to the internal memory-mapped registers no longer occurs over the external bus, but rather occurs over an internal bus, thus making the transaction essentially transparent to the user. The inability to observe the read/write operations of these internal registers makes it extremely difficult to trace CPU activity and it becomes very difficult to debug the system. Some systems, e.g., the Intel 80186 microprocessor, solve the problem by showing accesses to internal memory-mapped registers as normal read/write cycles, as described above. However, the CPU ignores the synchronous and asynchronous ready bits as well as the data bus, thus the data contained in the internal memory-mapped registers can not be observed. In National Semiconductor's HPC 16083 controller, the read and write strobes are inhibited. Thus, during a write operation, the data is presented on the bus, whereas during a read operation, data is not presented on the bus. A data processing system according to the preamble of claim 1 is known from EP-A-0 313 848 and comprises an integrated microprocessor device with a CPU, a timer and an internal bus coupling the CPU to the functional device eg. timer and to an external system bus which includes an address bus and a data bus. The CPU comprises means for transferring data between the CPU and memory-mapped registers of the functional device over the internal bus and for transferring data between the CPU and a memory-mapped external device over the internal bus and the extemal system bus, means for asserting a signal to indicate to devices outside the integrated microprocessor device when a data transfer to/from an external device is taking place, means for generating a signal to indicate to devices outside the integrated microprocessor device the direction of a data transfer between the CPU and the functional device or an external device, and means for presenting the data being transferred between the CPU and the functional device on the external system bus. This system requires connection with the internal bus whenever the peripheral device is addressed. The present invention as defined in claim 1, in brief provides a microprocessor architecture which allows the contents transferred to/from internal memory-mapped registers to be observed. This is achieved by adding a new CPU output signal to the conventional architecture which indicates that an internal bus cycle is underway, deactivating the CPU output signal which validates an external reference cycle and, when accessing the contents of the internal memory-mapped registers, placing the information transferred on the data bus for observation. The present invention will thus aid system programmers by allowing them to trace program activity with the internal registers of the CPU, an invaluable debugging tool. This will further facilitate the integration of controllers and co-processors on-chip since system designers will now be able to troubleshoot internal problems associated with integration. The foregoing and other objectives, features and advantages of the invention will be more readily understood upon consideration of the following detailed description of a preferred embodiment of the invention, taken in conjunction with the accompanying drawings. Fig. 1 is a timing diagram illustrating a read and write cycle of a conventional microprocessor. Fig. 2 is a block diagram illustrating a typical microprocessor chip with integrated controllers. Fig. 3 is a block diagram illustrating memory allocation of a microprocessor which utilizes memory-mapped addressing. Fig.4 is a timing diagram illustrating internal read and write cycles of a microprocessor in accord with the present invention. Fig.2 shows a general block diagram of a microprocessor (CPU) 10 with Direct Memory Access (DMA) 16 and Interrupt Control Unit (ICU) 18 integrated on chip 11. The DMA 16 and ICU 18 are interfaced with the CPU 10 by means of an internal bus 22. User interface to the DMA 16 and ICU 18 is provided via the I/O buffers 15 on the system bus 34, which includes a Data Bus 35, an Address Bus 36 and I/O pins 37. The CPU 10 is capable of addressing 2 N locations, where N is the number of bits in the CPU's address field 12. The memory of the CPU 10 is organized as a set of linear addresses beginning at 0 and ending at 2 N -1. A portion of these memory addresses are dedicated for memory-mapping. For example, in National Semiconductor's NS-32532 32-bit microprocessor chip, 2 32 (4 gigabytes) of linear address space can be referenced and these addresses are numbered sequentially starting at zero and ending at 2 32 -1. As shown in Fig. 3, the hex addresses in the range FFFFFOOO to FFFFFFFF are dedicated to on-chip ("internal") memory-mapped registers. The DMA 16 and ICU 18 each have Control and Status Registers 17 and 19, respectively, which are referenced as memory-mapped registers. The basic CPU operation to read from and write to external memory and peripheral devices consists of activating a first output signal to indicate that a bus cycle has begun and that there is a valid address on the Address Bus 36. Next, if the bus cycle is not cancelled, a second output signal is asserted which qualifies access to the peripheral by confirming that a valid bus cycle is underway. Lastly, access to the peripheral is gained and the data is presented on the Data Bus 35, the direction of data transfer depending on the value of a third output signal. For example, referring to Fig. 1, in the National Semiconductor NS-32532 microprocessor, the basic bus cycles occur during two cycles (T1 and T2) of the Bus Clock BCLK. The CPU asserts Address Strobe signal ADS during the first half of cycle T1 to indicate the beginning of a bus cycle. Next, the CPU asserts a Confirm Bus Cycle signal CONF to allow external access, CONF being active from the middle of cycle T1 until the completion of the bus cycle, at which time CONF is negated. Data transfer may then take place and be observed on the Data Bus 35. The direction of transfer is indicated by output signal Data Direction DDIN , i.e., write when DDIN is high and read when DDIN is low. In contrast to a normal read or write request involving an externally located peripheral, the on-chip registers 17 and 19 cannot be readily observed on the system bus 34. Therefore, according to the present invention, the normal read/write cycle may be modified by deactivating the output signal which allows external access and by asserting a fourth output signal which indicates that access to internal memory-mapped registers 17 and 19 will take place. The contents of the internal registers 17 and 19 may then be observed on the Data Bus 35. As shown in Fig. 4, in this case CONF is held inactive, thus disabling external memory access. A new output signal, Confirm Internal Bus Cycle ICONF is then asserted indicating internal access is requested and bus control inputs should be ignored. Data is presented on the data bus 35. Note, however, that on internal read cycles, DDIN is low, but the data direction is the same as in a write cycle.

Claims: A data processing system having a system bus (34), at least one peripheral device connected to the system bus (34), and an integrated microprocessor device (11) connected to the system bus (34), said microprocessor device (11) comprising a CPU (10), at least one functional device (16, 18), an internal bus (22) coupling the CPU (10) to the at least one functional device (16, 18) and to the system bus (34) which includes an address bus (36) and a data bus (35), wherein the CPU (10) comprises: means for transferring data between the CPU (10) and a functional device (16, 18) over the internal bus (22) and for transferring data between the CPU (10) and a peripheral device over the internal bus (22) and the system bus (34), means for asserting a first signal (CONF) observable outside the integrated microprocessor device (11) when a data transfer to/from a peripheral device is taking place, means for generating a second signal (DDIN) to indicate to devices outside the integrated microprocessor device (11) the direction of a data transfer between the CPU (10) and a functional device (16, 18) or a peripheral device, and means for presenting the data being transferred between the CPU (10) and a functional device (16, 18) on the system bus (34), characterized in that the CPU (10) comprises means for asserting a third signal (ICONF) observable outside the integrated microprocessor device (11) when a data transfer to/from a functional device (16, 18) is taking place. The system of claim 1, characterized in that the internal bus (22) is connected to the system bus (34) via I/O buffer means (15). The system of claim 1 or 2, characterized in that access to the system bus (34) occurs when the first signal (CONF) is active and the third signal (ICONF) is inactive or vice versa.

Inventors: BEN-ZEEV YIGAL, BIKOWSKY ZEEV, BIRAN DAN, HADAS YAIR, INTRATER GIDEON, LIDOR DAVID, OSTRER AHARON, PELEG ZOHAR, BEN-ZEEV, YIGAL, BIKOWSKY, ZEEV, BIRAN, DAN, HADAS, YAIR, INTRATER, GIDEON, LIDOR, DAVID, OSTRER, AHARON
Applicants: NAT SEMICONDUCTOR CORP, NATIONAL SEMICONDUCTOR CORPORATION
Application year: 1990
Main classification: G06F12
IPC codes: G06F11, G06F13