Processing unit detecting a byte aligment mechanism in the storage controller.

Abstract: A processing unit is provided that generates an address signal which specifies data on a per-byte basis and that further generates a set of byte enable signals which specify enabled bytes relative to the addressed byte. Both the byte enable signals and the address signal are provided to a memory control unit. The processing unit can thereby generate a single memory access to a misaligned memory address, while still specifying a variable number of enabled bytes. A control input provided to the processing unit controls whether a bus control unit of the processing unit generates single cycle memory accesses to misaligned addresses or two-cycle memory accesses to misaligned addresses. For memory accesses to static RAM, the memory control unit may deassert the control signal such that the processing unit generates two-cycle accesses on misaligned addresses. On the other hand, for memory accesses to dynamic RAM, the memory control unit may assert the control signal such that the processing unit generates single cycle accesses on misaligned addresses, unless a page boundary is encountered. The processing unit advantageously allows single cycle accesses to misaligned addresses to thereby accommodate increased system performance, and further supports broad compatibility with existing memory systems.

Description: This invention relates to computer systems and more particularly to memory addressing mechanisms and techniques employed within computer systems. Computer systems based on the particularly popular model 80486 microprocessor allow memory accesses on a per-byte basis. Within 80486 based systems, one byte of data comprises 8-bits. Since the data bus of the model 80486 has a width of 32-bits, it is possible to transfer a total of four bytes of data at a time. A given combination of four bytes of data transferrable simultaneously on the data bus are referred to as a "doubleword". A set of address signals from the microprocessor are used to select the doubleword being referenced during a particular bus cycle, and four byte enable signals are provided to indicate the particular bytes of the addressed doubleword that are valid during the cycle. Figure 1 illustrates a block diagram of a portion of a typical model 80486-based computer system 100. The computer system 100 of Figure 1 includes a memory controller 102 coupled to a microprocessor (CPU) 104 and a system memory 106. Microprocessor 104 includes an execution core 110 that implements a predetermined instruction set and a bus control unit 112 that controls the generation of a local bus address signal labeled LA[31:2] and a byte enable signal BE[3:0]. System memory 106 is illustrative of a static RAM or a dynamic RAM memory subsystem. Memory control unit 102 orchestrates the transfer of data, address, and control signals between microprocessor 104 and system memory 106. Internally, execution core 110 of microprocessor 104 generates an addressing signal A[31:0] which specifies memory locations on a per-byte basis during memory access cycles. Since execution core 110 is capable of generating single-byte memory bus cycles, two byte memory bus cycles, or four-byte memory bus cycles, the execution core 110 also generates a memory size signal labeled MEMSIZE [1:0] which indicates the number of bytes to be accessed during execution of a given cycle. In response to an internal memory access cycle, bus control unit 112 controls the generation of the local bus address signal LA[31:2] to specify the particular doubleword(s) being accessed. The bus control unit 112 further decodes the two lower-order addressing signals A[1:0] and the MEMSIZE[1:0] signal to generate an appropriate byte enable signal BE[3:0]. The byte enable signal BE[3:0] specifies the bytes within the particular addressed doubleword that are enabled during a particular memory cycle. The memory control unit 102 correspondingly monitors the local bus address signal LA[31:2] and the byte enable signal BE[3:0] during operation to generate appropriate address control signals on the memory bus to access system memory 106. For the computer system of Figure 1, the generation of an internal memory reference by execution core 110 that results in a "misaligned memory access" requires two external memory cycles by control unit 112. A misaligned memory access exists when a memory cycle is generated by execution core 110 that requires the transfer of selected bytes of different consecutive doublewords, as defined by the memory mapping of the particular system. Two external memory cycles arerequired to execute an instruction involving a misaligned memory address since the address signal LA[31:2] as generated by bus control unit 112 is only capable of specifying a single doubleword at a time, with the byte enable signals specifying the particular bytes of the addressed doubleword. For example, consider a situation in which an instruction is encountered by execution core 110 to write four bytes of data starting at the byte address location 003:H (i.e., A[31:0]=003:H). Figure 2A illustrates the external local bus cycles generated by bus control unit 112 during the execution of such a cycle. Figure 2B is an exemplary memory map that illustrates the apparent segregation of doublewords (along with the constituent bytes of each) within system memory 106. It is noted that each doubleword is segregated in accordance with the local bus address signal LAD[31:2]. That is, the local bus address signal LA[31:2] specifies a particular doubleword location of system memory 106. Each row of the memory map of Figure 2B represents a separate doubleword location, and each row is divided into four sections which are representative of the separate bytes of each doubleword. It is noted that each byte location is indirectly specified by the internal address signal A[31:0], but cannot be individually specified by the local bus address signal LA[31:2] (i.e., byte 3 of doubleword LA[31:2]=000:H corresponds to byte address location A[31:0]=003H). As illustrated within Figures 2A and 2B, to effectuate a requested operation involving a write of four bytes of data (labelled bytes "A", "B", "C" and "D") starting at address location A[31:0]=004:H, bus control unit 112 drives the local bus address signal LA[31:2] with a value of 001:H during a first bus cycle 202. Bus control unit 112 simultaneously drives the byte enable signals BE[3:0] with a value of 1000:B, where '0' specifies an enabled byte, and asserts appropriate control signals to effectuate a memory write cycle. The bus control unit 112 further causes the three bytes of data (byte "B", byte "C", and byte "D") to be appropriately driven on data lines D[23:0]. The data is thereby written into the three lower-order byte locations of the addressed doubleword (i.e., LA[31:2]=001:H). During a subsequent bus cycle 204, bus control unit 112 drives the local bus address lines A[31:2] with a value of 000:H, and simultaneously drives the byte enable signals BE[3:0] with a value of 0111:B. Upon this cycle, byte "A" is driven on data lines [24:31] by bus control unit 112 and is written into the highest-order byte location of the doubleword LA[31:2]=000:H. Thus, as illustrated within Figure 2B, the three lower-order bytes of the doubleword address location 001:H are written with valid data during the first memory cycle, and the highest-order byte of doubleword address location 000:H is written with valid data during the second memory cycle. As a result, the four bytes of data "A", "B", "C", and "D" are ultimately written to system memory 106 starting at the byte address location A[31:0]=003H. Unfortunately, the requirement of executing two memory cycles when a memory access on a misaligned byte boundary occurs increases the time required to complete the instruction and reduces the bandwidth of the local bus. As a result, overall performance of the computer system may be degraded. EP-A-0 076 155 describes a memory system including at least a pair of independently addressable dynamic memory module units. The circuit includes an arrangement for doubleword memory accesses in which an addressing means couples first the row address and then the column address and incremented column address to the chips. The problems outlined above are in large part solved by a processor with a programmable byte-alignment mechanism in accordance with the present invention as defined by the appended claims. In one embodiment, a processing unit is provided that generates an address signal which specifies data on a per-byte basis and that further generates a set of byte enable signals which specify enabled bytes relative to the addressed byte. Both the byte enable signals and the address signal are provided to a memory control unit. The processing unit can thereby generate a single memory access to a misaligned memory address, while still specifying a variable number of enabled bytes. A control input provided to the processing unit controls whether a bus control unit of the processing unit generates single cycle memory accesses to misaligned addresses or two-cycle memory accesses to misaligned addresses. For memory accesses to static RAM, the memory control unit may deassert the control signal such that the processing unit generates two-cycle accesses on misaligned addresses. On the other hand, for memory accesses to dynamic RAM, the memory control unit may assert the control signal such that the processing unit generates single cycle accesses on misaligned addresses, unless a page boundary is encountered. The processing unit advantageously allows single cycle accesses to misaligned addresses to thereby accommodate increased system performance, and further supports broad compatibility with existing memory systems. We will describe a processing unit comprising: an execution core capable of executing a predetermined instruction set; and a bus control unit coupled to said execution core, wherein said bus control unit is configured to generate an address signal (LA), a byte enable signal (BE), and at least one control signal for controlling a memory control unit. The processing unit is characterised in that said bus control unit is configured to receive a misaligned byte support signal; and in that said address signal specifies a doubleword address when said misaligned byte support signal is deasserted and a byte address when said misaligned byte support signal is asserted; when said misaligned byte support signal is asserted, said byte enable signal indicating which bytes, relative to the byte specified by the byte address, are to be accessed during a single memory cycle, whereby said bus control unit executes single cycle accesses to a misaligned doubleword address when said misaligned byte support signal is asserted. We will also describe a method for generating memory access cycles within a bus control unit of a processing unit, comprising the steps of: determining a byte address of a requested memory transfer; determining the number of bytes involved in said memory transfer; detecting a misaligned byte support signal; and if said misaligned byte support signal is deasserted, executing a two-cycle access to a misaligned doubleword address; and if said misaligned byte support signal is asserted, providing a byte enable signal (BE) indicating which bytes, relative to the byte specified by the byte address, are to be accessed during a single memory cycle; and executing a single cycle access to a misaligned doubleword address. BRIEF DESCRIPTION OF THE DRAWINGS Other objects and advantages of the invention will become apparent upon reading the following detailed description and upon reference to the accompanying drawings in which: Figure 1 is a block diagram of a portion of a typical model 80486-based computer system. Figure 2A is a signal diagram that illustrates the external bus cycles generated by the microprocessor of Figure 1 during execution of an instruction to a misaligned memory address. Figure 2B is a diagram of a memory map that illustrates the writing of valid data during the execution of an instruction to a misaligned memory address. Figure 3 is a block diagram of a computer system including a processing unit with a programmable byte-alignment mechanism according to the present invention. Figure 4 is a signal diagram that illustrates an external bus cycle generated by the processing unit of Figure 3 during execution of an instruction to a misaligned memory address. Figure 5 is a diagram of a memory map which illustrates the writing of valid data during the cycle illustrated in Figure 4. While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed, but on the contrary, the intention is to cover all embodiments falling within the scope of the appended claims. DETAILED DESCRIPTION OF THE INVENTION Referring next to Figure 3, a block diagram of a computer system 400 including a processing unit 402 having a programmable byte-alignment mechanism according to the present invention is shown. As illustrated in Figure 4, a memory control unit 404 is coupled to processing unit 402 and a system memory 406. Processing unit 402 includes an execution core 410 coupled to a bus control unit 414. Execution core 410 is illustrative of, for example, a model 80486 microprocessor core. It is understood, however, the alternative execution cores could be provided. For the embodiment of Figure 3, processing unit 402 is configured to operate in two different modes of operation, depending upon a control signal labeled the "misaligned byte support" signal at line 430. If the misaligned byte support signal is deasserted high, the bus control unit 414 operates in accordance with a conventional model 80846 bus control unit. As such, bus control unit 414 parses memory accesses to misaligned memory addresses into separate memory cycles by driving the local bus address signal LA[31:2], the byte enable signals BE[3:0], and control signals in accordance with the conventional protocol as described previously. During these separate memory cycles, the lower two order bits LA[1:0] of the address signal are driven low and are essentially ignored by memory control unit 404. Thus, in this mode of operation, the local bus addressing signal LA[31:0] is only capable of specifying a doubleword location, while the byte enable signal BE[3:0] specifies the particular bytes of the addressed doubleword that are valid. Accordingly, to accomplish a memory access to a misaligned memory address, a pair of consecutive doubleword addresses must be driven on the addressing lines of the local bus during separate memory cycles. If the misaligned byte support signal at line 430 is asserted low, bus control unit 414 generates a single memory cycle on misaligned addresses rather than generating two separate cycles, as described above. During this mode of operation, the bus control unit 414 drives the lower two order addressing bits of the local bus address signal LA[31:0] with a value that indicates the lowest byte to be accessed. The byte enable signals BE[3:0] are further driven to indicate the bytes relative to the byte specified by LA[31:0] that are valid. For example, referring to Figure 4, a timing diagram is illustrated for the situation in which execution core 410 encounters an instruction to write four bytes of data (Bytes "A", "B", "C", and "D") starting at the exemplary address A[31:0]=003:H. Figure 5 is a memory map which illustrates the separately addressable byte locations of computer system 400. The bus control unit 414 executes the cycle by driving the address signal LA[31:0] with a value of 003:H. This indicates the doubleword to be transferred as well as the starting byte of the data to be transferred. The byte enable signal BE[3:0] is further driven with a value of 0000:B. This indicates that four bytes of consecutive data starting with the addressed byte are involved in the transfer. The data (i.e., bytes "A", "B", "C", and "D") is then driven simultaneously on the data lines D[31:0] by bus control unit 414 to complete the cycle. This data is latched within memory control unit 404, which correspondingly drives the addressing lines and byte enable lines of system memory 406 to complete the requested transfer. The address signal LA[31:0] thus points to a specific byte within the addressable memory of computer system 400, as opposed to simply a doubleword. The byte enable signals indicate the specific byte or bytes relative to the addressed byte that are involved in a particular transfer. Assertion of the misaligned byte support signal allows single cycle accesses to misaligned doubleword addresses, and thus accommodates a higher bandwidth on the local bus and a corresponding improvement in system performance. The misaligned byte support signal may be provided to computer system 400 from an external source. Alternatively, the memory control unit 404 may be configured to control the assertion of the misaligned byte support signal depending upon the type of memory embodied within system memory 406. For example, if system memory 406 is comprised of dynamic random access memory, the memory control unit 404 may be configured to assert the misaligned byte support signal such that single cycle accesses to misaligned addresses are effectuated by bus control unit 414. It is noted that memory control unit 404 may further be configured to deassert the misaligned byte support signal at page boundary addresses such that two-cycle accesses are performed when a new DRAM page must be opened during the execution of a particular cycle. If system memory 406 is comprised of static random access memory, memory control unit 404 may be configured to either deassert the misaligned byte support signal such that two-cycle accesses to misaligned addresses are effectuated by bus control unit 414, or may be configured to assert the misaligned byte support signal and to parse the single cycle accesses from local bus into two-cycle accesses on the system memory bus. The computer system described above may further employ the memory control techniques as disclosed within the co-pending, commonly assigned patent applications entitled "Non-Volatile Memory Array Controller Capable of Controlling Memory Banks Having Variable Bit Widths", EP-A-0 657 825; and "ROM Chip Enable Encoding Method and Computer System Employing the Same", EP-A-0 657 818. Numerous variations and modifications will become apparent to those skilled in the art once the above disclosure is fully appreciated. For example, it is noted that system memory 406 may be comprised of any type of addressable memory or I/0 device.

