This application claims the benefit of Taiwan Patent Application No. 93141219, filed on Dec. 29, 2004, which is hereby incorporated by reference for all purposes as if fully set forth herein.
1. Field of Invention
The invention relates to an encoding method of an instruction set, and in particular to an encoding method for a very long instruction word (VLIW) DSP processor.
2. Related Art
Current multimedia systems employ a microprocessor together with a digital signal processor and some hardware accelerators for signal processing. The microprocessor controls some programs, while the digital signal processor and hardware accelerators perform digital signal processing, which is more complicated. Although employing the hardware accelerators involves a more mature design process and lower cost, the importance of the hardware accelerators can not compete with the programmable digital signal processor under the rapid development of digital multimedia applications.
Conventional digital signal processors provide higher calculation capability than microprocessors. The single pipeline architecture is developed toward the superscalar architecture or very long instruction word (VLIW) architecture with the increasing need for calculation capability.
Under the prevalent trend of handset devices, the Digital signal processors not only provide high calculation capability, but also meet the need to reduce power consumption, which have both become keys to dominating the market. The superscalar architecture sorts the instructions when the program is executing, while the very long instruction word architecture sorts the instructions when the program is compiling. From the point of view of the architecture, the very long instruction word architecture is better at reducing power consumption than the superscalar architecture. However, NOP (No Operation) instructions caused by fixed length encoding and insufficient parallel degree of the instructions increase to a very large scale. This may also cause an insufficient memory usage rate of the VLIW architecture.
The prior art discloses an encoding method of variable length, as illustrated in
Another encoding method in which the length of each instruction is variable is also disclosed. The length is determined by the information carried in the instruction. However, the beginning of instruction alignment needs to be obtained first, and the complexity is increased when the length of the instruction is not fixed.
Therefore, another encoding method by way of HAT format is disclosed to solve this problem. Variable length is also employed in the instruction, which is divided into a first encoding portion (head) with fixed length and a second encoding portion (tail) with variable length. The length of the second encoding portion is recorded in the first encoding portion. Then each first encoding portion of each instruction is arranged from left to right, and each second encoding portion of each instruction is arranged from right to left, as illustrated in
Another encoding method adopts HAT format in VLIW architecture, in which two-layer HAT format is employed to reduce the size of the program code. The first layer uses HAT-format encoding, in which each instruction is encoded with variable length and head-tail for bundling the instructions that may execute in parallel in the instruction bundle having variable length. The instruction bundle is used as a basic unit in the second layer, in which a first encoding portion with fixed length and a second encoding portion are bundled as a super bundle by way of HAT format. The slots of NOP are categorized into several formats such that the length of the instruction is effectively compressed. However, some unused bits occur in each super bundle, and the size of the super bundle may increase response time when a branch occurs. Furthermore, the problem of the long critical path is not improved in this method. Another encoding method also adopts two-layer HAT format, in which related encoding information is included in the Head of the first layer such that the critical path is shortened. However, each super bundle still has the problem of usage rate. When the bandwidth provided by the instruction memory is insufficient, the branch instruction may be delayed.
Therefore, simplification of the instruction encoding and increase of the effective calculations provided by the instruction word has been the main consideration for high performance processors. Meanwhile, assigning an instruction prompt has also become an important research topic. However, the prior art does not provide an effective solution to the problem.
Accordingly, the invention is related to an encoding method for a very long instruction word digital signal processing processor that substantially obviates one or more of the problems of the related art.
According to the embodiment of the invention, the encoding method for a very long instruction word digital signal processing processor includes a instruction package CAP; a plurality of first encoding portions; and a plurality of second encoding portions; the first encoding portions and the second encoding portions are compiled from an instruction; the first encoding portions are arranged after the instruction package CAP in sequence; and the second encoding portions are arranged after the first encoding portions in sequence.
According to the embodiment of the invention, the decoding method for a very long instruction word digital signal processing processor includes the steps of compiling at least one instruction including a instruction package CAP, a plurality of first encoding portions, and a plurality of second encoding portions, wherein the first encoding portions and the second encoding portions are compiled from an instruction, the first encoding portions are arranged after the instruction package CAP in sequence, and the second encoding portions are arranged after the first encoding portions in sequence; decoding the instruction package CAP in one clock, assigning the plurality of the first encoding portions according to the decoded instruction package CAP, and generating Program Counter for the next clock; in another clock, decoding the assigned first encoding portions, and obtaining the length of information of the first encoding portions; and assigning the plurality of the second encoding portions according to the length information and decoding the second encoding portions.
According to the embodiment of the invention, the encoding method has the advantage of a better instruction memory usage rate, and prevents overload of instruction assignment and decoding.
The HAT format encoding method is not easy to expand, while the disclosed encoding method is back compatible by using CAP, which is appropriated encoded.
The encoding method for a very long instruction word digital signal processing processor employs two-layer HAT format encoding. Each instruction package is directly stored in the instruction memory in sequence such that spotty bits caused by the super package are prevented. Furthermore, the bandwidth corresponding to the super package is not necessary for the instruction memory.
In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the invention. It will be apparent, however, to one skilled in the art that the invention can be practiced without these specific details. In other instances, structures and devices are shown in block diagram form in order to avoid obscuring the invention.
The above and other objects, features and other advantages of the invention will be more clearly understood from the following detailed description when taken in conjunction with the accompanying drawings, in which:
Reference will now be made in greater detail to a preferred embodiment of the invention, an example of which is illustrated in the accompanying drawings. Wherever possible, the same reference numerals are used throughout the drawings and the description to refer to the same or like parts. Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment.
The disclosed encoding method compiles a single instruction INST with variable length as a first encoding portion HEAD and a second encoding portion TAIL. The length of the first encoding portion HEAD is fixed, while that of the second encoding portion TAIL is variable. The first encoding portion HEAD includes length information. The length unit of the second encoding portion TAIL is BYTE so that each instruction may align in the address by BYTE. Thus, the design of the instruction memory is simplified.
The very long instruction word architecture may perform multiple instructions simultaneously, so multiple instructions with variable lengths exist in each clock. Thus, assigning instructions in each clock is the key to affect the performance. For example, the instruction package CAP has the information of package category, composition of the first encoding portion HEAD, the total length of the second encoding portion TAIL, and hardware. The package of each clock may be continuously placed in the instruction memory. Therefore, the usage rate of the instruction memory is increased, and the calculation of the branch targets is simplified.
According to the principle of the invention, an encoding method is provided for the usage rate of the very long instruction word architecture and instruction assignment. Two-layer HAT format encoding is employed. Each instruction package is directly placed in the instruction memory in sequence such that spotty bits caused by the super package are prevented. Furthermore, the bandwidth corresponding to the super package is not necessary for the instruction memory.
The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.
Number | Date | Country | Kind |
---|---|---|---|
93141219 | Dec 2004 | TW | national |