Decoding an instruction portion and forwarding part of the portion to a first destination, re-encoding a different part of the portion and forwarding to a second destination

In one embodiment, a processor receives coded instructions and converts the instructions to a second code prior to execution. The processor may be a digital signal processor. A decoder in the processor determines the destination of the instructions and performs decoding functions based on the destination.

TECHNICAL FIELD

This invention relates to digital signal processors, and more particularly to re-encoding instructions within a digital signal processor.

BACKGROUND

Digital signal processing is concerned with the representation of signals in digital form and the transformation or processing of such signal representation using numerical computation. Digital signal processing is a core technology for many of today's high technology products in fields such as wireless communications, networking, and multimedia. One reason for the prevalence of digital signal processing technology has been the development of low cost, powerful digital signal processors (DSPs) that provide engineers the reliable computing capability to implement these products cheaply and efficiently. Since the development of the first DSPs, DSP architecture and design have evolved to the point where even sophisticated real-time processing of video-rate sequences may be performed.

DSPs are often used for a variety of multimedia applications such as digital video, imaging, and audio. DSPs may manipulate the digital signals to create and open such multimedia files.

MPEG-1 (Motion Picture Expert Group), MPEG-2, MPEG-4 and H.263 are digital video compression standards and file formats. These standards achieve a high compression rate of the digital video signals by storing mostly changes from one video frame to another, instead of storing each entire frame. The video information may then be further compressed using a number of different techniques.

The DSP may be used to perform various operations on the video information during compression. These operations may include motion search and spatial interpolation algorithms. The primary intention is to measure distortion between blocks within adjacent frames. These operations are computationally intensive and may require high data throughput.

The MPEG family of standards is evolving to keep pace with the increasing bandwidth requirements of multimedia applications and files. Each new version of the standard presents more sophisticated algorithms that place even greater processing requirements on the DSPs used in MPEG compliant video processing equipment.

Video processing equipment manufacturers often rely on application-specific integrated circuits (ASICs) customized for video encoding under the MPEG and H.263 standards. However, ASICs are complex to design, costly to produce and less flexible in their application than general-purpose DSPs.

DETAILED DESCRIPTION

FIG. 1illustrates a mobile video device100including a processor according to an embodiment of the invention. The mobile video device100may be a hand-held device which displays video images produced from an encoded video signal received from an antenna105or a digital video storage medium120, e.g., a digital video disc (DVD) or a memory card. A processor110communicates with a cache memory115which may store instructions and data for the processor operations. The processor110may be a microprocessor, a digital signal processor (DSP), a microprocessor controlling a slave DSP, or a processor with an hybrid microprocessor/DSP architecture. For the purposes of this application, the processor110will be referred to hereinafter as a DSP110.

The DSP110may perform various operations on the encoded video signal, including, for example, analog-to-digital conversion, demodulation, filtering, data recovery, and decoding. The DSP110may decode the compressed digital video signal according to one of various digital video compression standards such as the MPEG-family of standards and the H.263 standard. The decoded video signal may then be input to a display driver130to produce the video image on a display125.

Hand-held devices generally have limited power supplies. Also, video decoding operations are computationally intensive. Accordingly, a processor for use in such a device is advantageously a relatively high speed, low power device.

The DSP110may have a deeply pipelined, load/store architecture. By employing pipelining, the performance of the DSP may be enhanced relative to a non-pipelined DSP. Instead of fetching a first instruction, executing the first instruction, and then fetching a second instruction, a pipelined DSP110fetches the second instruction concurrently with execution of the first instruction, thereby improving instruction throughput. Further, the clock cycle of a pipelined DSP may be shorter than that of a non-pipelined DSP, in which the instruction must be fetched and executed in the same clock cycle.

Such a DSP110may be used with video camcorders, teleconferencing, PC video cards, and High-Definition Television (HDTV). In addition, the DSP110may also be used in connection with other technologies utilizing digital signal processing such as voice processing used in mobile telephony, speech recognition, and other applications.

Turning now toFIG. 2, a block diagram of a signal processing system200including DSP110according to an embodiment is shown. One or more analog signals may be provided by an external source, e.g., antenna105, to a signal conditioner202. Signal conditioner202may perform certain preprocessing functions upon the analog signals. Exemplary preprocessing functions may include mixing several of the analog signals together, filtering, amplifying, etc. An analog-to-digital converter (ADC)204may be coupled to receive the preprocessed analog signals from signal conditioner202and to convert the preprocessed analog signals to digital signals consisting of samples, as described above. The samples may be taken according to a sampling rate determined by the nature of the analog signals received by signal conditioner202. The DSP110may be coupled to receive digital signals at the output of the ADC204. The DSP110may perform the desired signal transformation upon the received digital signals, producing one or more output digital signals. A digital-to-analog converter (DAC)206may be coupled to receive the output digital signals from the DSP110. The DAC206converts the output digital signals into output analog signals. The output analog signals may then be conveyed to another signal conditioner208. The signal conditioner208performs post-processing functions upon the output analog signals. Exemplary post-processing functions are similar to the preprocessing functions listed above. It is noted that various alternatives of the signal conditioners202and208, the ADC204, and the DAC206are well known. Any suitable arrangement of these devices may be coupled into a signal processing system200with the DSP110.

Turning next toFIG. 3, a signal processing system300according to another embodiment is shown. In this embodiment, a digital receiver302may be arranged to receive one or more digital signals and to convey the received digital signals to the DSP110. As with the embodiment shown inFIG. 2, DSP110may perform the desired signal transformation upon the received digital signals to produce one or more output digital signals. Coupled to receive the output digital signals is a digital signal transmitter304. In one exemplary application, the signal processing system300is a digital audio device in which the digital receiver302conveys to the DSP110digital signals indicative of data stored on the digital storage device120. The DSP110then processes the digital signals and conveys the resulting output digital signals to the digital transmitter304. The digital transmitter304then causes values of the output digital signals to be transmitted to the display driver130to produce a video image on the display125.

