Embodiments of the invention relate to memory architectures in electronic systems. More particularly, embodiments of the invention relate to techniques for supporting data swizzling and de-swizzling.
When a memory data bus of an electronic system is designed and routed from a memory controller to the memory modules, it is common to “swizzle” the traces to optimize routing within a byte or nibble of data. Data swizzling refers to routing of data lines on a printed circuit board (PCB) where data bit ordering is different on the memory controller side and the memory module side.
The other two data bits (D0 and D2) are swizzled. In the example of
Thus, as data travels from memory controller 120 to memory device 140 it is swizzled by the data lines. As the data travels back from memory device 140 to memory controller 120 it is de-swizzled and the data received by memory controller 120 is correctly ordered and ready for use.
This approach to data swizzling has been effective in many situations. However, as systems increase in complexity and robustness, simple swizzling techniques may not be sufficient.
Embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings in which like reference numerals refer to similar elements.
In the following description, numerous specific details are set forth. However, embodiments of the invention may be practiced without these specific details. In other instances, well-known circuits, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
In systems supporting error check and/or error correction functionality, the swizzling technique illustrated in the example of
In one embodiment, the memory controller may internally swizzle data using the swizzling map before writing the data to memory so that the data appears in the correct order at the pins of the memory chip(s). On reads, the controller can internally de-swizzle the data before performing the error correction operations using the swizzling map.
Electronic system 200 includes bus 205 or other communication device to communicate information, and processor 210 coupled to bus 205 that may process information. While electronic system 200 is illustrated with a single processor, electronic system 200 may include multiple processors and/or co-processors. Electronic system 200 further may include random access memory (RAM) or other dynamic storage device 225 (referred to as memory), coupled to memory controller 220 that is coupled to bus 205 and may store information and instructions that may be executed by processor 210. Memory 225 may also be used to store temporary variables or other intermediate information during execution of instructions by processor 210.
Memory device(s) 225 may be any of a variety of memory devices configured as, for example, single inline memory modules (SIMMs), dual inline memory modules (DIMMs), etc. The memory modules include one or more dynamic random access memory (DRAM) chips that are coupled to receive the data bits to be stored in memory 225. The DRAM chips can be, for example, 4-bit wide memory chips, 8-bit wide memory chips, 16-bit wide memory chips, etc.
Electronic system 200 may also include read only memory (ROM) and/or other static storage device 230 coupled to bus 205 that may store static information and instructions for processor 210. Data storage device 240 may be coupled to bus 205 to store information and instructions. Data storage device 240 such as a magnetic disk or optical disc and corresponding drive may be coupled to electronic system 200.
Electronic system 200 may also be coupled via bus 205 to display device 250, such as a cathode ray tube (CRT) or liquid crystal display (LCD), to display information to a user. Alphanumeric input device 260, including alphanumeric and other keys, may be coupled to bus 205 to communicate information and command selections to processor 210. Another type of user input device is cursor control 270, such as a mouse, a trackball, or cursor direction keys to communicate direction information and command selections to processor 210 and to control cursor movement on display 250.
Electronic system 200 further may include network interface(s) 280 to provide access to a network, such as a local area network. Network interface(s) 280 may include, for example, a wireless network interface having antenna 285, which may represent one or more antenna(e). Network interface(s) 280 may also include, for example, a wired network interface to communicate with remote devices via network cable 287, which may be, for example, an Ethernet cable, a coaxial cable, a fiber optic cable, a serial cable, or a parallel cable.
In one embodiment, network interface(s) 280 may provide access to a local area network, for example, by conforming to IEEE 802.11b and/or IEEE 802.11g standards, and/or the wireless network interface may provide access to a personal area network, for example, by conforming to Bluetooth standards. Other wireless network interfaces and/or protocols can also be supported.
IEEE 802.11b corresponds to IEEE Std. 802.11b-1999 entitled “Local and Metropolitan Area Networks, Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications: Higher-Speed Physical Layer Extension in the 2.4 GHz Band,” approved Sep. 16, 1999 as well as related documents. IEEE 802.11g corresponds to IEEE Std. 802.11g-2003 entitled “Local and Metropolitan Area Networks, Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications, Amendment 4: Further Higher Rate Extension in the 2.4 GHz Band,” approved Jun. 27, 2003 as well as related documents. Bluetooth protocols are described in “Specification of the Bluetooth System: Core, Version 1.1,” published Feb. 22, 2001 by the Bluetooth Special Interest Group, Inc. Associated as well as previous or subsequent versions of the Bluetooth standard may also be supported.
In one embodiment, a swizzling map is generated by and utilized by a memory controller that is coupled with the memory devices. The memory controller may be hardwired to perform these functions or the memory controller may execute instructions stored in memory, firmware, or microcode. Further, any combination of the above may be supported.
The training process is accomplished by writing a data pattern to a multi-purpose register (MPR) in the memory device, 300. In one embodiment, a “walking 0” pattern is used. In an alternate embodiment, a “walking 1” pattern may be used. Using the walking 0 pattern example, the first data pattern written to the MPR is “1111 1110” for an 8-bit wide device. The data pattern is written to the MPR using the address bus, which is not swizzled.
The data pattern is read from the MPR in the memory device, 310. The data line that returns the “0” is mapped to the corresponding memory controller bit, 320. For example, if the pattern written to the MPR is “1111 1110” and the pattern read from the MPR is “1110 1111” then bit zero (DQ0) of the memory controller is mapped to bit four (D4) of the memory device.
The process of 300, 310 and 320 are completed for all iterations of the data pattern. If all patterns are not completed, 330, a subsequent pattern is written to the MPR, 300. Continuing the walking 0 example from above, the second pattern written to the MPR may be “1111 1101”. The pattern is read from the MPR, 310. The data line that returns the “0” is mapped to the corresponding memory controller bit, 320. For example, if the pattern written to the MPR is “1111 1101” and the pattern read from the MPR is “1111 0111” then bit one (DQ1) of the memory controller is mapped to bit three (D3) of the memory device.
If all patterns are complete, 330, swizzling training may be completed, 340. Completion of swizzling training may include, for example, storing of mapping data to a table in the memory controller, sending an indication that the training has completed and that data operations may commence.
The data bits are rearranged using the swizzling map, 420. The bits are rearranged so that the data bits reach the pins of the memory device in the correct order. This allows the memory device to apply ECC operations to detect and/or correct data errors. The data received by the memory device is stored, 430.
Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment.
While the invention has been described in terms of several embodiments, those skilled in the art will recognize that the invention is not limited to the embodiments described, but can be practiced with modification and alteration within the spirit and scope of the appended claims. The description is thus to be regarded as illustrative instead of limiting.