Digital processor with control means for the execution of nested loops
AssigneeOn Demand Microelectronics
InventorsRobert Klima, Alois Hahn
Life of this patent
Estimating the term…
Abstract
A method and apparatus to control execution of nested loops is disclosed. The method and apparatus stores the loop level of a current loop in execution and uses this loop level to manage a data set provided for each loop. The data set for each loop includes a start address, an end address, and a loop counter or a loop flag, respectively. The method and apparatus allows arbitrary nested loops to be controlled without increasing a complexity level of the circuit and allows additional loop control. The only precondition is that the loop end addresses are different.
Claims8
An electronic circuit to implement zero overhead loops for N nested loops in
- a processor, the circuit comprising:
- a program count register configured to store a program count, the program count being an address of an instruction to be fetched;
- a plurality of loop start registers configured to store loop start addresses of the N nested loops, the loop start addresses being addresses of a first of a plurality of instructions of the nested loops;
- a plurality of loop end registers configured to store loop end addresses of the N nested loops, the loop end addresses being addresses of a last of the plurality of instructions of the nested loops;
- and
- a loop level control logic configured to control and set a loop level, the loop level control logic including a loop level register configured to store a loop level.
A method of controlling N nested loops, the method comprising:
- storing a program count, the program count being an address of an instruction to be fetched next;
- storing a set of N loop start addresses, the loop start addresses being addresses of a first of the instructions of the N nested loops;
- storing a set of N loop end addresses, the loop end addresses being addresses of a last of the instructions of the N nested loops;
- storing a loop level, the loop level being a number of a current loop, the current loop being a most inner loop containing an instruction in execution;
- determining a current loop start address out of the set of N loop start addresses using the loop level;
- determining a current loop end address out of the set of N loop end addresses using the loop level;
- generating a next address by incrementing the program count;
- selecting a next value for the program count from a set of possible program count values;
- comparing the program count with the current loop end address;
- controlling and setting the loop level;
- and
- controlling and setting the program count multiplexer.
Dependencies are inferred from the claim text.