Claims: A processing unit (402) comprising: an execution core (410) capable of executing a predetermined instruction set; and a bus control unit (414) coupled to said execution core, wherein said bus control unit is configured to generate an address signal (LA), a byte enable signal (BE), and at least one control signal for controlling a memory control unit (404); characterised in that said bus control unit is configured to receive a misaligned byte support signal (430); and in that said address signal specifies a doubleword address when said misaligned byte support signal is deasserted and a byte address when said misaligned byte support signal is asserted, whereby said bus control unit executes single cycle accesses to a misaligned doubleword address when said misaligned byte support signal is asserted. The processing unit as recited in claim 1 wherein when said misaligned byte support signal is asserted, said byte enable signal indicates which bytes, relative to the byte specified by the byte address, are to be accessed during a single memory cycle. The processing unit as recited in claim 1 or 2 wherein said bus control unit is configured to execute a two-cycle access to misaligned doubleword addresses when said misaligned byte support signal is deasserted. The processing unit as recited in claim 1, 2 or 3 wherein said control signal is a read/write control signal. A computer system including a processing unit (402) as recited in any preceding claim and said memory control unit (404) coupled to system memory (406), said memory control unit being configured to control the assertion of the misaligned byte support signal dependent upon the type of memory embodied within the system memory. A method for generating memory access cycles within a bus control unit (414) of a processing unit (402), comprising the steps of: determining a byte address of a requested memory transfer; determining the number of bytes involved in said memory transfer; detecting a misaligned byte support signal (430); and if said misaligned byte support signal is deasserted, executing a two-cycle access to a misaligned doubleword address; and if said misaligned byte support signal is asserted, executing a single cycle access to a misaligned doubleword address. A method as recited in claim 6 further including providing a byte enable signal (BE) indicating which bytes, relative to the byte specified by the byte address, are to be accessed during a single memory cycle if said misaligned byte support signal is asserted. The method as recited in claim 6 or 7 wherein said step of executing a two-cycle access to a misaligned doubleword address comprising the steps of: providing a first doubleword address on the local bus to indicate a first doubleword to be accessed; providing a byte enable signal (BE) that indicates the bytes of said first doubleword to be accessed during said first cycle; providing a second doubleword address indicating a second doubleword to be accessed; and driving said byte enable signal with a second value to indicate the bytes of said second doubleword. The method as recited in claim 6, 7 or 8 further comprising controlling the assertion of the misaligned byte support signal dependent upon the type of memory accessed by the processing unit.

Inventors: PEDNAU MICHAEL D, PEDNAU, MICHAEL D.
Applicants: ADVANCED MICRO DEVICES INC, ADVANCED MICRO DEVICES INC.
Application year: 1995
Main classification: G06F12
IPC codes: G06F12