Low-latency memory indexing method and structure

Abstract: A significant reduction in the latency between the time the addressed components of memory are ready and the time addressed data is available to the address components of memory is achieved by processing the raw address information faster than the addition used in the prior art. XOR memory addressing replaces the addition of the base and offset address components with an XOR operation, eliminating carry propagation and reducing overall latency. In another embodiment, a summary-addressed-memory (SAM) also eliminates the carry propagation and thus reduce the latency while providing the correct base+offset index. to access the memory word line corresponding to the correct addition; thus a SAM causes no XOR duplicate problems.

Description: INTRODUCTION This invention pertains to memory systems, and more specifically to a method and structure for addressing memories with low latency. Modern processors address memory, including cache memories, with base+offset addressing. Figure 1 is a diagram depicting one embodiment of a typical prior art addition-indexed memory 10, which can if desired serve as a cache memory. Addition-indexed memory 10 includes data array 11 having a plurality of word lines, such as word lines 11-0 through 11-7, which are capable of being accessed by access signals provided by AND gates 12-0 through 12-7, respectively, in order to provide a selected one of the data words stored in data array 11 on output bus 13. The addresses applied to AND gates 12-0 through 12-7 are derived by address addition circuit 15, which receives a base address a2, a1, a0, and an offset address b2, b1, b0, which are added in order to provide select signals s0, s0 , s1, s1 , s2, s2 for application to the array decoder formed by AND gates 12-0 through 12-7. The latency from the time when the address components 12-0 through 12-7 are ready until the time the addressed data is available includes the time required for addition circuit 15 to add base and offset address data. This excess latency typically manifests itself in a pipelined processor as a load-use penalty; the load results are unavailable until two cycles after the availability of the base and offset address data, while ALU operations are available after one cycle. Increased machine scalarity exacerbates the problem twofold: load-delay slots must become load-delay groups, requiring many more instructions to be issued to hide the latency, and the effect of the latency becomes relatively more significant as the baseline performance of the machine improves. Thus, while uniscalar machines may show only 0.05 CPI/1.8 CPI = 3% performance loss due to one load delay slot, as described in Olukotun, Kunle, Trevor Mudje, and Richard Brown, "Performance Optimization of Pipelined Primary Caches", 19th Annual International Symposium on Computer Architecture, 1992, pages 181-90, simulations of a three-scalar machine show 10% performance loss due to a single load delay slot. As well as data caches, other CPU memory units are also addressed after an addition of base and offset address information. Instruction caches frequently require additions before indexing; both sequential code (incrementing) and pc-relative branches require some form of addition before cache indexing. Table Lookaside Buffers (TLBs) also usually require a base+offset addition before translation begins. Register windows may also be implemented with a base pointer plus offset address. The IBM Technical disclosure Bulletin, vol. 34, no 12, May 1992, New York US, page 446, "Wired-in Hash Function for Data Cache Calculation", describes a wired-in hash function for data cache calculation to eliminate the one-cycle delay required for a simple load instruction in RISC work stations. Instead of calculating the effective address by adding up base address and offset, a simple hash function is used to generate the cache access address. The hash function is implemented by wiring certain bits of base address and offset directly to the data cache address lines, which will not introduce any delay in the cache access path; therefore, a load instruction can be executed in a single cycle. US 4 215 402 describes an apparatus for translation of virtual addresses to main storage address by means of a hash index table which contains the main storage addresses. A hash generator apparatus is provided for generating a uniform distribution of hash index table entry addresses for a non-uniform distribution of virtual addresses in a data processing system, where the size of the hash index table is variable and is based on the size of the main storage. A field of bits within the virtual address corresponding to the page identification bits are reversed in order and aligned with two groups of bits from a field of bits with the virtual address corresponding to object identification bits, and the three groups of bits are applied to an EXCLUSIVE-OR circuit. The alignment of the three groups of bits and the size of the hash index table entry addresses generated by the invention are based on the size of the hash index table. Provided in IEEE transactions on Computers, Vol. 42, no 10, October 93, page 1154-1162, "A Quantitative Evaluation of Cache Types for High-Performance Computer Systems", Eric Wu et al is an evaluation of several types of caches. Specifically, caches indexed by virtual addresses having real tab (V/R) type caches are evaluated. V/R type caches utilize hash functions for parallel accesses to a table lookaside buffer (TBL) and cache array, which are crucial for high performance computers. SUMMARY The invention is defined in claim 1. In accordance with the teachings of this invention, a significant reduction in the latency between the time the addressed components of memory are ready and the time addressed data is available to the address components of memory is achieved by processing the raw address information faster than the addition used in the prior art. In one embodiment of this invention, XOR memory addressing replaces the addition of the base and offset address components with an XOR operation. XORing the raw base and offset address information eliminates carry propagation and thereby reduces the overall latency, while the resulting duplicated entries only somewhat increase complexity. The XOR speed improvement arises primarily from the lack of any information transfer among the bits (i.e., a carry chain). In another embodiment, a summary-addressed-memory (SAM) also eliminates the carry propagation and thus reduces the latency while providing the correct base+offset index. Like XOR memories of this invention, sum-addressed-memories reduce the address-component-ready to data-available latency. SAMs reduce latency less than XOR memories, but access the memory word line corresponding to the correct addition; thus a SAM causes no XOR duplicate problems and when used as a cache memory has a miss rate equal to a conventional cache memory. Neither the XOR or SAM method and structures of this invention have carry propagation: XOR and SAM logic require constant latency regardless of the number of bits while addition latency increases with the number of bits. Thus, the advantage of XOR and SAM over prior art addition-before-indexing increases with memory size. BRIEF DESCRIPTION OF THE DRAWING Figure 1 is a diagram depicting a typical prior art addition indexed memory; Figure 2 is a diagram depicting one embodiment of a circuit suitable for use in accordance with the teachings of this invention in which base and offset address bits are added for the sole purpose of performing the tag checks; Figure 3 is a diagram depicting one embodiment of a memory structure of this invention, utilizing exclusive ORing of the base and offset components of the address; Figure 4 is a diagram depicting on embodiment of a SAM of this invention; Figures 5a through 5d are a schematic diagram depicting embodiments of the e i functions of equation (7); Figure 6 is a diagram depicting one embodiment of a sum-address-memory constructed in accordance with the teachings of this invention; Figure 7 is a diagram of one embodiment of a SAM decoder of this invention capable of performing with a late carry; Figure 8 is a diagram depicting a multiple bit SAM of this invention; and Figure 9 is a diagram depicting one embodiment of a sum-content-addressable memory (SCAM) of this invention. DETAILED DESCRIPTION XOR Memories In accordance with one embodiment of this invention, base and offset address components are combined by exclusive OR operations, rather than additions. The use of an exclusive OR operation increases speed in that, unlike an addition operation, no carry operations are required. XORing the base and offset address components eliminates carry propagation and reduces the overall latency but the resulting duplicated entries somewhat increase complexity. The XOR speed improvement arises primarily from the lack of any information transfer among the bits (i.e., a carry chain). The addition of the address components must still occur for the tag check, but this addition may now proceed concurrently with cache access, for example utilizing the circuitry shown in the exemplary block diagram of Figure 2. Referring to Figure 2, in this example, a 32 bit base address and a 32 bit offset address are received on busses 201 and 202, respectively, and are applied to addition circuitry 203, which provides a 30 bit result on output bus 204 to comparator circuitry 205. Simultaneously the base and offset address information is provided via busses 201 and 202 to exclusive OR circuitry 206 which provides index output data to memory array circuit 207, which provides a 30 bit tag word via bus 208 to comparator circuit 205, enabling comparator circuit 205 to provide a one bit hit signal on output lead 209 indicating whether the addressed data is in the cache memory. Note that in this example the cache line size is four bites so that the lower two bits of the 32 bit address is not needed to index cache or check the tag. Simultaneously, the memory array circuit (such as shown in Figure 3) provides 32 bits of output data on data bus 313. Thus, although the addition of the address base and address offset components still take place in order to accomplish the tag check, this addition operation takes place concurrently with cache access, and thus no latency is incurred. Both direct-mapped and set-associative caches map a large address range into the smaller index range of the cache with a hash function. Typically a modulus function of the cache index range is used as the hash function because it is very simple to implement as described, for example, in Smith, Alan Jay, "Cache Memories", Computing Surveys, 14(3):473-530, Sept., 1982, (i.e., after the base+offset addition the low order N address bits index the cache). A tag on each cache entry disambiguates the many addresses that can map into a single cache index. Like conventional caches, XOR caches of this invention also use a hash function to map a large address range into a smaller cache index range, but that hash function combines the base and offset components of a memory reference with an exclusive-OR rather than an addition. The result of the exclusive-Or of the low order bits of the address components is used to index the cache. Figure 3 shows the arrangement of one embodiment of cache index generation in an cache memory of this invention, with the low latency hash function provided by exclusive OR operation performed by address manipulation circuitry 315. Functions other than exclusive OR functions can also be used in accordance with the teachings of this invention. As shown in Figure 3, one embodiment of an exclusive or memory circuit 300 constructed in accordance with the teachings of this invention includes memory array 311 (corresponding generally to memory array circuit 207 of the embodiment of Figure 2) including a plurality of word lines 311-0 through 311-7, each storing a data word. A selected one of the data words is read out via output bus 313 in response to memory access signals provided by AND gates 312-0 through 312-7, each correspond to an associate one of the word lines in memory array 311. AND gates 312-0 through 312-3 are driven by signals generated from the base address component a2, a1, a0 and the offset address component, b2, b1, b0, as combined by exclusive OR gate circuitry 315 (corresponding generally to exclusive OR circuitry 206 of the embodiment of Figure 2). The XOR memory of this invention uses a subset of the address bits to index the cache and thus shares with memories of the prior art the unavoidable characteristic of mapping many addresses to the same index. The XOR cache has the additional characteristic, not shared with conventional cache indexing, of mapping one address to several indices. This mapping of one to many arises when two sets of address components sum to identical indexes but XOR to different indexes. For example, a base of five and an offset of one have a traditional index of six, but an XOR index of four. The same address results from a base of six and an offset of zero, but the XOR index is six rather than the four of the other base-index pair. In this embodiment, the XOR cache tag includes the "index" bits from the actual address because the location no longer specifies those bits, as shown in Table 1. Base Offset Index Tag 5 1 4 6 6 0 6 6 Apart from the necessary extra tag bits, the one-to-many mapping of the XOR memory of this invention results in two problems: an increased miss rate relative to the same size traditional cache, and greater difficulty in handling writes to the cache. One address can occupy many indices in an XOR cache memory of this invention; this duplicating reduces the effective size of the cache thereby increasing its miss rate. At the same time any writes to the XOR cache memory of this invention requires an update of all of the indices which contain the write address, in order to maintain consistency. We call data from a single address residing in multiple cache locations a "duplicate". There are several ways of handling the duplicates in an XOR cache memory of this invention. If we allow duplicates to be entered into the cache then we must be able to update all of the duplicate entries for a particular address on a write to that address. In one embodiment of this invention, this is accomplished with a content addressable memory with one entry per cache index that matches on the address resident in the corresponding cache index. In this embodiment, a write is performed by presenting the write address to the CAM cells which drive the word lines of all of the duplicate cache indexes that contain the address. In an alternative embodiment of this invention, the solution to the problem of duplicates is to prevent their creation while filling the XOR cache. In this embodiment, the XOR cache is included in a second-level cache so that a record is maintained in each second level cache line of the XOR cache index that was filled from that line. On a subsequent miss of the XOR cache the previous XOR index that was filled from the second level cache line is invalidated and updated with the new XOR index. This method ensures that at any given time data from one address can be resident at only one index in the XOR cache. By disallowing duplicates the problem of writing to the cache is solved; however there is a possible miss rate penalty to be paid. If one address is alternately referred to by base+offset components that map to two different XOR cache indices, the resultant activity will be to constantly fill one index and invalidate the other. Fortunately this seems to be a rare occurrence; Table 2 compares the miss rates of an XOR cache memory system of this invention with duplicates disallowed to a prior art cache memory of the same size on the SPEC92int programs. SPEC92int and the programs specified in Table 2 are benchmark programs available from the Standard Performance Evaluation Corporation of Fairfax, Virginia. The XOR cache memory system of this invention miss rate is 10% higher than the prior art cache. The percent of misses that invalidate a duplicate was measured to be quite infrequent and is also shown in Table 2. XOR 1KB cache miss rate comparison miss rate (% instructions) SPEC92int Program conventional XOR % misses invalidate duplicates 008.espresso 4.86 5.32 2.58 022.li 4.37 5.56 1.18 023.eqntott 2.69 2.85 0.009 026.compress 4.59 5.13 0.02 0.72.sc 3.29 3.69 1.03 085.gcc 3.74 4.34 0.39 SAM Memories In an alternative embodiment of this invention, a summary-address-memory (SAM) is provided. A summary-addressed-memory (SAM) also eliminates the carry propagation and thus reduces the latency while providing the correct base+offset index. SAM memories incur only slightly more latency than XOR memory indexing and significantly less latency than performing addition before cache indexing. Like the XOR memories of this invention, sum-addressed-memories of this invention reduce the address-component-ready to data-available latency. SAM memory reduce latency less than XOR memory, but access the memory location corresponding to the correct addition; thus a SAM memory causes no XOR duplicate problems and thus when used as a cache memory has a miss rate equal to a conventional cache. Memories of this invention perform functions of multiple input variables in the decoder of RAM arrays beyond the normal decoding function. The normal decoding function takes one length-n input vector and decodes it into 1 of 2 n outputs, which then drives a word line. SAM decoders take a number of length-n input vectors and decodes into 1 of 2 n outputs equal to the evaluation of the function for those vectors. SAM can evaluate functions which "ripple", i.e. where an output bit depends on the evaluation of the function for other input bits. SAM operates on overlapping segments of the input vectors, as depicted in Figure 4. Base address bits form vector a, having a plurality of segments a 0 through a 3 and offset address bits form vector b, having a plurality of segments b 0 through b 3 in the exemplary Figure 4. These segments need not be identically sized for correct operation. Thus, if desired, each segment can be of any size, and the amount of overlap can be different from segment to segment, so long as the segments overlap by the number of bits necessary to communicate the necessary ripple information from one segment to the next, based on the maximum influence on more significant bit positions as a result of a computation at a given bit position. For the addition embodiment of this invention, the necessary overlap is only one bit. Thus as shown in Figure 4, overlap is provided by overlap vectors O 1 through O 3 . For a 53x53 bit multiply (as a standard double precision multiply) embodiment of this invention, the necessary overlap is 6 bits to accommodate the maximum influence of six bits. The output of each of the segment SAM circuits as shown in Figure 4, is a 2 j of 2 n fully decoded output, where j is the amount of necessary overlap for the implemented function, and n is the number of bits of that SAM circuit. Of interest, this is distinct from the prior art of predecoding addresses, in that predecoding decodes n address bits to a single one of 2 n output lines and does not evaluate a function of multiple address input vectors. In the embodiment of Figure 4, input segments of address bits are operated on by functions 415-0 through 415-3 to provide a set of decoded output signals on decoded busses 416-0 through 416-3, having bit lengths of 2 n 0 through 2 n 3 , respectively, where n 0 is the number of bits associated with function 415-0, and the like. A SAM circuit with equal segments of size n and equal overlap of size j is termed an "n-j" bit SAM circuit. The ANDing of the decoded lines into the word line will select the final 2 j of all the possible word lines. Either 1) one of the segments must use the overlap to fully decode into 1 of 2 n , or 2) a plurality of word lines holding 2 j elements is read from the RAM and a desired element is later selected by a 1 of 2 j multiplex selection. If there is no carry in bit, the low-order segment may not be overlapped by any "lower-order" information (i.e., lower order bits of the function not used to index the RAM), and thus will naturally come down to 1 of 2 n . Any lower-order information such as the carry in bit(s) will provide the information necessary to either fully decode the low-order segment to 1 of 2 n or to select the 1 of 2 j outputs, as with all other segments. The embodiment of Figure 4 evaluates a 2-input function with inter-segment communication of overlapping bits. As an example, one overlapping bit is an appropriate implementation of the addition function. In this embodiment, carry in bit Cin provides the lower-order information which fully decodes the low-order segment to 1 of 2 n 0 In alternative embodiments, the function calculated to provide a memory address decode need not be a addition of A and B. In these alternative embodiments, any desired function which ripples is used, that is any function which has the effect on the overlapped bits of an address portion to determine the output of that portion. A + B = K It is known in the prior art that the result of an equality test A + B = K can be evaluated quickly. In accordance with this invention, we have determined that the equality test A + B = K is useful for calculating the fully decoded output signals of Figure 4, for example. Given three n-bit vectors A = a n-1 a n-2 ... a 0 , B = b n-1 b n-2 ... b 0 , and K = k n-1 k n-2 ...k 0 , the carry in ( c in / i ) and carry out ( c out / i ) of each bit position i are uniquely determined if A + B = K . If for every bit position the carry out from the previous bit position is the necessary carry in to give k i as the answer, then A + B = K . More formally, define the propagate, generate, carry out, and sum for the i th bit as, respectively, A + B = K can be determined by testing s i against k i for all bit positions i ; an add followed by a compare. However, if the answer is K, then c out i -1 = ( p i -1 ∧ k i -1 ) ∨ g i -1 = (( a i -1 ⊕ b i -1 ) ∧ k i -1 ) ∨ ( a i -1 ∧ b i -1 ) c in i = k i ⊕ p i = k i ⊕ ( a i ⊕ b i ) Note that c in / i and c out / i -1 do not depend on propagation, rather only on a , b , and k from their respective bit positions. If Λ n -1 i =0 ( c in i ⊕ c out i -1 ) then a simple inductive proof (given formally by Cortadella and Llaberia in "Evaluating A+B=K Conditions in constant Time," IEEE International Symposium on Circuits and Systems, 1988, pages 243-6 and in "Evaluation of A+B=K Conditions Without Carry Propagation", IEEE Transactions on Computers, November, 1992, 41(11):1484-8) established that starting with c out / -1 as the overall carry in proves that A + B = K . A+B=K Equality Testing to Provide Fast Decode The decoder array of RAMs can be considered to perform a large ANDing of the address lines. Figure 1 shows the logic of a RAM decoder (the actual implementation may vary) for an eight entry RAM with three address bits. The AND gates of the decoder array simultaneously test S = K for each word line K . Single bit SAM example This high degree of decoding parallelism is used to advantage to produce a SAM; each word-line AND independently tests to see if A + B equals that word-line's K . To perform this highly parallel test, the "address" sent down the address lines into the decoder clearly cannot depend on K . To this end, define an "equality" function e i = c in i ⊕ c out i -1 = c in i ⊕ c out i -1 and conditionalize e i with k i k i - 1 ., giving Conditionalizing the carry in and carry out equations results in computationally simple formulas: For each bit position there are four cases of e k i k i-1 / 1 Figures 5a through 5d are examples of circuits providing logical functions for these examples of e i functions, except for the low-order bit position, where the carry in, c -1 , replaces the i -1 terms Logically these equations can be performed in two levels of exclusive-OR gates, or they can be implementable in one complex gate. If area or power constrain more than speed, then the significant number of common terms allows slower implementations with fewer gates. Figure 6 is a schematic diagram of one embodiment of a SAM memory system 400 constructed in accordance with the teachings of this invention. As shown in Figure 6, memory array 411 includes a plurality of word lines 411-0 through 411-7, each storing a word which is capable of being selectively accessed by AND gates 412-0 through, 412-7 and output on output bus 413. In accordance with the teachings of this invention, signals are provided to AND gates 412-0 through 412-7 from sum-addressed circuitry 415 in response to base address word a2, a1, a0, and offset address b2, b1, b0, and carry in bit c -1 . Sum-addressed circuitry 415 includes a plurality of equality function circuits for providing an equality comparison between C in and C out of consecutive bits, using for example the circuits of Figures 5a-5d. These equality functions provide the 2 j of 2 n decoding of the sum function. The number of equality function circuits required is 2 n+1 equality circuit functions for all the high order bits, and 2 n function circuits for the low order bits, for an n bit SAM or SCAM of this invention, which is discussed later. The number of address lines per address bit into decoder 415 doubles from two (true and complement of each address bit), as shown in Figure 1, to four, (true and complement of each of the two address bits) while each word line decoder AND gate ANDs the same number of terms as in a prior art decoder array (such as is shown in Figure 1). Thus, inside decoder array 412, SAM decoding resembles two-bit pre-decoding. Two of the four equality gates per pair of address bits are on at once, corresponding to two sequential addresses. For a 1-bit SAM, two of these four lines into the decoder array are complements of the other two (this characteristic does not hold for the multiple-bit SAM). The base and offset of the address arrive into SAM decoder array 415. However, if the lower bits of the address do not index the memory, as is the case in a cache memory which uses low order bits of the address as a line offset and not as an index; then SAM decoding cannot decode these low-order bits, as they vary for a given index. The SAM decoder thus requires the carry-in c -1 bit, which is the result of the addition of the low order bits of the base and offset addresses. Fortunately, the number of low order bits not used to index the memory, as in a cache, is typically small, and the carry-out c -1 of the low-order bits can be calculated quickly. In one embodiment, the SAM address lines responsive to the carry-out bit c -1 are intentionally made faster than other SAM address lines, to further prevent a reduction in overall circuit speed as a result of the need to calculate the carry bit c -1 . A fast carry-out circuit from the low order bits is necessary; fortunately this circuit is typically small and as only the single carry-out bit is needed, in one embodiment power is allocated to speed this calculation and prevent delaying the overall memory access. Alternatively, a (k,k+1) pair of consecutive memory locations are read from the memory and one of these is then selected by the late-arriving carry-in bit c -1 . This second embodiment preferably utilizes either effectively dual-porting or banking the memory into even and odd banks, and may require twice as many bit-lines and/or twice as many word-lines as waiting for the carry-in. In an alternative embodiment, as shown in the example of Figure 7, an embodiment of a SAM construction in accordance with the teachings of this invention capable of operating with late carry bits is shown. The late carry SAM indexed memory 700 of Figure 7 includes a plurality of word lines, such as word lines 711-0 through 711-7, split into a plurality of data arrays, such as even data array 711-even containing word line 711-0, 711-2, 711-4, and 711-6, and odd data array 711-odd including word line 711-1, 711-3, 711-5, and 711-7. Decoder circuitry 715 receives a base address word A2, A1, A0 and offset address or b2, b1, b0, and it manipulates that data utilizing e i functions in order to provide output words to decoder array 712 which utilizes, for example, a plurality of AND gates 712-0 through 712-7 corresponding to word line 711-0 through 711-7. Odd and even data arrays 711-odd and 711-even thus provide, for each addressing operation, an output data word to multiplexer 719. Multiplexer 719 selects the appropriate one of these data words in response to an e i function responsive to a 0 , b 0 , and the carry bit c -1 , in order to provide the desired one of the data words on output data bus 713. Of interest, in this embodiment, the generation of carry bit c -1 is delayed somewhat from the availability of the base and offset address words. However, since odd and even data arrays 711-odd and 711-even are responsive to the base and offset address words without regard to the delayed carry bit, the delay in providing the carry bit c -1 corresponds generally to the time delay between the availability of the base and offset address words and the accessing of odd and even data arrays 711-odd and 711-even. Thus, when the delayed carry bit c -1 becomes available, the operation of multiplexer 719 takes place on the by then available output data words from odd and even data array 711-odd and 711-even. Multiple-bit SAM Memories In the previously described embodiment of the SAM decoder, each word line decoder AND gate has n inputs, where n is the number of bits in each cell's address K. For each address bit i, a group of four "equality" signals are computed: e i 00 , e i 01 , e i 10 , and e i 11 (an exception to this rule is the least-significant bit position, where only e 0 0c and e i 1c are required). The resulting 4n-2 signals are distributed to the decoder gates, where N is the number of address bits. These decoder gates then pick off one signal from the equality group for each address bit i, as determined by the bit i and bit i-1 values of the gate's address. We call this a "single-bit" SAM decoder, because there is an equality group for each bit of the address. This approach works well for small memories, but, as memory size increases, we encounter physical limits to the fan-in of word line decoder gates. One solution to this problem is for each equality group to examine more bit positions of the address inputs. This is analogous to the "predecode" technique used in conventional RAMs. For example, a "two-bit" SAM memory has an equality group for each two adjacent address bit positions. Figure 8 is a diagram of an exemplary two-bit SAM, used to describe a multiple bit SAM constructed in accordance with the teachings of this invention, which also applies to multiple bit SAMs of more than two bits. As shown in Figure 8, a multiple bit SAM of this invention includes a data array 811 including a plurality of word lines 811-0 through 811-7. Word lines 811-0 through 811-7 are accessed by decoder array 812, for example including a plurality of AND gates 812-0 through 812-7 corresponding to word lines 811-0 through 811-7, respectively. SAM decoder array 815 includes a plurality of e i functions responsive to an appropriate permutation of bits from the base address, offset address, and carry bit c -1 . In terms of the single-bit equality functions that have been previously described, the exemplary two-bit equality functions are: The LSB group is again a special case: For a SAM memory with an n-bit address (for simplicity, assume n is even), there are n/2 equality groups, each (except the low-order group) having eight equality signals. This gives a total of 4n-4 equality signals, which is approximately the same number required in the single-bit scheme. Each word line decoder gate has n/2 inputs, one from each group; the loading on each equality signal is half what it was in the single-bit scheme. In one embodiment, these two-bit equality functions are generated from the single-bit equality functions by a single level of 2-input AND gates, as in a conventional RAM predecoder; the longest path from input to equality is thus two levels of XOR/XNOR (for the single-bit equality functions) plus an AND level. In an alternative embodiment, the two-bit equality functions are generated directly from the inputs. The fact that the two-bit equality functions examine adjacent bits allows some algebraic simplification. For example, if we define u i = a i ∨ b i and substitute, the two-bit equality functions reduce to The longest path in the two-bit equality function (assuming that all inputs are available simultaneously) is an XOR/XNOR followed by a 3-input AND followed by a 3-input OR. Each of the 4n+4 equality signals requires a 3-3-3-AND-OR gate. Built in this manner, the AND-OR gates load the intermediate nets more than for a 1-bit SAM, as shown in Table 3 corresponding with this example. SAM intermediate net loading (fanout) Signal 1-bit SAM 2-bit SAM p 2 20 p 2 12 g 2 14 g 0 6 u 2 6 u 0 14 SCAM Memories In an alternative embodiment of this invention, a sum-content-addressable memory (SCAM) is taught. Unlike the previously described SAM memories of this invention, in which address lines and equality functions are hard wired, in a SCAM of this invention, circuitry is utilized to allow e functions to be selected based upon contents stored in the content addressable memory. The SCAM cell implements a conditional equality of the correct e k i k i -1 / 0 terms based on the contents of adjacent cells. However, SCAM requires more logic than a normal Content Addressable Memory (CAM) cell of the prior art. The "constant" K (the word line address in a RAM) becomes a variable in a SCAM, and thus in one embodiment, the pseudo-address lines consist of components of the carry equality (from the intermediate signal paths of Figures 5a-5d) rather than the four conditionalized carry equalities (from the final output lines of Figures 5a-5d). XOR, AND, and OR operations of the address components suffice to construct the equality signals in a one-bit SCAM cell. Figure 9 depicts one embodiment of a SCAM constructed in accordance with this invention. Referring to Figure 9, SCAM 900 receives base address words a1, and a0, and an offset address word b1, b0, as well as carry bit c -1 . These address bits are applied to e i functions as shown, in order to generate appropriate decoded signals for application to multiplexers 951-m, 952-m, 951-n, and 952-n. These multiplexers are controlled by stored bits which serve to select the appropriate e functions corresponding to the value of the plurality of consecutive stored bits (for the LSB with carry-in, fewer stored bits). The outputs from multiplexers 951-m and 952-m are applied to AND gate 953-m, in order to determine if there is an m-match, indicating no error has been detected, i.e. the e functions are appropriately selected across the entire width of the stored memory value. Similarly, the output bits from multiplexers 951-n and 952-n are applied to AND gate 953-n to determine if there is an n-match. In accordance with the teachings of this invention, when SCAM 900 is configured using addition functions to be more than a 2-bit SCAM, AND gates 953-m and 953-n receive an increased number of decoded output signals from the equality function circuitry as it is currently shown, and with respect to its generic description, such as more than two bits. In a simple configuration, the n-match and m-match signals are directly used as word line select signals. In one embodiment of this invention, the carry-in bit used as a late select after the SCAM has cycled and matched up to two consecutively valued entries, one even, one odd, as previously described with respect to the SAM of this invention. Conclusions The XOR, SAM, and SCAM methods and structures taught by this invention reduce the address-components-ready to data-ready latency in memories accessed with base+offset addresses over the conventional addition followed by memory access. Candidates for these techniques include main memory data caches, instruction caches, register windows, and TLBs. XOR memories decrease latency the most of these techniques, reducing latency to just one 2-input XOR gate over the RAM access. However, XOR memories introduce duplicate-entry problems because the memory location accessed may not always be the same for a given memory address. Extra hardware is necessary to prevent these problems, and when used as a cache memory, the miss rate deteriorates by about 10% (e.g., from 4.0 to 4.4 misses per 100 instructions) in the above example. A SAM memory also reduces latency below add-then-index memory latency, reducing the latency to two 2-input XOR gates over the RAM access. A SAM memory indexes the correct memory location, and therefore has no duplicate-entry problems and when used as a cache memory, has a miss rate identical to a conventional cache.

