Hardware device for parallel processing of any instruction within a set of instructions6675291Abstract Hardware device for parallel processing a determined instruction of a set of instructions having a same format defining operand fields and other data fields, the execution of this determined instruction being represented as an algorithm comprising a plurality of processes, the processing of which depending on decisions. Such a device comprises means (22-30) for activating the processing of one or several processes (32-38) determined by the operand fields of the instruction, decision macroblocks (12-20) each being associated with a specific instruction of the set of instructions, only one decision marcoblock being selected by the determined instruction in order to determine which are the process(es) to be activated for executing the determined instruction. Claims Having thus described our invention, what we claim as new, and desire to secure by Letters Patent is: Description BACKGROUND OF THE INVENTION
OPERAND DATA
Instruction 1 01001011XXX011001 XXX . . . X
Instruction 2 10101000010101100 XXX . . . X
Instruction 3 01001011XX01X0011 XXX . . . X
Instruction 4 10110XX01X1010001 XXX . . . X
For the above instructions, the mask register and the value register of the corresponding macroblocks will be configured as follows:
OPERAND DATA
Macroblock 1
Instruct 01001011XXX011001 XXX . . . X
ionMask register 111 . . . 1
Value register 00000000111000000 111 . . . 1
01001011111011001
Macroblock 2
Instruction 10101000010101100 XXX . . . X
Mask register 00000000000000000 111 . . . 1
Value register 10101000010101100 111 . . . 1
Macroblock 3
Instruction 01001011XX01X0011 XXX . . . X
Mask register 00000000110010000 111 . . . 1
Value register 01001011110110011 111 . . . 1
Macroblock 4
Instruction 10110XX01X1010001 XXX . . . X
Mask register 00000110010000000 111 . . . 1
Value register 10110110111010001 111 . . . 1
When one of the instructions is to be executed, for example instruction 2, the instruction is decoded in the four macroblocks. But only macroblock 2 provides a bit 1 as output since OR (bit by bit) between instruction 2 and the contents of the mask register is as follows: 10101000010101100 (instruction) 00000000000000000 (mask) OR=10101000010101100 XOR (bit by bit) between this result and the contents of the value register is as follows: 10101000010101100 (OR result) 10101000010101100 (value) XOR=00000000000000000 Then function NOR of all bits gives 1. APPLICATION OF THE INVENTION An interesting application of the invention is the address lookup operation in a router of an IP network consisting in searching the routing table for the longest prefix matching the destination address of the packet. To preform this lookup operation, the routing table is arranged according to a tree structure in which each table prefix is represented by a leaf of a tree. At each node of the tree is associated a numeric key on which is applied an instruction. This instruction is one of a set of instructions and determines whether the right or the left branch is to be taken in order to go on searching. The following example illustrates the case when the instruction applied to each node is a 32 bit instruction used in the framework of the description of U.S. patent application Ser. No. 245.182 filed by the applicant (hereby incorporated herein by reference thereto). As illustrated in FIG. 5 representing the algorithm of the instruction set, it is necessary to identify at each node on how many bits comparison is performed and is to be applied. Therefore, the number of bits to analyze as operand fields may be different for each instruction. The set of instructions represented by the algorithm of FIG. 5 is as follows:
METHOD
CASE BASIC CODE 11 BITS KEY VALUE or
MODE SELECT Case0 Case1 ADDRESS_LEFT 2 TO 12 BITS
PATTERN COMPARE
CASE 0 ADDRESS
CASE 1 ADRESS + 1
PAGE UP +1 MSB
PAGE EQUAL = MSB
PAGE DOWN -1 MSB
EXT PTR = LSB
0 0 0 0 0 0 0 0 (example 1)
SHIFTx2, CASE 0, PAGE UP
0 0 0 0 0 1 0 0
SHIFTx2, CASE 0, PAGE EQUAL
0 0 0 0 1 0 0 0
SHIFTx2, CASE 0, PAGE DOWN
0 0 0 0 1 1 0 0
SHIFTx2, CASE 0, EXTR PTR
0 0 0 0 0 0 0 1
SHIFTx2, CASE 1, PAGE UP
0 0 0 0 0 1 0 1
SHIFTx2, CASE 1, PAGE EQUAL
0 0 0 0 1 0 0 1
SHIFTx2, CASE 1, PAGE DOWN
0 0 0 0 1 1 0 1
SHIFTx2, CASE 1, EXT PTR
0 0 0 0 0 0 1 0
SHIFTx2, CASE 1, PAGE UP
0 0 0 0 0 1 1 0
SHIFTx2, CASE 1, PAGE EQUAL
0 0 0 0 1 0 1 0
SHIFTx2, CASE 1, PAGE DOWN
0 0 0 0 1 1 1 0
SHIFTx2, CASE 1, EXTR PTR
0 0 0 0 0 0 1 1
SHIFTx2, CASE 1, PAGE UP
0 0 0 0 0 1 1 1
SHIFTx2, CASE 1, PAGE EQUAL
0 0 0 0 1 0 1 1
SHIFTx2, CASE 1, PAGE DOWN
0 0 0 0 1 1 1 1
SHIFTx2, CASE 1, EXT PTR
0 0 0 1 0 0 0 0
SHIFTx2, CASE 1, PAGE UP
0 0 0 1 0 1 0 0
SHIFTx2, CASE 1, PAGE EQUAL
0 0 0 1 1 0 0 0
SHIFTx2, CASE 1, PAGE DOWN
0 0 0 1 1 1 0 0
SHIFTx2, CASE 1, EXT PTR
0 0 0 1 0 0 0 1
SHIFTx2, CASE 0, PAGE UP
0 0 0 1 0 1 0 1
SHIFTx2, CASE 0, PAGE EQUAL
0 0 0 1 1 0 0 1
SHIFTx2, CASE 0, PAGE DOWN
0 0 0 1 1 1 0 1
SHIFTx2, CASE 0, EXT PTR
0 0 0 1 0 0 1 0
SHIFTx2, CASE 1, PAGE UP
0 0 0 1 0 1 1 0
SHIFTx2, CASE 1, PAGE EQUAL
0 0 0 1 1 0 1 0
SHIFTx2, CASE 1, PAGE DOWN
0 0 0 1 1 1 1 0 (example 2)
SHIFTx2, CASE 1, EXT PTR
0 0 0 1 0 0 1 1
SHIFTx2, CASE 1, PAGE UP
0 0 0 1 0 1 1 1
SHIFTx2, CASE 1, PAGE EQUAL
0 0 0 1 1 0 1 1
SHIFTx2, CASE 1, PAGE DOWN
0 0 0 1 1 1 1 1
SHIFTx2, CASE 1, EXT PTR
0 0 1 0 0 0 0 0
SHIFTx2, CASE 1, PAGE UP
0 0 1 0 0 1 0 0
SHIFTx2, CASE 1, PAGE EQUAL
0 0 1 0 1 0 0 0
SHIFTx2, CASE 1, PAGE DOWN
0 0 1 0 1 1 0 0
SHIFTx2, CASE 1, EXT PTR
0 0 1 0 0 0 0 1
SHIFTx2, CASE 1, PAGE UP
0 0 1 0 0 1 0 1
SHIFTx2, CASE 1, PAGE EQUAL
0 0 1 0 1 0 0 1
SHIFTx2, CASE 1, PAGE DOWN
0 0 1 0 1 1 0 1
SHIFTx2, CASE 1, EXT PTR
0 0 1 0 0 0 1 0
SHIFTx2, CASE 0, PAGE UP
0 0 1 0 0 1 1 0
SHIFTx2, CASE 0, PAGE EQUAL
0 0 1 0 1 0 1 0
SHIFTx2, CASE 0, PAGE DOWN
0 0 1 0 1 1 1 0
SHIFTx2, CASE 0, EXT PTR
0 0 1 0 0 0 1 1
SHIFTx2, CASE 1, PAGE UP
0 0 1 0 0 1 1 1
SHIFTx2, CASE 1, PAGE EQUAL
0 0 1 0 1 0 1 1
SHIFTx2, CASE 1, PAGE DOWN
0 0 1 0 1 1 1 1
SHIFTx2, CASE 1, EXT PTR
0 0 1 1 0 0 0 0
SHIFTx2, CASE 1, PAGE UP
0 0 1 1 0 1 0 0
SHIFTx2, CASE 1, PAGE EQUAL
0 0 1 1 1 0 0 0
SHIFTx2, CASE 1, PAGE DOWN
0 0 1 1 1 1 0 0
SHIFTx2, CASE 1, EXT PTR
0 0 1 1 0 0 0 1
SHIFTx2, CASE 1, PAGE UP
0 0 1 1 0 1 0 1
SHIFTx2, CASE 1, PAGE EQUAL
0 0 1 1 1 0 0 1
SHIFTx2, CASE 1, PAGE DOWN
0 0 1 1 1 1 0 1
SHIFTx2, CASE 1, EXT PTR
0 0 1 1 0 0 1 0
SHIFTx2, CASE 1, PAGE UP
0 0 1 1 0 1 1 0
SHIFTx2, CASE 1, PAGE EQUAL
0 0 1 1 1 0 1 0
SHIFTx2, CASE 1, PAGE DOWN
0 0 1 1 1 1 1 0
SHIFTx2, CASE 1, EXT PTR
0 0 1 1 0 0 1 1
SHIFTx2, CASE 0, PAGE UP
0 0 1 1 0 1 1 1
SHIFTx2, CASE 0, PAGE EQUAL
0 0 1 1 1 0 1 1
SHIFTx2, CASE 0, PAGE DOWN
0 0 1 1 1 1 1 1
SHIFTx2, CASE 0, EXT PTR
0 1 0 0 0 0 0 0
SHIFTx1, CASE 0, PAGE UP
0 1 0 0 0 1 0 0
SHIFTx1, CASE 0, PAGE EQUAL
0 1 0 0 1 0 0 0
SHIFTx1, CASE 0, PAGE DOWN
0 1 0 0 1 1 0 0
SHIFTx1, CASE 0, EXT PTR
0 1 0 0 0 0 0 1
SHIFTx1, CASE 0, PAGE UP
0 1 0 0 0 1 0 1
SHIFTx1, CASE 0, PAGE EQUAL
0 1 0 0 1 0 0 1
SHIFTx1, CASE 0, PAGE DOWN
0 1 0 0 1 1 0 1
SHIFTx1, CASE 0, EXT PTR
0 1 0 0 0 0 1 0
SHIFTx1, CASE 1, PAGE UP
0 1 0 0 0 1 1 0
SHIFTx1, CASE 1, PAGE EQUAL
0 1 0 0 1 0 1 0
SHIFTx1, CASE 1, PAGE DOWN
0 1 0 0 1 1 1 0
SHIFTx1, CASE 1, EXT PTR
0 1 0 0 0 0 1 1
SHIFTx1, CASE 1, PAGE UP
0 1 0 0 0 1 1 1
SHIFTx1, CASE 1, PAGE EQUAL
0 1 0 0 1 0 1 1
SHIFTx1, CASE 1, PAGE DOWN
0 1 0 0 1 1 1 1
SHIFTx1, CASE 1, EXT PTR
0 1 0 1 0 0 0 0
SHIFTx1, CASE 0, PAGE UP
0 1 0 1 0 1 0 0
SHIFTx1, CASE 0, PAGE EQUAL
0 1 0 1 1 0 0 0
SHIFTx1, CASE 0, PAGE DOWN
0 1 0 1 1 1 0 0
SHIFTx1, CASE 0, EXT PTR
0 1 0 1 0 0 0 1
SHIFTx1, CASE 1, PAGE UP
0 1 0 1 0 1 0 1
SHIFTx1, CASE 1, PAGE EQUAL
0 1 0 1 1 0 0 1
SHIFTx1, CASE 1, PAGE DOWN
0 1 0 1 1 1 0 1
SHIFTx1, CASE 1, EXT PTR
0 1 0 1 0 0 1 0
SHIFTx1, CASE 0, PAGE UP
0 1 0 1 0 1 1 0
SHIFTx1, CASE 0, PAGE EQUAL
0 1 0 1 1 0 1 0
SHIFTx1, CASE 0, PAGE DOWN
0 1 0 1 1 1 1 0
SHIFTx1, CASE 0, EXT PTR
0 1 0 1 0 0 1 1
SHIFTx1, CASE 1, PAGE UP
0 1 0 1 0 1 1 1
SHIFTx1, CASE 1, PAGE EQUAL
0 1 0 1 1 0 1 1
SHIFTx1, CASE 1, PAGE DOWN
0 1 0 1 1 1 1 1
SHIFTx1, CASE 1, EXT PTR
0 1 1 0 0 0 0 0
SHIFTx1, CASE 0, PAGE UP
0 1 1 0 0 1 0 0
SHIFTx1, CASE 0, PAGE EQUAL
0 1 1 0 1 0 0 0
SHIFTx1, CASE 0, PAGE DOWN
0 1 1 0 1 1 0 0
SHIFTx1, CASE 0, EXT PTR
0 1 1 0 0 0 0 1
SHIFTx1, CASE 1, PAGE UP
0 1 1 0 0 1 0 1
SHIFTx1, CASE 1, PAGE EQUAL
0 1 1 0 1 0 0 1
SHIFTx1, CASE 1, PAGE DOWN
0 1 1 0 1 1 0 1
SHIFTx1, CASE 1, EXT PTR
0 1 1 0 0 0 1 0
SHIFTx1, CASE 1, PAGE UP
0 1 1 0 0 1 1 0
SHIFTx1, CASE 1, PAGE EQUAL
0 1 1 0 1 0 1 0
SHIFTx1, CASE 1, PAGE DOWN
0 1 1 0 1 1 1 0
SHIFTx1, CASE 1, EXT PTR
0 1 1 0 0 0 1 1
SHIFTx1, CASE 0, PAGE UP
0 1 1 0 0 1 1 1
SHIFTx1, CASE 0, PAGE EQUAL
0 1 1 0 1 0 1 1
SHIFTx1, CASE 0, PAGE DOWN
0 1 1 0 1 1 1 1
SHIFTx1, CASE 0, EXT PTR
1 1 1 1 0 0 0 00 01 02
SHIFTx3, CASE 0, PAGE UP
1 1 1 1 0 0 1 00 01 02
SHIFTx3, CASE 0, PAGE EQUAL
1 1 1 1 0 1 0 00 01 02
SHIFTx3, CASE 0, PAGE DOWN
1 1 1 1 0 1 1 00 01 02
SHIFTx3, CASE 0, EXT PTR
1 1 1 1 0 0 0 ( 00 01 02)
-- CASE 1, PAGE UP
1 1 1 1 0 0 1 ( 00 01 02)
-- CASE 1, PAGE EQUAL
1 1 1 1 0 1 0 ( 00 01 02)
-- CASE 1, PAGE DOWN
1 1 1 1 0 1 1 ( 00 01 02)
-- CASE 1, EXT PTR
1 1 1 0 0 0 0 00 01 02 03
SHIFTx4, CASE 0, PAGE UP
The first METHOD field of the instruction start with a bit having value 0 in the subfield MODE. This corresponds to a binary sort where only two possibilities are available on each sort: case 0 and case 1. The address for case 0 is available on each sort: case O and case 1. The address for case O is available within a field called "11 BITS ADDRESS LEFT" while the address for case 1 is the address just after the case 0 address and is called address+1. The bit of the subfield CASE SELECT indicate the method to differentiate the two bits analyzed from the key according to the following table:
CASE SELECT CASE 0 if CASE 1 if
000 00 01,10,11
001 01 00,10,11
010 10 00,01,11
011 11 00,01,10
100 00,01 10,11
101 00,10 01,11
110 00,11 01,10
The field ACTION corresponds to the two zone indications for CASE 0 and CASE 1 and indicates whether a new node should be loaded (60 or 62 in FIG. 5) with the different page modifications or if the sort is campleted and the final point (PTR) should be loaded as a result of the sort (64). The two next bits indicate the number of bits to shift in the analyzed pattern for the next pattern analysis. One bit gives the value if the left side (CASE 0) is selected, one bit gives the shift value for the right side (CASE 1). The shift is either 1 or 2 bits. If MODE bit is 1, the last field indicates a comparison of 2 to 12 bits of the analyzed pattern at the current position with the 2 to 12 bits D0, D1, . . . of the instruction. If their value is the same, CASE 0 is selected. Otherwise, CASE 1 is selected. The following examples 1 to 4 relate to four instructions indicated in the above set of instructions, the sequences of bits to be loaded in the MASK and VALUE registers for the corresponding macroblocks and the explanation of the algorithm flow to be used in reference to FIG. 5 EXAMPLE 1 INSTRUCTION 0000X00XXXXXXXXXXXXXXXXXXXXXXXXX MASK 00001001111111111111111111111111 VALUE 00001001111111111111111111111111 The key corresponds to 00 (represented for better understanding in 2 to 12 BITS PATTERN COMPARE field but is in fact present in another register called Binary key pattern shift register. This instruction performs 3 actions determined by: shiftx2, CASE0 and page up. Shiftx2 corresponds to a 2 bits shift in register 66 initiated by block 68 CASE0 is selected which also performs the load of the next instruction stored at the address contained in the 11 bits address_left field. In addition page up increments MSB bits of the address in order to select an higher page in memory. EXAMPLE 2 INSTRUCTION 0001XXX11XXXXXXXXXXXXXXXXXXXXXXX MASK 00001110011111111111111111111111 VALUE 00011111111111111111111111111111 The key corresponds to 10 (represented for better understanding in 2 to 12 BITS PATTERN COMPARE field but is in fact present in another register called Binary key pattern shift register 66. This instruction performs 3 actions determined by: shiftx2, CASE1 and ext. ptr. Shiftx2 corresponds to a 2 bits shift in register 66 initiated by block 70 as CASE1 is selected which also performs the load of the PTR register as the CASE1 field in basic code has 11 as value corresponding to the y case of block 72. EXAMPLE 3 INSTRUCTION 1110001XXXXXXXXXXXXXXXXXXXXXXXXX MASK 00000001111111111111111111111111 VALUE 11100011111111111111111111111111 The 4 bits following the pointer in binary key pattern shift register 66 are matching the 4 data bits D0 D1 D2 D3 in 2_to.sub.-- 12_BITS_PATTERN_COMPARE field. This instruction performs 2 actions determined by: shift4, CASE0 and page equal. It corresponds to a 4 bits shift in register 66 initiated by block 68. CASE0 is selected as the match is found and the load of the next address found in 11_bits_address_left is made in the same page as page equal is associated with this case. EXAMPLE 4 INSTRUCTION 11100XX10XXXXXXXXXXXXXXXXXXXXXXX MASK 0000011001111111111111111111111 VALUE 1110011101111111111111111111111 The 4 bits following the pointer in binary key pattern shift register 66 are not matching the 4 data bits D0 D1 D2 D3 in 2_to.sub.-- 12 BITS_PATTERN_COMPARE field. It corresponds to D0 D1 D2 D3 meaning not matching. This instruction performs 3 actions determined by: CASE1 and page down. It corresponds to a no shift action in register 66 initiated by block 68. Case 1 is selected as the match is not found and the load of the next address found in 11_bits_address_left+1 is made in the previous page (MSB bits-1) as page down is associated with this case. Of course, the device according to the invention implemented in the above application could be used for the determination of a right path corresponding to an input search key from the root to a leaf of a binary tree wherein each specific instruction is associated to a node of the tree and is applied to a key in order to determine the next node to be processed. While the invention has been particularly shown and described with respect to preferred embodiments thereof, it will be understood by those skilled in the art that the foregoing and other changes in form and details may be made therein without departing form the spirit and scope of the invention.
|
Same subclass Same class Consider this |
||||||||||
