主权项 |
1. A data processing method based on pipeline, comprising the following steps:
fetching an instruction at an instruction-fetch stage, and inputting a specific instruction into a decode stage, wherein said specific instruction indicating whether contents of a register in a specific register file are to be utilized as an index; at the decode stage, accessing contents of the register in the specific register file, utilizing the contents as said index for accessing the specific register file, and accessing the specific register file based on said index; and at an execution stage, receiving an access result of said decode stage, and implementing computations according to the access result of the decode stage, wherein said specific register file includes multiple general-purpose registers and said accessing the specific register file further comprises:
providing access to said multiple general-purpose registers using a first multiplexor;providing access to said multiple general-purpose registers using a second multiplexor; andproviding an output of said first multiplexor as a control input to said second multiplexor and as an input to a third multiplexor, wherein: the output of said first multiplexor and the output of said second multiplexor are provided to the third multiplexor simultaneously for selection; when said specific instruction does not indicate the contents of the register in the specific register file are to be utilized as the index, the third multiplexor selects to output to the execution stage the output of said first multiplexor; and when said specific instruction indicates the contents of the register in the specific register file are to be utilized as the index, the third multiplexor selects to output to the execution stage the output of said second multiplexor. |