Claims
- 1. A method of processing multiple threads of instructions in a data processor, the method including:
(a) interleaving instructions from a first thread of instructions with instructions from at least one additional thread of instructions according to a priority rule between the first thread of instructions and the at least one additional thread of instructions; and (b) inserting a randomization into the interleaving step while preserving the priority rule.
- 2. The method of claim 1 wherein the step of interleaving instructions is performed on a cycle-by-cycle basis.
- 3. The method of claim 1 wherein the step of interleaving instructions according to a priority rule includes generating a thread selection signal indicating a thread to be processed.
- 4. The method of claim 3 wherein the step of inserting a randomization includes the step of randomizing the thread selection signal.
- 5. The method of claim 4 wherein the step of randomizing the thread selection signal includes the steps of:
(a) generating a mask from a first thread priority signal associated with the first thread of instructions and from a respective additional thread priority signal associated with each additional instruction thread; (b) generating a random number or a pseudo random number; and (c) comparing the mask to the random number or the pseudo random number to generate a randomized mask.
- 6. The method of claim 5 wherein the step of interleaving instructions includes the steps of:
(a) inverting the mask to generate an inverted mask; and (b) comparing the randomized mask with the inverted mask.
- 7. A method for producing a thread selection output for use in selecting an instruction for processing in a data processor, the instruction being selected from a plurality of instruction threads, and the method including the steps of:
(a) generating a mask from priority signals associated with the plurality of instruction threads, the priority signals indicating a thread priority for respective ones of the plurality of instruction threads; (b) generating a random number or pseudo random number suitable for comparison with the mask; (c) comparing the mask to the random number or pseudo random number to produce a randomized mask; and (d) generating the thread selection output from the randomized mask.
- 8. The method of claim 7 wherein the step of generating the mask includes the step of comparing a first priority signal to a second priority signal.
- 9. The method of claim 8 further including the step of inverting one of the first priority signal or the second priority signal prior to the step of comparing the first priority signal to the second priority signal.
- 10. The method of claim 7 wherein the step of generating a random number or pseudo random number is performed with a linear feedback shift register.
- 11. The method of claim 7 further including the step of expanding the priority signal bitwise prior to the step of generating the mask.
- 12. The method of claim 7 wherein the step of generating the thread selection output from the randomized mask further includes the steps of:
(a) inverting the mask to generate an inverted mask; and (b) comparing the randomized mask with the inverted mask.
- 13. The method of claim 12 further including the step of combining the result of the comparison between the randomized mask and the inverted mask.
- 14. The method of claim 13 further including the step of combining a toggle bit with the result of the comparison between the randomized mask and the inverted mask, the toggle bit changing logical level at a processor clock cycle frequency.
- 15. A circuit for producing a thread selection output for use in selecting an instruction for processing in a simultaneous multi-thread processor, the circuit including:
(a) mask logic for receiving a first priority signal and an additional priority signal and for generating a mask for the first priority signal, the first priority signal indicating a thread priority for a first instruction thread in the multi-thread processor and the additional priority signal indicating a thread priority for an additional instruction thread in the multi-thread processor; (b) a random number generator for producing a random number or pseudo random number suitable for comparison with the mask; (c) comparison logic coupled to the mask logic and the random number generator, the comparison logic for comparing the mask to the random number or pseudo random number to produce a randomized mask; and (d) combinational logic coupled to the comparison logic, the combinational logic for generating the thread selection output from the randomized mask.
- 16. The circuit of claim 15 wherein the mask logic includes a priority signal comparator for comparing the first priority signal with an inverted priority signal representing the inverted value of the additional priority signal.
- 17. The circuit of claim 15 wherein the mask logic includes a first expander for expanding the first priority signal to an expanded first priority signal and a second expander for expanding the additional priority signal to an expanded additional priority signal.
- 18. The circuit of claim 15 wherein the combinational logic includes:
(a) a mask inverter for generating an inverted mask; and (b) a mask comparator for comparing the randomized mask with the inverted mask to produce a comparison output.
- 19. The circuit of claim 18 wherein the combinational logic includes a combining AND device for performing a logical AND operation on bits of the comparison output.
- 20. The circuit of claim 19 further including a toggle bit generator for generating a toggle bit and appending the toggle bit to the comparison output, the toggle bit being included in the logical AND performed by the combining AND device.
- 21. A circuit for producing a thread selection output for use in selecting an instruction for processing in a simultaneous multi-thread processor, the circuit including:
(a) an interleave rule enforcement component for producing an interleave rule enforcement output; and (b) a randomization component for receiving the interleave rule enforcement output and producing a randomized thread selection output for controlling thread selection between a plurality of instruction threads in the simultaneous multi-thread processor.
RELATED APPLICATIONS
[0001] This application is related to application Ser. No. ______, entitled “APPARATUS AND METHOD FOR ADJUSTING INSTRUCTION THREAD PRIORITY IN A MULTI-THREAD PROCESSOR” and application Ser. No. ______, entitled “METHOD AND APPARATUS FOR SELECTING AN INSTRUCTION THREAD FOR PROCESSING IN A MULTI-THREAD PROCESSOR,” each filed simultaneously herewith. The entire content of each of these related applications is hereby incorporated by reference into the present application.