Claims: A memory comprising: a first set of address leads for receiving one or more base address bits (a 0 , a 1 , a 2 , a 3 ); a second set of address leads for receiving one or more offset address bits (b 0 , b 1 , b 2 , b 3 ); a data array (311; 411; 711; 811) comprising a plurality of word lines (311-0 to 311-7; 411-0 to 411-7; 711-0 to 711-7; 811-0 to 811-7); and address manipulation circuitry, coupled to receive the base and offset address bits (a 0 , a 1 , a 2 , a 3 ; b 0 , b 1 , b 2 , b 3 ) and to address a desired one of said word lines (311-0 to 311-7; 411-0 to 411-7; 711-0 to 711-7; 811-0 to 811-7), characterized in that the base address bits (a 0 , a 1 , a 2 , a 3 ) and the offset address bits (b 0 , b 1 , b 2 , b 3 ) are each organized into a plurality of segments (vector a, vector b); and in that the address manipulation circuitry comprises a plurality of low latency hash functions, other than adders, said hash functions comprising a plurality of equality functions (e 1 00 to e 2 11 ; e 1 000 to e 1 111 ; e 0 0c ; e 0 1c ; e 0 00c to e 0 11c ), each responsive to a unique combination of said base and offset address bits (a 0 , a 1 , a 2 , a 3 ; b 0 , b 1 , b 2 , b 3 ) and including overlap (vector O) between segments (vector a, vector b) of said data base address bits (a 0 , a 1 , a 2 , a 3 ) and said offset address bits (b 0 , b 1 , b 2 , b 3 ), for providing a plurality of hash output signals which are fully decoded and in which more than one of said fully decoded signal is high; and a decoder array (312, 412, 712, 812) comprising a plurality of decoders (412-0 to 412-7; 712-0 to 712-7; 812-0 to 812-7), each associated with one of said word lines (311-0 to 311-7; 411-0 to 411-7; 711-0 to 711-7; 811-0 to 811-7), for receiving a selected combination of said hash signals and addressing the desired word line. A memory according to claim 1, characterized in that the amount of said overlap (vector O) is determined at least in part by the function performed by said hash functions. A memory according to claim 2, characterized in the amount of said overlap (vector O) is also determined by the number of bits manipulated by each said hash function. A memory according to one of the claims 1 to 3, characterized in that said segments (vector a, vector b) need not be of the same number of bits. A memory according to one of the claims 1 to 4, characterized in that said overlap (vector O) need not be of the same number of bits. A memory according to one of the claims 1 to 5, characterized in that said address bits include carry-in bits (c -1 ). A memory according to one of the claims 1 to 6, characterized in that said hash functions emulate adders. A memory according to one of the claims 1 to 7, characterized in that said equality functions (e 1 00 to e 2 11 ; e 1 000 to e 1 111 ; e 0 0c ; e 0 1c ; e 0 00c to e 0 11c ) comprise: e i 00 = ( a i ⊕ b i ) ⊕ ( a i -1 ∨ b i -1 ) e i 01 = ( a i ⊕ b i ) ⊕ ( a i -1 ∧ b i -1 ) e i 10 = ( a i ⊕ b i ) ⊕ ( a i -1 ∨ b i -1 ) e i 11 = ( a i ⊕ b i ) ⊕ ( a i -1 ∧ b i -1 ) where: e i 00 , e i 01 , e i 10 , e i 11 represent said equality functions corresponding to the i th bit position, a i , a i-1 represent the i th and the (i-1) th position bit of said base address bits (a 0 , a 1 , a 2 , a 3 ) respectively; and b i , b i-1 represent the i th and the (i-1) th position bit of said offset address bits (b 0 , b 1 , b 2 , b 3 ) respectively. A memory according to one of the claims 1 to 7, characterized in that said equality functions (e 1 00 to e 2 11 ; e 1 000 to e 1 111 ; e 0 0c ; e 0 1c ; e 0 00c to e 0 11c ) comprise: e i 000 = e i 00 ∧ e 00 i -1 e i 001 = e i 00 ∧ e 01 i -1 e i 010 = e i 01 ∧ e 10 i -1 e i 011 = e i 01 ∧ e 11 i -1 e i 100 = e i 10 ∧ e 00 i -1 e i 101 = e i 10 ∧ e 01 i -1 e i 110 = e i 11 ∧ e 10 i -1 e i 111 = e i 11 ∧ e 11 i -1 where: e i 000 , e i 001 , e i 010 , e i 011 , e i 100 , e i 101 , e i 110 , e i 111 represent two-bit equality functions corresponding to the i th bit position, e i 00 , e i 01 , e i 10 , e i 11 represent single-bit equality functions corresponding to the i th bit position, and e 00 / i -1, e 01 / i -1, e 10 / i -1, e 11 / i -1 represent single-bit equality functions corresponding to the (i-1) th bit position. A memory according to claim 9, characterized in that said input vectors include carry-in bits (c -1 ) and said equality functions (e 1 00 to e 2 11 ; e 1 000 to e 1 111 ; e 0 0c ; e 0 1c ; e 0 00c to e 0 11c ) further comprise: e 1 00 c = e 1 00 ∧ e 0 0 c e 1 01 c = e 1 01 ∧ e 0 1 c e 1 10 c = e 1 10 ∧ e 0 0 c e 1 11 c = e 1 11 ∧ e 0 1 c where e 1 00c , e 1 01c , e 1 10c , e 1 11c represent two-bit equality functions corresponding to bit position 1, e 1 00 , e 1 01 , e 1 10 , e 1 11 represent single-bit equality functions corresponding to bit position 1, e 0 0c , e 0 1c represent single-bit equality functions corresponding to bit position 0, and c represents said carry-in bits. A memory according to one of the claims 1 to 7, characterized in that said input vectors include carry-in bits (c -1 ) and said equality functions (e 1 00 to e 2 11 ; e 1 000 to e 1 111 ; e 0 0c ; e 0 1c ; e 0 00c to e 0 11c ) comprise: e i 000 = ( p i ∧ p i -1 ∧ u i -2 ) ∨ ( p i ∧ g i -1 ∧ u i -2 ) ∨ ( p i ∧ u i -1 ∧ u i -2 ) e i 001 = ( p i ∧ p i -1 ∧ g i -2 ) ∨ ( p i ∧ g i -1 ∧ g i -2 ) ∨ ( p i ∧ u i -1 ∧ g i -2 ) e i 010 = ( p i ∧ p i -1 ∧ u i -2 ) ∨ ( p i ∧ g i -1 ∧ u i -2 ) ∨ (( p i ∧ u i -1 ∧ u i -2 ) e i 011 = ( p i ∧ p i -1 ∧ g i -2 ) ∨ ( p i ∧ g i -1 ∧ g i -2 ) ∨ ( p i ∧ u i -1 ∧ g i -2 ) e i 100 = ( p i ∧ p i -1 ∧ u i -2 ) ∨ ( p i ∧ g i -1 ∧ u i -2 ) ∨ ( p i ∧ u i -1 ∧ u i -2 ) e i 101 = ( p i ∧ p i -1 ∧ g i -2 ) ∨ ( p i ∧ g i -1 ∧ g i -2 ) ∨ ( p i ∧ u i -1 ∧ g i -2 ) e i 111 = ( p i ∧ p i -1 ∧ g i -2 ) ∨ ( p i ∧ g i -1 ∧ g i -2 ) ∨ ( p i ∧ u i -1 ∧ g i -2 ) e 1 00c = ( p 1 ∧ p 0 ∧ c -1 ) ∨ ( p 1 ∧ g 0 ∧ c -1 ) ∨ ( p 1 ∧ u 0 ∧ c -1 ) e 1 01c = ( p 1 ∧ p 0 ∧ c -1 ) ∨ ( p 1 ∧ g 0 ∧ c -1 ) ∨ ( p 1 ∧ u 0 ∧ c -1 ) e 1 10c = ( p 1 ∧ p 0 ∧ c -1 ) ∨ ( p 1 ∧ g 0 ∧ c -1 ) ∨ ( p 1 ∧ u 0 ∧ c -1 ) e 1 11c = ( p 1 ∧ p 0 ∧ c -1 ) ∨ ( p 1 ∧ g 0 ∧ c -1 ) ∨ ( p 1 ∧ u 0 ∧ c -1 ) where: u i = a i Vb i where: a i represents the i th position bit of said base address bits (a 0 , a 1 , a 2 , a 3 ); b i represents the i th position bit of said offset address bits (b 0 , b 1 , b 2 , b 3 ); e i 000 , e i 001 , e i 010 , e i 011 , e i 100 , e i 101 , e i 110 , e i 111 represent two-bit equality functions corresponding to the i th bit position, e 1 00c , e 1 01c , e 1 10c , e 1 11c represent two-bit equality functions corresponding to bit position 1, p i , p i-1 , p 1 , p 0 represent the propagates corresponding to bit positions i, (i-1), 1, and 0 respectively, g i-1 , g i-2 , g 0 represent the generates corresponding to bit positions (i-1), (i-2) and 0 respectively, and c -1 represents said carry-in bit. A memory according to one of the claims 1 to 11, characterized in that said data array (711) comprises a plurality of word lines (711-0 to 711-7) organized as a plurality of banks (711-odd, 711-even) which are read simultaneously in response to said hash output signals, and selection circuitry for selecting a desired one of said plurality of read word lines (311-0 to 311-7; 411-0 to 411-7; 711-0 to 711-7; 811-0 to 811-7) as a function of a selected subset of said address bits (a 0 , a 1 , a 2 , a 3 ). A memory according to one of the claims 1 to 12 characterized by a selection circuitry for selecting desired ones of said hash output signals for application to said decoder (312, 412, 712, 812), as a function of the contents of said overlapping segments of address bits (a 0 , a 1 , a 2 , a 3 ). A memory according to claim 13 characterized by a lookup table to control said selection circuitry, based on said overlapping segments of address bits (a 0 , a 1 , a 2 , a 3 ). A memory according to claim 8 characterized in that said input vectors include carry-in bits (c -1 ) and said equality functions (e 1 00 to e 2 11 ; e 1 000 to e 1 111 ; e 0 0c ; e 0 1c ; e 0 00c to e 0 11c ) further comprise: e 0 0 c = ( a 0 ⊕ b 0 ) ⊕ c -1 e 0 1 c = ( a 0 ⊕ b 0 ) ⊕ c -1 where: e 0 0c , e 0 1c represent equality functions corresponding to the low order bit positions, a 0 represents the 0 th position bit of said base address bits (a 0 , a 1 , a 2 , a 3 ), b 0 represents the 0 th position bit of said base offset bits (b 0 , b 1 , b 2 , b 3 ), and c represents said carry-in bits. A memory according to claim 12 characterized in that said hash functions emulate adders. A memory according to claim 12 characterized in that said hash functions comprise a plurality of equality functions.

Inventors: LAUTERBACH GARY R, LYNCH WILLIAM L, LAUTERBACH, GARY R., LYNCH, WILLIAM L.
Applicants: SUN MICROSYSTEMS INC, SUN MICROSYSTEMS, INC.
Application year: 1995
Main classification: G06F12
IPC codes: G11C11, G06F12