A method and apparatus are presented for processing a stream of information, including preprocessing the stream, which includes partitioning the stream into packets of interest; determining boundaries for the packets of interest, wherein a packet boundary is either a start location or an end location for a packet; and making a record of the packet boundaries by setting a hint bit in a hint bit vector, a location of the hint bit within the hint bit vector corresponding to a position of the packet in the stream. The hint bit vector is split into two or more vectors, where the hint bits are assigned to one of the vectors on an alternating basis. The packets of interest are processed corresponding to the hint bits assigned to each vector in parallel over multiple clock cycles, wherein an original order of the packets of interest is maintained in the stream.
|
6. An apparatus for processing a stream of information, comprising:
a hardware processor configured to:
partition the stream of information into packets of interest;
make a record of packet boundaries for the packets of interest by setting a hint bit in a hint bit vector, a location of the hint bit within the hint bit vector corresponding to a position of the packet in the stream of information, wherein a packet boundary is either a start location for a packet in the stream of information or an end location for a packet in the stream of information; and
split the hint bit vector into two or more vectors where the hint bits are assigned to one of the two or more vectors on an alternating basis;
wherein the hardware processor uses a plurality of hint bit vectors to process the packets of interest corresponding to the hint bits in parallel over multiple clock cycles; and
wherein the hardware processor maintains an original order of the packets of interest in the stream of information.
1. A method for processing a stream of information, comprising:
preprocessing the stream of information, wherein the preprocessing includes:
partitioning the stream of information into packets of interest;
determining boundaries for the packets of interest, wherein a packet boundary is either a start location for a packet in the stream of information or an end location for a packet in the stream of information; and
making a record of the packet boundaries by setting a hint bit in a hint bit vector, a location of the hint bit within the hint bit vector corresponding to a position of the packet in the stream of information;
splitting the hint bit vector into two or more vectors, where the hint bits are assigned to one of the two or more vectors on an alternating basis;
processing the packets of interest corresponding to the hint bits assigned to each vector in parallel over multiple clock cycles; and
wherein an original order of the packets of interest is maintained in the stream of information.
11. A non-transitory computer-readable storage medium storing a set of instructions for execution by one or more processors to process a stream of information, the set of instructions comprising:
a preprocessing code segment for preprocessing the stream of information, wherein the preprocessing code segment includes:
a partitioning code segment for partitioning the stream of information into packets of interest;
a determining code segment for determining boundaries for packets of interest, wherein a packet boundary is either a start location for a packet in the stream of information or an end location for a packet in the stream of information; and
a making code segment for making a record of the packet boundaries by setting a hint bit in a hint bit vector, a location of the hint bit within the hint bit vector corresponding to a position of the packet in the stream of information;
a splitting code segment for splitting the hint bit vector into two or more vectors where the hint bits are assigned to one of the two or more vectors on an alternating basis; and
a processing code segment for processing the packets of interest corresponding to the hint bits assigned to each vector in parallel over multiple clock cycles, wherein an original order of the packets of interest is maintained in the stream of information.
2. The method of
3. The method of
5. The method of
7. The apparatus of
9. The apparatus of
10. The apparatus of
12. The non-transitory computer-readable storage medium of
13. The non-transitory computer-readable storage medium of
|
This application is related to processing data.
As processors evolve, emphasis is increasingly placed on processor performance. In order to achieve faster performance, technological advances are being pursued with respect to both the scale of the processors as well as with more efficient completion of computing tasks.
In order for a processor to operate at a high frequency and a low power, efficient processing of information is critical. A sequence of instructions (i.e., an instruction stream) may be used by a processor, for example an X86 processor, to process information. Prior to decoding instructions, the start location of each instruction must be determined. Since the X86 architecture is a variable length instruction architecture, a large amount of resources are used to determine the start locations of instructions within an instruction stream. Once the instruction start locations are determined, they are used by the machine to more efficiently process information.
An instruction stream may be fed to a unit, such as a decode unit, that picks instructions from the stream and sends the instructions to other areas of the machine for execution. The identification of the byte length of each instruction, so that the start locations of the subsequent instructions may be determined, is a complex task. Thus, it is not efficient for the machine to re-process the instruction stream to determine the instruction lengths prior to picking instructions during subsequent iterations of the program. By storing the start locations of instructions within the instruction stream, the processing of subsequent iterations is more efficient.
Consequently, processors are routinely built to identify the start location of each instruction only once and store this information for use during subsequent iterations. Accordingly, it would be beneficial to provide a method and apparatus capable of making use of this information most efficiently while processing an instruction stream at a high frequency.
A method and apparatus is presented for identifying instruction start locations in a stream of information by preprocessing the stream of information, storing the instruction start locations in a vector and decomposing the vector into two or more vectors that may be processed in parallel are included in the embodiments disclosed. In an embodiment, a processor is configured to partition a stream of information into packets of interest, make a record of packet boundaries for the packets of interest and split the record of packet boundaries into two or more vectors where the packets of interest are assigned to the vectors on an alternating basis. The processor uses a plurality of vectors to process the packets of interest in parallel over multiple clock cycles.
In order to enable a machine, such as a processor, to run at a high frequency and a low power, efficient processing of information is important. While the processing of instruction streams is described in more detail herein, other forms of information may be processed more efficiently including but are not limited to graphics and data packets. The herein approach may apply to any situation where it is desirable to find the first “n” occurrences in a set of information.
The instruction stream is preprocessed so that the starting position of each instruction in the instruction stream may be determined. The starting positions of instructions in the instruction stream are marked by bits set to “1”, while the bit “0” indicates that no instruction begins at that particular location (step 110). By preprocessing the instruction stream, a bit vector, which includes the starting position of each instruction in the original instruction stream, is determined. For example, a 32 bit vector may be determined for each 32 byte chunk of the instruction stream, with each bit set to 1 if its corresponding instruction byte constitutes the first byte of an instruction and set to 0 otherwise.
In one embodiment, the bit vector may identify the starting locations of each instruction in the instruction stream. In another embodiment, the bit vector may identify the end locations of each instruction in the instruction stream. Each instruction in the original instruction stream may be referred to as a “packet of interest.” Instructions may begin or end on any “packet boundary”. A packet boundary may refer to either a start location or an end location of an instruction. A record of each packet boundary may be made and stored in a cache.
A starting location of an instruction may be indicated by a “hint bit” and the bit vector may be referred to as a hint bit vector. The hint bit vector, once identified, may be stored in the same cache as the instruction stream (step 115) so that in subsequent iterations of the instruction stream the hint bit vector is also used.
The hint bits enable the machine to efficiently identify the start location of each instruction within the instruction stream. Since the hint bits are used in subsequent executions of the instruction stream to identify start locations of instructions, the hint bits negate the need to re-calculate the instruction locations prior to picking them from the instruction stream.
Each time the instruction stream is executed, both the instruction stream and the hint bit vector are first read from the cache. After preprocessing the instruction stream to identify the hint bits, processing of the instruction stream during subsequent executions is less time intensive since the hint bits are already identified.
A working copy of the hint bit vector is made using two or more vectors (i.e., an odd vector and an even vector) each time the instruction stream is executed (step 120). The hint bit vector is divided into the two or more vectors to execute one loop of the instruction stream. The use of two or more vectors enables a machine to process information at a high frequency by processing the vectors in parallel over multiple clock cycles.
One loop of the instruction stream is executed over multiple clock cycles using the two or more vectors. The hint bits from the hint bit vector are allocated to either the odd or the even vectors on an alternating basis. For example, the first hint bit may be allocated to the odd vector while the second hint bit may be allocated to the even vector, and so forth. The alternating of hint bits between odd and even vectors enables a machine to pick instructions in parallel, which results in a higher frequency picking process because fewer hint bits need be found from any one vector in a single clock cycle.
While the hint bits in the hint bit vector do not change from one execution of the instruction stream to another, the working copy of the hint bit vector does change. As each instruction is picked from the working copy, the hint bits are nulled. By nulling the hint bits, the machine is able to move to the next instruction in a sequence. However, the cached version of the hint bit vector, which is used in subsequent loop executions of the instruction stream, remains unchanged.
Any byte location within an instruction stream may be designated by an instruction as a new start location for subsequent processing. The new start location itself is considered a “start pointer” for a first clock cycle of subsequent processing in the first vector (step 125). The start pointer refers to the location of the starting position for each clock cycle. Once the start pointer is determined, hint bits may be identified one-by-one in the hint bit vector by performing a find action, further defined with respect to
Multiple clock cycles may be executed, wherein up to four instructions are picked per clock cycle, and up to two instructions are picked per vector during the cycle. The last instruction picked in a given clock cycle, in a given vector, is used as the start pointer for a subsequent clock cycle in each vector (step 130). Using multiple vectors per cycle, in contrast to using one vector per cycle, to pick as many as four instructions during the cycle, enables a machine to more easily pick at a high frequency.
The hint bits in the odd vector and the even vector are identified one-by-one in a clock cycle. While multiple vectors, start pointers and clock cycles may be utilized in one execution of the instruction stream, the instruction stream and hint bit vector remain unchanged. For each execution of the instruction stream, the instruction stream and the hint bit vector are read from the cache.
The hint bit vector 200 is made up of binary data (i.e., 0s and 1s). The is in the hint bit vector 200 are designated hint bits 205 and correspond to the start location of instructions within the original data stream. The 0s in the hint bit vector 200 (not labeled for ease of understanding) do not correspond to start locations.
A hint bit 205 is used to identify an actual byte location of where an instruction starts in the instruction stream. In general, the apparatus (e.g., a processor), is configured to determine the start of an instruction in an instruction stream by associating each byte of instruction information with a hint bit 205. Once hint bits 205 are identified and located, they are stored in the hint bit vector 200, which may also be referred to as a start bit vector, in the same cache as the instruction stream. This hint bit vector 200 is thereafter used by the apparatus to locate instructions in subsequent executions or loops of the instruction stream. The hint bit vector 200 is read from right to left as shown in
Once the location of a hint bit is determined, it is read and masked out by a change to the binary data, for example, by changing the binary 1 to 0. In
In order to find the second hint bit 302 a “find second” action is performed. The third hint bit 303 and fourth hint 304 bit in a given clock cycle are also determined by a “find third” action and “find fourth” action, respectively. When the fourth hint bit 304 is determined, it is used as the start pointer for the next clock cycle. All hint bits 301, 302, 303 and 304, once picked in the clock cycle, are nulled. To ensure that multiple clock cycles of execution of the hint bit vector are accomplished in an efficient manner, and that a subsequent cycle begins where a prior clock cycle left off, the last hint bit of a clock cycle is used as the start pointer for the subsequent clock cycle. In
Relative to the flow diagram of
The hint bit vector 400 may be split into a plurality vectors. For example, two vectors may be created where one vector is an “odd” vector 420 and the other vector is an “even” vector 430. The first hint bit 401, located in the hint bit vector 400, corresponds to the first instruction in the odd vector 420. The bit location in the even vector 430, corresponding to the first hint bit 401 in the odd vector 420, is depicted with a 0, indicating that there is no instruction in the even vector 430 at this bit location. The second hint bit 402 located in hint bit vector 400, corresponds to the first instruction in even vector 430. The bit location in the odd vector 420, corresponding to the first hint bit 402 in the even vector 430, is depicted with a 0, indicating that there is no instruction in the odd vector 420 at this position.
Every hint bit in the hint bit vector 400 is located in either the odd vector 420 or the even vector 430, but not in both. The hint bits in hint bit vector 400 alternate between the odd vector 420 and the even vector 430 so that the odd vector 420 receives the first hint bit 401, the even vector 430 receives the second hint bit 402, the odd vector 420 receives the third hint bit 403, the even vector 430 receives the fourth hint bit 404, and so on. The number of hint bits may vary per vector.
Relative to the flow diagram of
Odd vector 504 is the first to receive an instruction from the hint bit vector 500 and contains the first start pointer 508 for the first cycle. Even vector 506 is the second vector to receive an instruction from the hint bit vector 500 and contains the second start pointer 510 for the first cycle, and so forth for each additional vector that may be used to execute one loop of an instruction stream. Each vector 504, 506 is then executed by picking one or more instructions per clock cycle from right to left in each vector.
In the embodiment of
When the final hint bit in a clock cycle in each vector is determined, it is used as the start pointer for the vector in the next clock cycle. To ensure that multiple clock cycles of execution of the hint bit vector 500 are accomplished in an efficient manner, and that the next clock cycle begins where the previous clock cycle left off, the final hint bit in a vector at the end of the previous clock cycle is used as the start pointer for the vector in the next clock cycle.
After the hint bits 512-518 in the first clock cycle 502 are identified and picked, the last hint bit identified in each vector in each cycle is the start pointer for the next cycle. For example, the hint bit 516 for the odd vector 504 and the hint bit 518 for the even vector 506 are the start pointers for the next clock cycle. Once the start pointers for the next clock cycle for each vector are determined, one of the start pointers is determined to be a first start pointer for a subsequent clock cycle and one of the start pointers is determined to be a second start pointer based on the relative positions of the pointers.
The number of instructions picked per clock cycle may vary. For example, in a given clock cycle up to four instructions may be picked, wherein up to two instructions are picked from each vector. However, it may not be possible to pick four instructions in a given clock cycle. For example, two instructions may be picked from the odd vector while only one instruction is picked from the even vector. Since instructions may be anywhere from one to fifteen bytes long, there may not be four hint bits in a working copy of the hint bit vector in a given cycle to pick. When fewer than two instructions are picked in a cycle in a vector, the next cycles start pointer may not be the second instruction picked in a cycle in a given vector but may be the first instruction picked in a given cycle in a given vector. In the above example the start pointer for the next cycle in the odd vector would be the second instruction picked while the start pointer in the even vector for the next cycle would be the first instruction picked.
When this occurs, a first start pointer may be located in a different vector than the vector in which it was located in during a previous clock cycle. In the above example, the even vector, where only one instruction was picked in the current cycle, would include the first start pointer for the next cycle. The odd vector, where two instructions were picked in the current cycle, would include the second start pointer for the next cycle. The location of the first start pointer is monitored so that the instructions picked may then be reordered, if necessary, before the instructions are sent to other areas of the machine. This enables the vectors to work in parallel and the instructions to remain in order.
Although features and elements are described above in particular combinations, each feature or element can be used alone without the other features and elements or in various combinations with or without other features and elements. The methods or flow charts provided herein may be implemented in a computer program, software, or firmware incorporated in a computer-readable storage medium for execution by a general purpose computer or a processor. Examples of computer-readable storage mediums include a read only memory (ROM), a random access memory (RAM), a register, cache memory, semiconductor memory devices, magnetic media such as internal hard disks and removable disks, magneto-optical media, and optical media such as CD-ROM disks, and digital versatile disks (DVDs).
Embodiments of the present invention may be represented as instructions and data stored in a computer-readable storage medium. For example, aspects of the present invention may be implemented using Verilog, which is a hardware description language (HDL). When processed, Verilog data instructions may generate other intermediary data, (e.g., netlists, GDS data, or the like), that may be used to perform a manufacturing process implemented in a semiconductor fabrication facility. The manufacturing process may be adapted to manufacture semiconductor devices (e.g., processors) that embody various aspects of the present invention.
Suitable processors include, by way of example, a general purpose processor, a special purpose processor, a conventional processor, a digital signal processor (DSP), a plurality of microprocessors, one or more microprocessors in association with a DSP core, a controller, a microcontroller, Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) circuits, any other type of integrated circuit (IC), and/or a state machine. Such processors may be manufactured by configuring a manufacturing process using the results of processed hardware description language (HDL) instructions (such instructions capable of being stored on a computer readable media). The results of such processing may be maskworks that are then used in a semiconductor manufacturing process to manufacture a processor which implements aspects of the present invention.
Processors may be any one of a variety of processors such as a central processing unit (CPU) or a graphics processing unit (GPU). For instance, they may be x86 microprocessors that implement x86 64-bit instruction set architecture and are used in desktops, laptops, servers, and superscalar computers, or they may be Advanced RISC (Reduced Instruction Set Computer) Machines (ARM) processors that are used in mobile phones or digital media players. Other embodiments of the processors are contemplated, such as Digital Signal Processors (DSP) that are particularly useful in the processing and implementation of algorithms related to digital signals, such as voice data and communication signals, and microcontrollers that are useful in consumer applications, such as printers and copy machines. Although the embodiment may include one processor for illustrative purposes, any other number of processors will be in-line with the described embodiments.
Butler, Mike, Priore, Donald A., Beigelmacher, Steven
Patent | Priority | Assignee | Title |
11029951, | Aug 15 2016 | Micron Technology, Inc. | Smallest or largest value element determination |
11526355, | Aug 15 2016 | Micron Technology, Inc. | Smallest or largest value element determination |
11789797, | Aug 28 2019 | Micron Technology, Inc. | Error control for content-addressable memory |
Patent | Priority | Assignee | Title |
5450605, | Feb 06 1992 | Intel Corporation | Boundary markers for indicating the boundary of a variable length instruction to facilitate parallel processing of sequential instructions |
5488710, | Feb 08 1991 | Fujitsu Semiconductor Limited | Cache memory and data processor including instruction length decoding circuitry for simultaneously decoding a plurality of variable length instructions |
5513330, | Oct 09 1990 | Advanced Micro Devices, INC | Apparatus for superscalar instruction predecoding using cached instruction lengths |
5586276, | Feb 06 1992 | Intel Corporation | End bit markers for indicating the end of a variable length instruction to facilitate parallel processing of sequential instructions |
5758116, | Sep 30 1994 | Intel Corporation | Instruction length decoder for generating output length indicia to identity boundaries between variable length instructions |
5796973, | Oct 29 1993 | Advanced Micro Devices, Inc. | Method and apparatus for decoding one or more complex instructions into concurrently dispatched simple instructions |
5819059, | Apr 12 1995 | Advanced Micro Devices, Inc. | Predecode unit adapted for variable byte-length instruction set processors and method of operating the same |
5852727, | Mar 10 1997 | Advanced Micro Devices, Inc. | Instruction scanning unit for locating instructions via parallel scanning of start and end byte information |
5880978, | Aug 20 1996 | Intel Corporation | Method and apparatus for creating an output vector from an input vector |
6032250, | Dec 05 1997 | Intel Corporation | Method and apparatus for identifying instruction boundaries |
6308257, | Apr 20 1999 | Intel Corporation | Method and apparatus for generating boundary markers for an instruction stream including variable-length instructions |
6513053, | Jan 12 2000 | ARM Limited | Data processing circuit and method for determining the first and subsequent occurences of a predetermined value in a sequence of data bits |
6862563, | Oct 14 1998 | Synopsys, Inc | Method and apparatus for managing the configuration and functionality of a semiconductor design |
20120143874, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Dec 01 2010 | BUTLER, MIKE | Advanced Micro Devices, INC | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 025463 | /0530 | |
Dec 01 2010 | PRIORE, DONALD A | Advanced Micro Devices, INC | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 025463 | /0530 | |
Dec 02 2010 | BEIGELMACHER, STEVEN | Advanced Micro Devices, INC | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 025463 | /0530 | |
Dec 07 2010 | Advanced Micro Devices, Inc. | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
May 04 2017 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
May 05 2021 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Date | Maintenance Schedule |
Nov 19 2016 | 4 years fee payment window open |
May 19 2017 | 6 months grace period start (w surcharge) |
Nov 19 2017 | patent expiry (for year 4) |
Nov 19 2019 | 2 years to revive unintentionally abandoned end. (for year 4) |
Nov 19 2020 | 8 years fee payment window open |
May 19 2021 | 6 months grace period start (w surcharge) |
Nov 19 2021 | patent expiry (for year 8) |
Nov 19 2023 | 2 years to revive unintentionally abandoned end. (for year 8) |
Nov 19 2024 | 12 years fee payment window open |
May 19 2025 | 6 months grace period start (w surcharge) |
Nov 19 2025 | patent expiry (for year 12) |
Nov 19 2027 | 2 years to revive unintentionally abandoned end. (for year 12) |