The pipeline illustrated inFIG. 4includes eight stages, which may include instruction fetch402–403, decode404, address calculation405, execution406–408, and write-back409stages. An instruction i may be fetched in one clock cycle and then operated on and executed in the pipeline in subsequent clock cycles concurrently with the fetching of new instructions, e.g., i+1 and i+2.

Pipelining may introduce additional coordination problems and hazards to processor performance. Jumps in the program flow may create empty slots, or “bubbles,” in the pipeline. Situations which cause a conditional branch to be taken or an exception or interrupt to be generated may alter the sequential flow of instructions. After such an occurrence, a new instruction may be fetched outside of the sequential program flow, making the remaining instructions in the pipeline irrelevant. Methods such as data forwarding, branch prediction, and associating valid bits with instruction addresses in the pipeline may be employed to deal with these complexities.

FIG. 5illustrates a procedure500used to handle an instruction in a processor according to one embodiment of the present invention. The procedure500illustrated inFIG. 5occurs in a single clock cycle. The procedure500illustrated inFIG. 5may be performed in any order, and the following description is simply one embodiment of implementing the procedure500. In other embodiments, blocks may be skipped or performed in a different order. For example, in an alternative embodiment, an instruction may be re-encoded immediately after determining that is to be sent to the system pipe.

In the illustrated embodiment, the procedure500begins at start block505. Proceeding to block510, the processor110receives an instruction during one of the instruction fetch stages of the pipeline as described above. In one embodiment of the invention, the instruction may be 16-bits, 32-bits, 64-bits in size, or may include multiple instructions contained within a single instruction block. For example, a 64-bit instruction block may include a 32-bit instruction and two 16-bit instructions.

Proceeding to block515, the instruction is transferred to the decoder and the destination(s) of the instruction is determined. The instruction is typically divided into a plurality of fields, with one of the fields including information on the destination(s) of the instruction. The instruction may be sent to a variety of functional units, including the execute unit, the data address generator (DAG), and the system pipe.

Proceeding to block520, the procedure500examines the destination(s) of the instruction to determine if the instruction is to be sent to the execute unit. The execute unit is able to interpret the instruction directly without any decoding by the decoder. The procedure500may also determine that only a portion of the instruction is to be sent to the execute unit. If all or part of the instruction is to be sent to the execute unit, the procedure500proceeds along the YES branch to block525. In block525, the relevant portion of the instruction as determined in block520is directly transferred to the execute unit, without any decoding by the decoder. However, the decoder may send information to the execute unit indicating an execute unit instruction is being delivered.

Returning to block520, if the instruction is not to be sent to the execute unit, or after transferring a portion of the instruction to the execution unit in block525, the procedure500proceeds along the NO branch to block530. In block530, the processor110may determine if the any portion of the instruction is to be sent to the data address generator (DAG). If the instructions are to be sent to the DAG, the procedure500proceeds along the YES branch to block535. In block535, the decoder decodes the instruction. The decoder may decode the entire instruction, or the decoder may decode only a portion of the instruction to be used.

Proceeding to block540, the decoded instructions are sent to the DAG. For example, the DAG includes registers which may be modified by the instructions. The decoder decodes the instructions and sends a signal to the DAG instructing the DAG how to modify the registers. Thus, the decoder may provide control signals to select registers and perform logical functions such as increment and/or decrement the selected registers in the DAG.

Returning to block535, if the instructions are not to be sent to the DAG, or after sending the decoded instructions to the DAG in block540, the procedure500proceeds along the NO branch to block545. In block545, the processor110may determine if the any portion of the instruction is to be sent to the system pipe. If the instructions are to be sent to the system pipe, the procedure500proceeds along the YES branch to block550. In block550, the decoded instructions are re-encoded into op-codes or some other type of codes. The op-codes may be specific to a particular bus system and may be defined by the processor110. The op-codes may represent decoded and re-encoded control fields. Of course, other types of signals other than op-codes may be created. Further, if only a portion of the instructions are needed, only these portions may be re-encoded.

Proceeding to block555, the re-encoded instructions (op-codes) are sent to the system pipe. The system pipe may interpret and decode the op-codes. By re-encoding the control fields, a processor110may operate using a proprietary set of codes regardless of the instructions received by the processor110. Re-encoding also allows the number of wires necessary on the processor110to be decreased. Reducing the number of wires required reduces the size and decreases the power requirement of the processor110. In this case, the decoder provides the translation between the code sets.

Returning to block545, if there are no portions of the instructions to transfer to the system pipe, or following the transfer of the codes in block555, the procedure proceeds to block560. In block560, the processor110determines if additional instructions are present. If there are additional instructions to be processed, the procedure500proceeds along the YES branch back to block510where the next instruction is received during an instruction fetch stage. If no additional instructions are present, the procedure500proceeds along the NO branch of block560to terminate at the end block565.

As stated above, the entire procedure500is performed in a single clock cycle. Additionally, a single instruction may be divided and portions of the instruction sent to a plurality of functional units. For example, a first portion of an instruction may be sent to the execute unit, a second portion of the instruction may be sent to the DAG, and a third portion of the instruction may be sent to the system pipe.

Numerous variations and modifications of the invention will become readily apparent to those skilled in the art. Accordingly, the invention may be embodied in other specific forms without departing from its spirit or essential characteristics.