WO2003081422A1 - Processeur d'operations, procede de construction, systeme de traitement d'operations et procede de traitement d'operations - Google Patents

Processeur d'operations, procede de construction, systeme de traitement d'operations et procede de traitement d'operations Download PDF

Info

Publication number
WO2003081422A1
WO2003081422A1 PCT/JP2003/003716 JP0303716W WO03081422A1 WO 2003081422 A1 WO2003081422 A1 WO 2003081422A1 JP 0303716 W JP0303716 W JP 0303716W WO 03081422 A1 WO03081422 A1 WO 03081422A1
Authority
WO
WIPO (PCT)
Prior art keywords
register
instruction
program
registers
arithmetic processing
Prior art date
Application number
PCT/JP2003/003716
Other languages
English (en)
French (fr)
Inventor
Tomohisa Shiga
Original Assignee
Sony Corporation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from JP2002088916A external-priority patent/JP2003288204A/ja
Priority claimed from JP2002195123A external-priority patent/JP3698125B2/ja
Application filed by Sony Corporation filed Critical Sony Corporation
Priority to EP03715417A priority Critical patent/EP1489493A1/en
Priority to KR10-2004-7015082A priority patent/KR20040097212A/ko
Priority to US10/508,802 priority patent/US7581083B2/en
Publication of WO2003081422A1 publication Critical patent/WO2003081422A1/ja
Priority to US11/821,447 priority patent/US20080046470A1/en
Priority to US11/821,424 priority patent/US20070250685A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/34Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30098Register arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/30156Special purpose encoding of instructions, e.g. Gray coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/3016Decoding the operand specifier, e.g. specifier format
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/3017Runtime instruction translation, e.g. macros
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/3017Runtime instruction translation, e.g. macros
    • G06F9/30178Runtime instruction translation, e.g. macros of compressed or encrypted instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/32Address formation of the next instruction, e.g. by incrementing the instruction counter
    • G06F9/322Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/34Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes
    • G06F9/35Indirect addressing

Definitions

  • the present invention relates to a central processing unit that performs various data processing based on a system program.
  • the present invention relates to a simple arithmetic processing device, a construction method thereof, an arithmetic processing system and an arithmetic processing method.
  • a register array for executing an operation instruction and an instruction execution control unit for controlling the operation unit are provided.
  • One register is selected based on the operation instruction, and the other is selected based on the value held by the register.
  • the area occupied by the substrate can be reduced as compared with the case of disposing them on a substrate.
  • an arithmetic processing unit that executes an arbitrary operation by designating a plurality of registers, obtains a compressed program created by a program creating system, decodes a register type, and based on the register type, By restoring the number of instruction bits that specify an instruction and by restoring a program having an instruction structure of a predetermined instruction length, it is possible to reduce the memory capacity of ROM and the like for storing program data, When a processor is constructed using PLDs consisting of logic elements and logic operation elements, the occupancy of memory cells that function as ROM can be reduced.
  • microprocessors including a central processing unit (CPU) have been increasingly used in various electronic devices such as mobile terminal devices, electronic cards, and information processing devices. If you try to access storage with this type of processor, A different access method is used depending on whether the is a register or an external memory.
  • the access destination is a register, for example, a copy register or a temporary register is arranged around an ALU (Arithmetic Logic Unit), and when performing arithmetic processing, data is copied to the copy register. The data after the operation processing is temporarily stored in a temporary register. This is because the ALU is suitable for register-to-register arithmetic processing.
  • the CPU When the access destination is an external memory, for example, when writing information to the address of the external memory indicated by the register number, the CPU writes a write address specifying the storage address to the external memory and a write signal. Is output. When reading information from the address of the external memory indicated by the register number, the CPU outputs a read address designating the storage address and a read signal to the external memory.
  • the CPU when storing information at the address of the external memory indicated by the register number or reading information from the address of the external memory indicated by the register number, the CPU stores the information in the storage address (write address or read address) of the external memory. Address).
  • Such processing is often called register-relative memory addressing. This is because the external memory is usually implemented on a different device than the processor.
  • this type of processor has a read-only memory (hereinafter referred to as ROM) for storing the instruction execution program in addition to the instruction execution operation unit, and many registers used for the instruction execution operation processing.
  • ROM read-only memory
  • an instruction for performing an operation has a one-to-one correspondence between the operation and an instruction for performing the operation.
  • both high-use registers and low-use registers often use programs created with uniform-length instructions with the same number of instruction bits to specify the registers. . This allows fixed-length instructions to be stored in the ROM and used.
  • the development of semiconductor integrated circuit technology has made it possible to implement a large number of registers in a processor (hereinafter also referred to as an arithmetic processing unit).
  • the number of instruction bits for specifying the register is required more and more. For example, 1 0 2 If four registers are implemented, ten bits are required as instruction bits to specify one of the 124 registers.
  • the access frequency to all registers is not uniform, and the access frequency is uneven. The number of frequently accessed registers is generally determined by the compiler.
  • the processing speed is reduced for the following reasons.
  • an instruction execution operation unit is arranged on the same semiconductor chip.
  • a method of arranging a register array, a ROM, and the like in a peripheral portion thereof can be considered.
  • the memory capacity of the ROM that stores these programs will be large. Therefore, the memory cells are occupied by the ROM construction, and it becomes difficult to allocate many memory cells to the registers. Disclosure of the invention
  • a first arithmetic processing device is a device that performs arithmetic processing based on an arbitrary arithmetic program.
  • the arithmetic processing unit includes: a register array having a plurality of registers for holding an arbitrary value based on a write address and a write control signal and outputting the value based on a read address; An operation unit that operates on the value read from the operation unit; an instruction decoding unit that decodes an operation instruction from an operation program for operating the operation unit; and an execution unit that executes the operation instruction decoded by the instruction decoding unit.
  • An instruction execution control unit for controlling the register array and the operation unit is provided. The instruction execution control unit selects one register based on the operation instruction, and executes a register relative register addressing process of selecting another register based on a value held by the selected register.
  • the instruction decoding unit when performing arithmetic processing based on an arbitrary arithmetic program, decodes the arithmetic instruction from the arithmetic program for operating the arithmetic unit.
  • the instruction execution control unit controls the register array and the operation unit to execute the operation instruction decoded by the instruction decoding unit. Based on this premise, the instruction execution control unit selects one register based on the operation instruction, and selects another register according to the value held by the selected register. Is performed. Individual registers in the register array The register holds an arbitrary value based on the write address and the write control signal designated by the register relative register addressing process, and outputs the value based on the read address.
  • the operation unit operates on the value read from the register array.
  • the register array can be handled as a memory (RAM) that can write and read data at any time.
  • RAM memory
  • the register relative memory that specifies the storage address of the external memory can be used. It no longer depends on addressing processing. Since the functions of RAM and ROM can be incorporated into a conventional CPU, high-speed arithmetic processing can be performed, and compared to the case where the CPU, RAM, ROM, etc. are individually arranged on a board. Thus, the area occupied by the substrate can be reduced. It is possible to reduce the size of an application device to which the arithmetic processing device is applied.
  • the register processing unit and the read-only memory are configured by memory cells on the same semiconductor chip, and the arithmetic unit, the instruction decoding unit, and the instruction execution control unit are configured by the arithmetic and logic operation elements. 'Configurable by logic device.
  • the method for constructing each arithmetic processing device is a method for constructing a device that performs arithmetic processing based on an arbitrary arithmetic program.
  • a plurality of memory cells and an arithmetic and logic element are formed in advance on the same semiconductor chip, a memory cell is combined to define a register array and a read-only memory, and an arithmetic unit is combined with the arithmetic and logic element.
  • An instruction decoding section and an instruction execution control section, and thereafter, a register array, a read-only memory, an arithmetic section, an instruction decoding section and an instruction execution control section are connected based on preset wiring information and read-only. Arbitrary arithmetic programs are written in the memory.
  • a register array, a read-only memory, an arithmetic unit, an instruction decoding unit, and a power supply are turned on based on wiring information read from a nonvolatile storage unit.
  • the instruction execution control unit is connected. Therefore, the instruction execution control unit selects one register based on an operation instruction, and performs a register-relative register addressing process of selecting another register based on the value held by this register.
  • the processing unit is turned on, Can be built.
  • an arithmetic processing unit incorporating the functions of RAM and ROM in a conventional CPU, to execute high-speed arithmetic processing, and to integrate the CPU, RAM, ROM, etc.
  • the area occupied by the substrate can be reduced as compared with the case where the device is arranged on the substrate. It is possible to reduce the size of an application device to which the arithmetic processing device is applied.
  • a first arithmetic processing method is a method for performing arbitrary arithmetic processing based on an arithmetic program.
  • this operation processing method an arbitrary value is held based on a write address and a write control signal, and a plurality of registers for outputting the value based on a read address are prepared, and then, an operation instruction is decoded from an operation program. Then, one register is selected based on the operation instruction, a register-relative register addressing process for selecting another register based on a value held by the selected register is executed, and based on the operation instruction. Then, another register is selected, and the value held by the selected other register and the value of the register selected by the register relative register addressing processing are calculated.
  • a plurality of registers when performing arbitrary arithmetic processing based on an arithmetic program, a plurality of registers can be handled as a memory in which data can be written and read at any time. It does not depend on register relative memory addressing processing as compared with the arithmetic processing method combining the central processing unit and external memory. This makes it possible to execute high-speed arithmetic processing compared to the conventional method.
  • a second arithmetic processing device is a device that performs an arithmetic process based on an arithmetic program that executes a register relative register addressing process, and includes a plurality of registers and a frequency of using the registers.
  • a storage unit that stores a compression program having a different instruction length, in which the number of instruction bits designating the register is compressed in advance and a register type is described in the instruction structure of the program;
  • An instruction decoding unit that reads out and decodes the register type, and restores the number of instruction bits for designating a register based on the register type; and an instruction decoding unit that restores a predetermined length of the instruction by the instruction decoding unit.
  • An instruction execution operation unit for executing an arbitrary operation by designating a register.
  • the number of instruction bits for designating the register is compressed in advance based on the frequency of use of the register, and the instruction type in which the register type is described in the instruction structure of the program is used.
  • the storage unit stores a compression program for designating the register from among a plurality of registers.
  • the instruction decoding unit reads the compressed program from this storage unit, decodes the register type, and restores the number of instruction bits for designating the register based on the register type.
  • the instruction execution operation unit performs an arbitrary operation by designating a register based on a program having a predetermined instruction length restored by the instruction decoding unit. Therefore, a compressed program with an instruction length that is variable according to the frequency of use of the register is stored in the storage unit, and the frequently accessed register is set with a short-length instruction, and the compressed program data is stored in the storage unit. Therefore, the memory capacity can be reduced. This makes it possible to reduce the occupancy of memory cells that function as ROMs when building a processor with PLDs consisting of memory cells and logic operation elements, and to allocate more memory cells to registers. Can be.
  • a second arithmetic processing method is a method for performing arithmetic processing based on an arithmetic program for executing register relative register addressing processing.
  • this arithmetic processing method the number of instruction bits for designating a register is compressed in advance based on the frequency of use of the register, and the register type is described in the instruction structure of the program.
  • the program is stored, the compressed program is read, the register type is decoded, and the number of instruction bits for designating the register is restored based on the register type.
  • An arbitrary operation is executed by designating a register based on an instruction.
  • the second arithmetic processing method when performing arithmetic processing based on an arithmetic program that executes register-relative register addressing processing, a compression program with an instruction length that is variable according to the frequency of use of registers is used. Since the compressed program data in which short-length instructions are set in frequently accessed registers can be stored in the memory area, the memory capacity can be reduced. This This makes it possible to reduce the occupancy of memory cells that function as ROM when constructing a processor with PLDs consisting of memory cells and logical operation elements, and to allocate more memory cells to registers. it can.
  • An arithmetic processing system includes, on the one hand, a program creating device that edits an instruction for executing a register relative register addressing operation based on a predetermined programming language to create a program, and, on the other hand, An arithmetic processing system comprising: an arithmetic processing device that executes a register relative register addressing operation by using a plurality of registers.
  • This program creation device compresses the number of instruction bits for designating the register based on the frequency of use of the register, and describes the type of register in the instruction structure of the program to execute a compressed program having a different instruction length. create.
  • This arithmetic processing device obtains the compressed program created by the program creating device, decodes the register type, restores V based on the register type, and restores the number of instruction bits designating the register based on the register type.
  • An arbitrary operation is executed by specifying a plurality of registers based on an instruction.
  • a program is created by editing instructions for executing a register relative register addressing operation based on a predetermined programming language, and, on the other hand, the program and a plurality of registers are prepared.
  • the program creation device compresses the number of instruction bits specifying the register based on the frequency of use of the register, and executes the instruction structure of the program.
  • a compression program with a different instruction length is created by describing the register type in the register.
  • the arithmetic processing device obtains the compressed program created by the program creating device, decodes the register type, restores the number of instruction bits designating the register based on the register type, and decodes the instruction based on the instruction of a predetermined length. Then, an arbitrary operation is executed by specifying a plurality of registers. Therefore, in a program creation system, the length of an instruction can be varied according to the frequency of use of the register, so that an instruction with a short length can be set in a frequently accessed register. As a result, the program execution system can set a compressed instruction in the ROM or the like, and reduce the memory capacity of the ROM or the like for storing program data. Also, when constructing a processor with a PLD consisting of memory cells and logic operation elements, RO The occupancy of the memory cells functioning as M can be reduced, and more memory cells can be allocated to registers.
  • a program creation system edits an instruction for executing a register relative register addressing operation based on a predetermined program language to create a program
  • the program execution system This is an operation processing method of executing a register relative register addressing operation using the program and a plurality of registers.
  • the program creation system the number of instruction bits that specify the register is compressed based on the frequency of use of the register, and the type of register is described in the instruction structure of the program to create a compressed program with different instruction lengths.
  • the compressed program created by the program creation system is acquired, the register type is decoded, and the number of instruction bits for designating the register is restored based on the decoded register type.
  • a plurality of registers are designated and an arbitrary operation is executed based on the instruction of a predetermined length restored in step (1).
  • a program is created in a program creating system by editing instructions for executing a register relative register addressing operation based on a predetermined programming language, and the program is created in a program executing system.
  • the program creation system can change the instruction length according to the register usage frequency. Short length instructions can be set. Therefore, in the program execution system, compressed instructions can be set in the ROM and the like, and the memory capacity of the ROM and the like for storing program data can be reduced.
  • a processor is constructed from PLDs consisting of memory cells and logical operation elements, the occupancy of memory cells functioning as ROM can be reduced, and more memory cells can be allocated to registers.
  • FIG. 1 is a block diagram showing a configuration example of an arithmetic processing unit 100 as a first embodiment according to the present invention.
  • FIG. 2 is a block diagram showing an example of the internal configuration of the register array 11.
  • 3A to 3E show a format and the like showing an example of the structure of an instruction handled by the arithmetic processing unit 100.
  • FIG. Figure 3A shows an example of the structure of the 1 oad, add, and cmp instructions
  • Figure 3B shows an example of the structure of the jump instruction
  • Figure 3C shows an example of the structure of the instruction
  • Figure 3D shows an example of the contents of the access method
  • Figure 3E shows the state of the flag. This is a content example.
  • FIG. 4 is a table showing an example of an operation instruction according to the operation program of the ROM cell 14.
  • FIG. 5 is a diagram illustrating a state example of the registers r0 to r12 and the like.
  • FIG. 6 is a flowchart illustrating an operation example of the arithmetic processing device 100.
  • FIG. 7 is a plan view of a semiconductor chip showing a configuration example of an arithmetic processing device 100 as a second embodiment according to the present invention.
  • FIG. 8 is a plan view showing an example of a layout of the arithmetic processing unit 100.
  • FIG. 9 is a diagram illustrating an example of a wiring configuration of the arithmetic processing device 100.
  • FIG. 10 is a table showing an example of wiring information stored in the flash memory 70.
  • FIG. 11 is a diagram illustrating a connection example in the arithmetic processing device 100.
  • FIG. 12 is a circuit connection diagram showing an example of a circuit structure of the arithmetic processing device 100.
  • FIG. 13 is a block diagram showing a configuration example of an arithmetic processing system 10 as a third embodiment according to the present invention.
  • FIG. 14 is a flowchart showing a processing example in the arithmetic processing system 10.
  • FIG. 15 is a pack diagram showing a configuration example of a microprocessor 101 as a fourth embodiment according to the present invention.
  • FIG. 16 is a block diagram showing an example of the internal configuration of the register array 11 ′.
  • FIGS. 17 to 17E show a format showing an example of the structure of an instruction handled by the microprocessor 101.
  • FIG. FIG. 17 shows an example of the structure of the 1 0 & (1, add, cmp instruction according to instruction form #? 1
  • FIG. 17B shows an example of the structure of the 1 oad, add, cmp instruction according to instruction form #F 2
  • FIG. I s a structural example of the 1 oad, add, cmp instruction according to instruction form # F3
  • Fig. 17D is a structural example of the 1 oad, add, cmp instruction according to instruction form # F4
  • Fig. 17E is an instruction form # F 5 shows a structural example of a jump instruction according to 5.
  • FIG. 18 A is an example of instruction structure
  • Figure 18B is an example of contents of access methods # 1 and # 2
  • Figure 18C is an example of contents of register types 1 and 2
  • Figure 18D is an example of contents of flag status. Each is shown.
  • FIG. 19 is a table showing an example of program creation in the program creation system I.
  • FIG. 20 is a flowchart (main routine) showing a compilation example in the program creation device 200.
  • FIG. 21 is a flowchart (subroutine) showing an example of assignment and operation processing in the compiler.
  • FIG. 22 is a table showing examples of operation instructions according to the restored operation program.
  • FIG. 23 is a diagram showing an example of the state of registers such as r 0, r 1,..., R 32, r 33, r 34, and r 35.
  • FIG. 24 is a diagram illustrating an example of data storage in the external memory 2.
  • FIG. 25 is a flowchart showing an operation example of the microprocessor 101.
  • FIGS. 26A and 26B are flowcharts showing a processing example in the instruction bit restoration decoder 13.
  • the present invention solves the conventional problem.
  • the functions of the CPU, RAM, ROM, etc. are integrated into one chip, the aggregate of registers can be written and read at any time.
  • Processor which can operate like a simple memory, and can reduce the occupied area of the board as compared with a case where these functional components are individually arranged on the board, a construction method thereof, an arithmetic processing system, and an arithmetic processing apparatus The purpose is to provide a processing method.
  • An object of the present invention is to provide an arithmetic processing device capable of reducing the memory capacity of a ROM or the like, a method of constructing the same, an arithmetic processing system, and an arithmetic processing method.
  • FIG. 1 is a block diagram showing a configuration example of an arithmetic processing unit 100 as a first embodiment according to the present invention.
  • a register array for executing an operation instruction and an instruction execution control unit for controlling an operation unit are provided.
  • One register is selected based on the operation instruction, and another is selected based on a value held by the register.
  • the board occupied area can be reduced as compared with the case where OMs and the like are individually arranged on the board.
  • the arithmetic processing device 100 shown in FIG. 1 is a processor suitable for application to a programmable one-chip microcomputer or the like, and performs arithmetic processing based on an arbitrary arithmetic program (first example). Arithmetic processing unit).
  • the arithmetic processing unit 100 constitutes a programmable logic device, and connects memory cells and arithmetic logic operation elements formed on the same semiconductor chip based on wiring information, and uses a plurality of memory cells.
  • a register array 11 and a ROM cell 14 are configured, and an ALU 12, a decoder 13 and an instruction execution control unit 50 are configured by a plurality of arithmetic logic elements.
  • the arithmetic processing unit 100 is connected to an external system bus or the like via the interface 60.
  • the arithmetic processing unit 100 has a register array 11.
  • the register array 11 has a plurality of registers. Each register holds an arbitrary value based on the write address Aw and the write control signal Sw, and receives a value based on the read address Ar. It is designed to output values such as the number X and the addend Y.
  • the register array 11 is provided with, for example, 8192 registers X32bit.
  • Arithmetic and Logic Unit (hereinafter, referred to as ALU) 12 as an example of an operation unit is connected to the register array 11 through a data signal line L 20.
  • the value of X, Y, etc. read from the register specified in L1 It is made to operate.
  • the value of the operation result is Z.
  • the operation types are addition, multiplication, subtraction, division, and the like.
  • the operation type is set based on the ALU control signal S35 output from the instruction execution control unit 50.
  • latch circuits 58, 511, selectors 56, 57, 59 and the like are connected to the data signal line L20.
  • DATA, the augend X value, the addend Y value, etc. are transmitted to the data signal line L20.
  • the arithmetic processing unit 100 includes an instruction decoding unit (hereinafter, referred to as a decoder) 13 to operate the ALU 12.
  • a read-only memory (ROM cell) 14 is connected to the decoder 13, and an arithmetic program AP required for the arithmetic operation of the ALU 12 is stored in a machine language instruction (Instruction).
  • the ROM cell 14 outputs the operation program AP based on the count output signal S5 from the program counter 54.
  • ROM cell 14 is also implemented inside the processor.
  • the decoder 13 decodes an operation instruction from an operation program AP prepared in advance.
  • the decoder 13 decodes a machine language command read from the ROM cell 14 to generate a command control signal S4, a command signal S9, and each argument signal S10.
  • the command signal S9 includes a 1 o a d instruction, an a d d instruction, a cmp instruction, and a jump instruction.
  • Each argument signal S10 has a flag state (flag state) such as access method # 1, access method # 2, register number rO, r1,.
  • the instruction control signal S4 is output to the instruction reading state machine 52.
  • the operation program AP includes an operation instruction for executing a register relative register addressing process.
  • Register relative register addressing refers to the process of selecting one register based on an operation instruction and selecting another register based on the value held by the selected register. This process is performed by access method # 1.
  • the instruction execution control unit 50 is connected to the decoder 13 and controls the register array 11 and the ALU 12 to execute the operation instruction decoded by the decoder 13.
  • the instruction execution control unit 50 includes an execution state machine 51, an instruction read state machine 52, a selector 53, a program counter (PC) 54, a +1 incrementer 55, a first selector 56, a second selector 57, and an input selector 5 9, Latch circuit 58, 5 10, 5 11 A register addressing process is executed.
  • the instruction reading state machine 52 controls the program counter 54 and the execution state machine 51 based on the instruction control signal S4 output from the decoder 13. For example, the machine 52 outputs the instruction signal S 9 and the respective argument signals S 10 from the decoder 13 to the execution state machine 51 and outputs the instruction execution start signal S 29.
  • selectors 56, 57, 59, and latch circuits 58, 51 0, 51 1 are connected to the execution state machine 51.
  • the output of the selector 56 is connected to the register array 11 via the read address line L14, and its input is connected to the data signal line L20 and the address signal line L33, respectively. This is for selecting either the read address Ar or the read execution address Ar.
  • the output of the selector 57 is connected to the register array 11 via the write address line L13, and its input is connected to the data signal line L20 and the address signal line L34, respectively. This is for selecting either the write address Aw or the write execution address Aw.
  • the machine 51 starts executing the instruction based on the instruction execution start signal S29.
  • a write control signal Sw is output to the register array 11, and a selector control signal S 24 is output to the selector 59.
  • the selection control signal S32 is output to the selector 56, and the read address Ar is output.
  • the latch control signal S34 is output to the latch circuit 58, and the latch control signal S38 is output to the latch circuit 50.
  • An external control signal S16 is output outside the processor.
  • a selector 53 is connected to the execution state machine 51 and the instruction reading state machine 52, and either the increment output signal S7 or the branch control signal S27 based on the selection control signal S28. One is selected, and this is output to the program counter 54 as a selector output.
  • the selection control signal S 28 is supplied from the execution state machine 51.
  • the increment output signal S 7 is output from the incrementer 55 to the selector 53.
  • the program counter 54 reads the calculation program AP from the ROM cell 14 based on the count control signal S30. The location to read is specified.
  • the +1 incrementer 55 increments the count output signal S5 of the program counter 54 by "+ lj".
  • the power control signal S30 is supplied from the instruction decoding state machine 52.
  • the selector 56 connected to the execution state machine 51 selects either the read execution address Ar for selecting the register of — or the read address Ar for selecting the register again. It is made to do.
  • the selector 56 selects one of the addresses according to the selection control signal S32 from the execution state machine 51.
  • the read execution address Ar is output from the execution state machine 51 to the selector 57.
  • the read address Ar is output from the register array 11.
  • a selector 57 is connected to the execution state machine 51 in addition to the selector 56, and either the write execution address Aw for selecting one register or the write address Aw for selecting the register again is selected. One is selected.
  • the selector 57 selects one of the addresses according to the selection control signal S31 from the execution state machine 51.
  • the write execution address Aw is output from the execution state machine 51 to the selector 57.
  • the write address Aw is output from the register array 11.
  • the selector 59 is connected to the data bus 19 A, the register array 11 and the ALU 12, and the data (DATA) fetched from the data bus 19 A and the operand X value output from the register array 11 are connected.
  • the input control is performed on either the (addend Y value) or the operation result value Z output from the ALU 12 based on the selection control signal S 24.
  • the latch circuit 58 is connected between the read port of the register array 11 and the ALU 12 and latches the output value X of the register ri based on the latch control signal S34.
  • the latch circuit 510 is connected to the comparison output section and the like of the ALU 12 and latches the match detection signal S22 based on the latch control signal S38 to generate a flag condition signal S2. It is made to output 3.
  • the latch circuit 511 is connected between the read port of the register array 11 and the address bus 19B, and latches an external address (address) based on the latch control signal S17. .
  • the execution state machine 51 outputs a branch control signal S 27 indicating the address of the pump destination to the selector 53.
  • the selector 53 selects the branch control signal S27 based on the selection control signal S28, and writes the branch control signal S27 to the program counter 54.
  • a control path 19C is connected to the execution state machine 51, so that an external control signal S16 is output to the outside. This is for controlling external peripheral devices.
  • FIG. 2 is a block diagram showing an example of the internal configuration of the register array 11.
  • Write port 15 is connected.
  • the 1 bit register is composed of a D-type flip-flop circuit.
  • the write port 15 is connected to the selector 59 shown in FIG. 1. Based on the write control signal Sw and the write address Aw, the data (DATA) fetched from the data path 19A and output from the register array 11 are output.
  • Either the augend X value (addend Y value) or the operation result value Z output from the ALU 12 is written to the registers r0 to rn.
  • the write port 15 is connected to the selector 57 shown in FIG. 1 via a write address line L13. This is to supply the write execution address Aw or the write address Aw.
  • a read port 16 is connected to the output of each of the registers r0 to rn.
  • the read port 16 is connected to the ALU 12, the latch circuits 58, 51 1, the selectors 56, 57, 59, etc. shown in FIG. 1 through the data signal line L20, and is designated based on the read address Ar.
  • Data (DATA) is read from register ri.
  • the read port 16 is connected to the selector 56 shown in FIG. 1 via a read address line L14. This is for supplying the read execution address Ar or the read address Ar. It is connected to the selector 57 shown in FIG. 1 via the write address line L13. This is to supply the write execution address Aw or the write address Aw.
  • the instruction has a fixed length of 32 bits, and is roughly divided into a 1 oad instruction, an add instruction, a cmp instruction, and the like; Handled by instructions.
  • the first two bits indicate the type of instruction.
  • the code is a transfer instruction with a code “0” indicating 1 oad, an addition instruction with a code “1”, and a comparison instruction with a code “2” indicating cmp.
  • Code “3” indicates a branch instruction by jump.
  • the cmp instruction if the comparison results are the same, zero flag is set to 1 based on the flag state signal S23 of the latch circuit 5110 shown in FIG. 1; otherwise, 0 is set. Is set.
  • the access method # 1 is described in two bits following the instruction shown in FIG. 3A, and the access method # 2 is described in 2bit following the instruction.
  • Operand is represented by access method # 1, register number 1 on the left, and access method # 2, register number 2 on the right. That is, access method # 1 indicates an access method of register r i indicated by register number 1, and access method # 2 indicates an access method of register r i indicated by register number 2.
  • Access method # 1 and access method # 2 correspond to register number No. 1 and register number No. 2, respectively, and processing is performed between them.
  • FIG. 3D the code “0” indicates that the value of the register ri indicated by the register number is used directly in “register direct”.
  • Code “1” indicates that the register value indicated by the register number is interpreted again as the register number in the "register relative register”, and the register value indicated by the register number is used.
  • the code “2” indicates that the register value indicated by the register number in “Register relative external” is treated as an external address, and access to the outside of the arithmetic processing unit 100 is made.
  • Code “3” is unused.
  • Access method # 1 and access method # 2 correspond to register number 1 and register number 2, respectively, and processing is performed between them. For example, register number 1 indicates a register ri holding an augend, and register number 2 indicates a register ri holding an addend.
  • the instruction is described in the first two bits, and the flag condition is described in the subsequent two bits.
  • the next 28 bits describe the jump address.
  • the flag state is a condition for determining whether to shift the instruction execution control as shown in Fig. 3E. Code “0” always transfers control with “unconditional”. Code “1” transfers control when “zero flagj” and the zero flag is “1". The code “2” is "non-zero flagj, and the control is transferred when the zero flag is” 0 ". Code “3” is unused.
  • FIG. 4 is a table showing an example of an operation instruction according to the operation program AP of the ROM cell 14.
  • the operation instructions (Instruction) # 11 to # I4 shown in FIG. 4 are described in the operation program AP of the ROM cell 14.
  • the operation instruction #I 1 shown in FIG. 4 is a d d represented by 5001400 Bh in machine language in the instruction structure shown in FIG. 3A.
  • the operation instruction #I 2 is addr 1 0, r 11 1 represented by 4001400 Bh in a machine language.
  • the value of the register r 11 is added to the value of the register r 10 and the operation result is stored in the register r 10 This is the content to be written back.
  • Arithmetic instruction # I 3 is cmp r 10, rl 2 represented by the machine language 80 0 1400 Ch, compares the contents of register r 10 with the contents of register r 12, and zeros if the values are the same Flag is set to “1”, and if they are different, it is set to “0”.
  • Instruction # 14 is a jump nz, LOOP represented by E 000000 Oh in machine language. When the zero flag is “0”, the control is transferred to the label indicated by LOOP.
  • register states of the register array 11 shown in FIG. The initial values of r0 to r10 are all “0", the initial value of register 11 is "1", and the initial value of register r12 is "1 0".
  • the value of the register r10 shown in FIG. 5 is "0", so that the register r0 is selected.
  • the value “0” of the register r 0 is read out to the read port 16, and then the value “1 J” of the register r 11 is read out to the read port 16, and these values are added.
  • the operation result "1” is stored in the register rO.
  • the value of the register r O is increased by “1”.
  • the addition process is repeated up to 10 times, which is the value of the register r12.
  • FIG. 6 is a flowchart showing an operation example of the arithmetic processing unit 100.
  • the arithmetic processing device 100 stores an arbitrary value based on the write address Aw and the write control signal Sw. It is assumed that the register array 11 that holds and outputs the value based on the read address Ar is prepared in advance. Regarding the register state of the register array 11, as shown in FIG. 5, for example, the initial values of the 13 registers r 0 to r 10 are all “0”, and the initial state of the register r 11 is The value is “1”, and the initial value of the register r 12 is “10”.
  • the execution state machine 51 outputs the write address Aw to the address signal line L34, and the selector 57 selects the registers r10 and r1 based on the selection control signal S31. By selecting 1 and register r12, their initial values "0", “1", and "10" are set.
  • step A1 of the flowchart shown in FIG. 6 first, the decoder 13 receives the operation program (machine language instruction) AP from the ROM cell 14 and decodes the operation program AP to execute the operation instruction. # I1 to # I4 are detected. At this time, in the decoder 13, the operation instruction #I 1 related to add [r 1 0], r 11 1 indicated by the machine language 504 0 Bh described in FIG.
  • Operation instruction related to addrl O r 11 1 represented by B h # I 2, c mp r 1 0, r 1 2 represented by 800 0 1 4 0 0 Ch in machine language
  • the operation instructions # I3 related to jump nz and LOOP represented by E 0 0 0 0 0 Oh in machine language are detected, and these operation instructions # I1 ⁇ #
  • An instruction control signal S 4 an instruction signal S 9, and respective argument signals S 10 are generated from the I 4 force, and these signals S 9 and S 10 are output to the execution state machine 51.
  • the instruction signal S9 includes a load instruction, an add instruction, a cp instruction, and a jump instruction.
  • Each argument signal S10 includes access method # 1, access method # 2, register numbers r0, r1,... ', A flag condition, a jump address, and the like.
  • the instruction control signal S 4 is output from the decoder 13 to the instruction reading state machine 52.
  • step A2 the execution state machine 51 receives the operation instruction # I1 under the instruction read control of the instruction read state machine 52, and receives the add [rl] indicated by 500 0 140 0 Bh. O], selects one register r 10 based on r 11.
  • the register number "1 0" is output to the address signal line L33.
  • the selector 56 selects the address signal line L33.
  • the register number “1 0” is output to the read address line L 14.
  • This value “1 0” is used as the address Ar for reading out 10 from the register with the register number 10 in the register array 11.
  • the register r10 is selected.
  • the value of register r10 is "0".
  • step A3 the register relative register addressing processing is executed by the value “0” held in the register r10.
  • the value “0” of the register r 10 is output from the read port 16 to the data signal line L 20.
  • the execution state machine 51 selects the data signal line L 20 based on the selection control signal S 32.
  • the selector 56 outputs the value “0” of the register r 10 to the read address line L 14. In the register array 11, the register r0 is selected.
  • step A4 to select another register r11 based on the operation instruction # I1.
  • the execution state machine 51 outputs the selection control signal S32 to the selector 56 so that the selector 56 selects the read execution address Ar.
  • the value “1 1” is output to the address signal line L33 as the read execution address Ar.
  • the value “1 1 J” is used as an address for reading out the register r 11 of the register number “1 1” in the register array 11.
  • the value of register r11 is "1". As a result, the register r 11 is selected based on the read address Ar.
  • the read value 16 is outputted from the read port 16 as the Y value minus 1 which is the output value of the data signal line L20 register r11.
  • the Y value of the register r 11 output to the data signal line L 20 ⁇ 1 and the X value of the latch circuit 58 ⁇ 0 output to the ALU 12 are input.
  • the ALU 12 adds the X value of the register r 0 selected by the register addressing processing to “0”.
  • the operation instruction signal S35 indicating the addition instruction is input to the ALU12.
  • step A6 the operation result value Z is selected by the selector 59 based on the operation instruction # I2 represented by 4001400Bh in machine language.
  • the selector 59 is set to select the operation result value Z by the selection control signal S24.
  • the operation result value Z is input to the register array 11.
  • the operation result value Z is stored in the register r0 specified by the register relative register dressing processing based on the write address Aw and the write control signal Sw.
  • the execution state machine 51 sets the value as the write execution address Aw to the address signal line L 33. Outputs “1 0”.
  • the selection control signal S32 is output to the selector 56 for reading, and the address signal line L33 is selected.
  • the selection control signal S 31 is output to the write selector 57 to output the data.
  • the signal line 20 is selected.
  • a value “0” for selecting the register r 0 from the read port 16 of the register array 11 through the selector 57 is input to the register array 11 as the write address Aw.
  • the write address Aw and the content to be written are input to the register array 11.
  • the execution state machine 51 uses the write signal SW to actually instruct the writing of the value. In this way, it is possible to calculate add [r10] and r11 of the operation instruction # I1.
  • step A7 it is determined in step A7 whether the value indicated by the register r12 has reached 10 times.
  • the value of the zero flag held in the latch circuit 501 is referred to based on the operation instruction # I3.
  • the value of the zero flag is compared with the value of register r1 0 and the value “1 0” of register r12, and if both values are different, the value of zero flag is “0” is set. If both values match, “1” is set to zero flag. Therefore, if the value indicated by the register r 1 2 has not reached 10 times, “0” is set to the zero flag, and the process returns to step A 5 based on the operation instruction # I 4 (by LOOP).
  • the arithmetic instruction decoded by the decoder 13 in step A1 of the flowchart shown in FIG. #I 1 to #I 4 are output to the execution state machine 51 as an instruction signal S 9 and respective argument signals S 10.
  • one register r10 is selected in step A2 based on the operation instructions # I1 to # I4.
  • a register addressing process is performed. If another register r 0 is selected in step A 4, the X value and the Y value are added by ALU 12 in step A 5, and the register relative register addressing process is performed in register r 0 of register array 11.
  • the arithmetic result value Z is held based on the write address Aw and the write control signal Sw specified by, and the arithmetic result value Z is added to the next operation based on the read address Ar in step A5.
  • the output is made as a number X value.
  • the ALU 12 adds the X value and the Y value read from the register array 11.
  • the register array 11 can be treated as a memory (RAM) in which data can be written and read at any time. : Normally 1 2 etc. This makes it possible to access the register array 11 (register) while treating it like the RAM (memory) of a processor.
  • RAM central processing unit
  • the RAM and ROM functions can be incorporated into the conventional CPU, high-speed arithmetic processing can be performed, and the CPU, RAM, ROM, etc. can be mounted on a board as compared to the case where they are individually arranged. The occupied area can be reduced. It is possible to achieve a compact application device to which the arithmetic processing device 100 is applied.
  • FIG. 7 is a plan view of a semiconductor chip showing a configuration example of an arithmetic processing device 100 as a second embodiment according to the present invention.
  • a plurality of memory cells and arithmetic and logic elements are formed in advance on the same semiconductor chip, and the memory cells are combined to form a register array 11 and a ROM.
  • the arithmetic and logic elements are combined to define the ALU 12, the decoder 13, and the instruction execution control unit 50.
  • the register array 11, the ROM cell 24, the ALU 12, the decoder 13, and the instruction execution control unit 50 are connected based on the preset wiring information, and the above-described arithmetic program AP is written in the ROM cell 14. Done.
  • the arithmetic processing device 100 shown in FIG. 7 is a programmable semiconductor device (PLD; Programmable Logic Device) in which a plurality of memory cells MSE and an arithmetic logic element LAY are formed on the same semiconductor chip in advance.
  • PLD Programmable Logic Device
  • each cell there are a plurality of memory cells MSE and an arithmetic and logic element LAY A memory cell with one unit as a unit Z
  • 8 ⁇ 8 64 cell blocks SE11 to SE88 are formed on the same semiconductor chip.
  • a plurality of memory cells MSE are arranged in the upper half of one cell block SEij, and a plurality of arithmetic logic elements LAY are arranged in the lower half thereof.
  • the register array 11 and the ROM cell 14 are defined by combining the memory cells in the cell block SE ij and the register array 11 and the ROM cell 14 are also defined by combining the memory cells in other cell blocks SE ij. Is assumed.
  • IZO interfaces 60 to 63 are provided on both ends of row wirings CO 1 to CO 7 and both ends of column wirings RO 1 to RO 7, and I / I interface 61 has row wirings C ⁇ 1 to One end of C ⁇ 7 is connected, and an IZO interface 63 is connected to the other end.
  • One end of the column wirings RO 1 to RO 7 is connected to the IZO interface 60, and an IZO interface 62 is connected to the other end.
  • the wiring can be programmed to the I / O interface 60 or the I / O interface 63 using the row wiring CO 1 closest to the cell block SE 11, the column wiring RO 1, and the like.
  • the four I ZO interfaces 60 to 63 are, for example, cell blocks SE 11, SE 12 ⁇ SE 18, SE 11, SE 21 constituting the outer peripheral edge of the 64 cell blocks SE ij in the grid.
  • ⁇ SE81, SE81, SE82 ⁇ ⁇ -SE88, and SEI8, SE28 ⁇ ⁇ ⁇ They are arranged to surround them along SE88.
  • a plurality of switch elements (transistors) are arranged everywhere, and by turning on the switch elements based on wiring information, circuit elements can be freely connected.
  • the register array 11, the ALU 12, the decoder 13, the ROM cell 14, the instruction execution control unit 50, and the like have not been defined, and the general-purpose program has not been defined.
  • Ramapur 'Logic The device is made up.
  • cell blocks SE 11 to SE 88 are assigned to each functional circuit, and column wirings RO l to RO 7 and row Wiring is performed using wirings CO 1 to CO 7 and the like, and the arithmetic functions required by the electronic device are freely programmed to build a CPU function or the like that meets the user's wishes.
  • a layout construction example of the arithmetic processing device 100 will be described.
  • the register array 11, ALU 12, decoder 13, ROM cell 14, execution state machine 51, instruction reading state, which are enclosed by the dashed lines shown in Fig. 8, are placed on the semiconductor chip prepared in Fig. 7.
  • the machine 52, the selector 53, the program counter 54, the incrementer 55, the selector 56, the selector 57, the input selector 59, the latch circuits 58, 510, and 511 are defined and the arithmetic processing unit 100 is laid out.
  • the execution state machine 51, instruction reading state machine 52, selector 53, program counter 54, incrementer 55, selector 56, selector 57, input selector 59, and latch circuits 58, 5 10 and 51 1 are shown in Figure 1.
  • the register array 11 is configured by, for example, allocating cell blocks SE1, SE14, SE23 and SE43. 8
  • the memory cells MSE of these cell blocks SE1, SE14, SE23 and SE43 are used for the 192 registers r0 to rn.
  • the register array 11 has a plurality of registers r0 to rn which hold an arbitrary value based on the write address Aw and the write control signal Sw, and output the value based on the read address Ar. Allocate memory memory MSE as shown.
  • the input buffer circuit and the output buffer circuit of the arithmetic logic element LAY of the cell blocks SE1, SE14, SE23, and SE43 may be used. .
  • the wiring between them is connected using column wiring R01, RO2 and row wiring CO2, CO3, CO4.
  • the ALU 12 is configured by allocating cell blocks SE 26 and SE 36 and the like. Uses Arithmetic Logic Element LAY of SELPLOCK SE 26 and SE 36 To build ALU 12.
  • the wiring between them is connected using column wirings RO1, RO2 and row wirings CO5, CO6.
  • the decoder 13 is configured by allocating cell blocks S 54 and S 64.
  • the decoder 13 is constructed by using an arithmetic and logic operation element LAY such as SELPLOCK SE54 and SE64. The wiring between them is connected using the column wiring RO5 and the row wiring CO3, CO4 and the like.
  • the ROM cell 14 is configured by allocating cell blocks SE 52 and SE 62 and the like.
  • a read-only memory is constructed using memory cells MSE, such as cell block SE52 and SE62. Arithmetic logic operation
  • the input / output buffer circuit of the element L A Y and the output buffer circuit are used to constitute the operation program AP writing / reading circuit. The wiring between them is connected using a column wiring RO 5 and a row wiring C O 1, C O 2, and the like.
  • the execution state machine 51 is configured by allocating cell blocks SE 56, SE 57, SE 58, SE 66, SE 67 and SE 68. The wiring between them is connected using column wiring RO5 and row wiring CO5, CO6, CO7, etc.
  • the execution state machine 51 selects one register ri based on the operation instructions # I1 to # I4, and selects another register according to the value held by the selected register ri.Register relative register addressing It performs the processing.
  • the instruction readout state machine 52 is configured by allocating SENOLEV ports SE 85 and SE 86 and the like. The wiring between them is connected using the column wiring RO7 and the row wirings CO4, CO5, C06 and the like.
  • the selector 53 and the program counter 54 are configured by assigning a cell block SE 73 or the like.
  • the wiring to other circuits is made using a column wiring RO 7 and a row wiring C O 2.
  • the incrementer 55 is configured by allocating the cell block SE83 and the like.
  • the wiring to other circuits is connected using column wiring RO7 and row wiring CO2, CO3, and so on.
  • the selector 56 is configured by allocating the cell block SE 33 and the like.
  • the wiring between other circuits is made by using row wiring CO 3 and CO 4.
  • the selector 56 selects either the read execution address Ar for selecting one register or the read address Ar for selecting the register again. It is.
  • the selector 57 is configured by allocating the cell block SE 34 and the like.
  • the wiring to other circuits is connected using row wiring CO 2 and CO 3.
  • the selector 57 selects one of a write execution address for selecting one register ri and a write address Aw for selecting the register again.
  • the input selector 59 is configured by allocating cell blocks SE12, SE22, and the like.
  • the wiring to other circuits is made using column wiring RO 1 and row wiring CO 1.
  • the latch circuit 58 is configured by allocating a cell block SE 35 or the like. Wiring between other circuits is performed using column wiring RO 2 and row wiring CO 5.
  • the latch circuit 510 is configured by allocating a cell block SE 37 or the like. The wiring to other circuits is made by using a column wiring RO 2 and row wirings C O 6, CO 7, and the like.
  • the latch circuit 511 is configured by allocating a cell block SE41 and the like. The wiring to other circuits is connected using a column wiring RO 3 and a row wiring CO 1.
  • the arithmetic processing unit 100 is constructed by connecting the selector 56, the selector 57, the input selector 59, and the latch circuits 58, 510, and 511 according to wiring information.
  • a programmable logic device for constructing the arithmetic processing unit 100 is mounted on a printed wiring board of an electronic device, and a flash memory 70 as an example of a rewritable nonvolatile storage device is mounted on the printed circuit board.
  • the flash memory 70 includes wiring between memory cells in each sensor block SE ij, wiring between arithmetic logic elements, wiring between cell blocks SE 11 to SE 88, and column wiring RO 1 to connect between them. It stores wiring information for turning on switch elements placed everywhere, such as between R07 and the I / O interface.
  • FIG. 10 is a table showing an example of wiring information stored in the flash memory 70.
  • signal lines L 1 to L for wiring information D 1 to D 38 38 indicates the use of a signal or DATA transmitted to the signal lines L1 to L38.
  • the wiring information D1 to D38 is created in the circuit technology language and is prepared as a net list (connection information).
  • the wiring information D1 to D38 stored in the flash memory 70 can be rewritten at any time according to the function of the arithmetic processing device 100.
  • the arithmetic program AP is written in the ROM cell 14.
  • the operation program AP includes operation instructions # I1 to # I4 for executing register-relative register addressing processing.
  • the arithmetic program AP may be linked to the wiring information D 1 to D 38... And output to the decoder 13.
  • the function of the ROM cell 14 can be shared by the flash memory 70.
  • connection example in the arithmetic processing unit 100 will be described.
  • the cell block SE 22 and the cell block SE 66 are connected by the signal line L 24, the cell block SE 22 is arranged between the cell block SE 22 and the column wiring R 03.
  • Each of the transistors T23, T63, T66 can be gate-controlled.
  • the wiring information D24 in the table shown in FIG. 11 is read from the 70 flash memories.
  • the wiring information D24 is set to each gate of the transistors T23, T63, and T66. As a result, the transistors T23, T63, and T66 are turned on. By turning on these transistors T23, T63, and T66, the cell block SE22 and the column wiring R03, the column wiring R03 and the row wiring CO6, and the row wiring CO6 and the cellblock SE 66 is electrically connected, and the signal line L24 can be constructed.
  • the cell block SE 22 is assigned to the selector 59
  • the cell block SE 66 is assigned to the execution state machine 51
  • the signal line L 24 is used for transmitting the selection control signal S 24 of the selector 59. You.
  • the cell blocks are arranged everywhere, such as between memory cells in SE ij.
  • the wiring information D 1 to D 38... are set to the switching transistors, and the circuit elements are freely connected by the transistors based on the wiring information D 1 to D 38.
  • the register array 11, the ALU 12, the decoder 13, the ROM cell 14, the instruction execution control unit 50, and the like are connected. With this setting, the size of the calculation program AP stored in the ROM cell 14 can be reduced.
  • FIG. 12 is a circuit diagram of the arithmetic processing unit 100 connected when the power is turned on.
  • FIG. 2 illustrates a plurality of signal lines and the like in the configuration diagram of the arithmetic processing device 100 illustrated in FIG.
  • the signal lines described here are based on the wiring information D 1 to D 38 recorded in the flash memory 70.
  • the wiring information D 1 to D 38 are prepared for each signal line.
  • the switching transistor for ON as shown in FIG. 11 is turned ON based on the wiring information D3, and the signal line L3 connects the decoder 13 to the ROM cell 14.
  • the arithmetic program AP is transmitted to the signal line L3.
  • the signal line L4 connects the decoder 13 and the instruction reading state machine 52 based on the wiring information D4.
  • the command control signal S4 is transmitted to the signal line L4.
  • the signal line L5 connects the ROM cell 14 with the instruction reading state machine 52 and the program counter 54 based on the wiring information D5.
  • the count output signal S5 is transmitted to the signal line L5.
  • the signal line L 6 connects the selector 53 and the program counter 54 based on the wiring information D 6.
  • Either the branch control signal S27 or the increment output signal S7 is transmitted to the signal line L6 as a selector output.
  • the signal line L7 connects the incrementer 55 and the selector 53 based on the wiring information D7.
  • the increment output signal S7 is transmitted to the signal line L7.
  • the signal line L9 and the signal line L10 connect the decoder 13 and the execution state machine 51 based on the wiring information D10.
  • the command signal S9 is transmitted on the signal line L9, and the respective argument signals S10 are transmitted on the signal line L10.
  • the signal line L 11 connects the data path 19 A and the input selector 59 based on the wiring information D 11.
  • Data (DATA) is transmitted to the signal line L11.
  • the signal line L12 connects the register array 11 and the execution state machine 51 based on the wiring information D12. Write control signal on signal line L 1 2 Sw is transmitted.
  • the write address line L 13 connects the register array 11 to the selector 57 based on the wiring information D 13.
  • the write address Aw is transmitted to the write address line L13.
  • the read address line L 14 connects the register array 11 and the selector 56 based on the wiring information D 14.
  • the read address Ar is transmitted to the read address line L14.
  • the signal line L15 connects the latch circuit 511 to the address bus 19B based on the wiring information D15.
  • An external address is transmitted to the signal line L15.
  • the signal line L16 connects the execution state machine 51 and the control bus 19C based on the wiring information D16.
  • the external control signal S16 is transmitted to the signal line L16.
  • the signal line L17 connects the latch circuit 511 to the execution state machine 51 based on the wiring information D17.
  • the latch control signal S17 is transmitted to the signal line L17.
  • Data signal line L 20 is based on wiring information D 20, register array 11, ALU 12, data bus 19 A, selector 57, selector 56, 58, and input To the selector 59 of Data (DATA), X value, Y value, and the like are transmitted to the data signal line L20.
  • the signal line L 21 connects the A L U 12 with the input selector 59 based on the wiring information D 21.
  • the operation result value Z is transmitted to the signal line L21.
  • the signal line L22 connects the ALU12 to the latch circuit 510 based on the wiring information D22.
  • the coincidence detection signal S22 is transmitted to the signal line L22.
  • the signal line L23 connects the execution state machine 51 and the latch circuit 510 based on the wiring information D23.
  • the flag state signal S23 is transmitted to the signal line L23.
  • the signal line L 24 connects the input selector 59 and the execution state machine 51 based on the wiring information D 24.
  • the selection control signal S 24 is transmitted to the signal line L 24.
  • the signal line L25 connects the input selector 59 and the register array 11 based on the wiring information D25. Data, an operation result value Z, an operand X value, and the like are transmitted to the signal line L25.
  • the signal line L 26 connects the execution state machine 51 and the instruction reading state machine 52 based on the wiring information D 26.
  • the execution end signal S26 is transmitted to the signal line L26.
  • the signal line L27 connects the execution state machine 51 and the selector 53 based on the wiring information D27.
  • the branch control signal S is connected to the signal line L27. 2 7 is transmitted.
  • the signal line L28 connects the execution state machine 51 and the selector 53 based on the wiring information D28.
  • the selection control signal S28 is transmitted to the signal line L28.
  • the signal line L 29 connects the instruction reading state machine 52 and the execution state machine 51 based on the wiring information D 29.
  • An instruction execution start signal S29 is transmitted to the signal line L29.
  • the signal line L30 connects the instruction readout state machine 52 and the program counter 54 based on the wiring information D30.
  • the count control signal S30 is transmitted to the signal line L30.
  • the signal line L31 connects the selector 57 and the execution state machine 51 based on the wiring information D31.
  • the selection control signal S31 is transmitted to the signal line L31.
  • the signal line L32 connects the selector 56 and the execution state machine 51 based on the wiring information D32.
  • the selection control signal S32 is transmitted to the signal line L32.
  • the address signal line L33 connects the selector 56 and the execution state machine 51 based on the wiring information D33.
  • the read address Ar is transmitted to the address signal line L33.
  • the signal line L34 connects the latch circuit 58 and the execution state machine 51 based on the wiring information D34.
  • the latch control signal S58 is transmitted to the signal line L34.
  • the signal line L35 connects the ALU 12 and the execution state machine 51 based on the wiring information D35.
  • the ALU control signal S35 is transmitted to the signal line L35.
  • the signal line 36 connects the latch circuit 58 to ALU 12 based on the wiring information D36.
  • An X value “0” or the like is transmitted to the signal line L36 as a latch output.
  • the address signal line L37 connects the selector 57 and the execution state machine 51 based on the wiring information D37.
  • the write address Aw is transmitted to the address signal line L37.
  • the signal line L38 connects the execution state machine 51 and the latch circuit 510 based on the wiring information D38.
  • the latch control signal S38 is transmitted to the signal line L38.
  • the wiring information D 1 to D 38 As described above, according to the method of constructing the arithmetic processing device 100 as the second embodiment according to the present invention, the wiring information D 1 to D 38. Register array 11, ALU 12, Decoder 13, ROM sensor 14, Execution state machine 51, Instruction read state machine 52, Selector 53, Program counter 54, Incrementer 5 5, selector 5 6, The selector 57, the input selector 59, and the latch circuits 58, 510, 511 are connected.
  • one register r 10 is selected by the execution state machine 51 based on the operation instructions # I 1 to # I 4, and the other register r 0 is selected by the value “0” held by this register r 10 It is possible to construct a programmable arithmetic processing device 100 that executes register relative register addressing processing with power-on. It is possible to efficiently build a processor including memory cells on one chip.
  • the decoder 13 decodes the operation instructions #I 1 to #I 4 from the operation program AP for operating the ALU 12, and the instruction execution control unit 50 decodes them by the decoder 13.
  • the register arrays 11 and ALU 12 are controlled to execute the operation instructions # I1 to # I4.
  • the ALU 12 calculates the X and Y values read from the register array 11.
  • the operation result value Z can be stored in the register r 0 of the value “0” indicated by the register r 10.
  • the instruction execution control unit 50 can use all the parts having the memory function inside the PLD as registers, high-speed operation can be performed as compared with a type of processor that accesses memory cells and registers separately. Will be possible. Moreover, the area occupied by the substrate can be reduced as compared with the case where the CPU, RAM, ROM, etc. are individually arranged on the substrate. It is possible to reduce the size of an electronic device such as a mobile terminal device to which the arithmetic processing device 100 is applied.
  • FIG. 13 is a block diagram showing a configuration example of an arithmetic processing system 100 'as the third embodiment according to the present invention.
  • an arithmetic processing unit (second arithmetic processing unit) 100 which executes arithmetic processing based on an arithmetic program for executing register relative register addressing processing by designating a plurality of registers.
  • the compressed program created by the program creation system is acquired, the register type is decoded, and based on this register type, the number of instruction bits for designating the register is restored, and the instruction structure of the specified instruction length is restored.
  • By restoring a program with memory it is possible to reduce the memory capacity such as ROM for storing program data, When a more processor is constructed, the occupancy of the memory cells functioning as ROM can be reduced (second arithmetic processing method).
  • the length of instructions can be varied according to the frequency of use of registers, and short-length instructions can be set in frequently accessed registers. Method) .
  • the arithmetic processing system 10 shown in FIG. 13 edits instructions for executing arithmetic processing based on an arithmetic program that executes register relative register addressing processing based on a predetermined programming language. And a data processing system using the program and a plurality of registers.
  • a program creation device 200 which forms the program creation system I is prepared. This is for creating a program for operating a newly designed and manufactured arithmetic processing unit 100 ′.
  • the arithmetic processing unit 100 constitutes a program execution system II, and in the unit 100 ', an instruction execution operation unit, a storage unit, a plurality of registers, and the like are mounted.
  • the program creation device 200 compresses the number of instruction bits for designating the register based on the frequency of use of the register in the arithmetic processing device 100 ′, and stores the register in the instruction structure of the program.
  • the compression program AP with different instruction lengths is created by describing the type. This is for reducing the memory capacity of the storage unit for storing the program, which is mounted on the arithmetic processing unit 100,.
  • the program creation device 200 has, for example, a database 21, a keyboard 22, a mouse 23, a display device 24, and a control device 25.
  • the database 21 stores data necessary for creating a program for the arithmetic processing unit 100 '.
  • Database 2 1 is connected to the control device 2 5
  • keys board 2 2 Mouse 2 3 ⁇ Pi display device 2 4 is connected to the control device 2 5.
  • program creation device 200 a program description screen in C language is displayed on the display device 24, and the program is created using the keyboard 22 and the mouse 23.
  • the arithmetic processing unit 100 ′ for a new design and manufacture uses N registers
  • the first to Nth serial numbers are assigned to the N registers.
  • the registers in the 1st to Kth groups are classified as frequently used
  • the length of the instruction is changed according to the frequency of use of the register.
  • Frequently accessed registers set short-length instructions. Frequently used registers are assigned shorter instruction bits, while less frequently used registers are assigned longer instruction bits.
  • the arithmetic processing unit 100 obtains the compressed program AP created by the program creating device 200, decodes the register type, and restores the number of instruction bits specifying the register based on the register type. Then, an arbitrary operation is executed by designating a plurality of registers based on an instruction having a predetermined length.
  • the arithmetic processing unit 100 for example, has an instruction decoding and restoring unit 3, a storage unit 4, a register 11 and an instruction execution operation unit 50.
  • the register array 11 is a set of multiple registers.
  • the storage unit 4 stores a compression program AP for designating a corresponding register from the register arrays 11 and.
  • the compression program AP created by the program creation device 200 is used. For example, the compression program AP is written to the storage unit 4 for storing programs constructed by the arithmetic processing unit 100 'using a ROM writer or the like.
  • a processor may be constructed from a programmable 'Logic' device (Programmable Logic Device; PLD) composed of a plurality of memory cells and arithmetic logic elements. The occupancy of the memory cells functioning as ROM can be reduced.
  • PLD programmable 'Logic Device
  • a method in which the storage unit 4 for storing the program is manufactured separately from the arithmetic processing unit 100 ′, and the compression program AP is stored in each storage unit 4 and then mounted on the same substrate. Good.
  • Read-only memory 4 This is because memory (ROM) and EEPROM (flash memory) are used.
  • the storage section 4 is connected to an instruction decoding / decompression section 3, which reads out the compressed program AP from the storage section 4 to decode the register type, and sets an instruction bit for designating the register based on the register type. It is made to restore numbers. This is for aligning the instruction length and specifying multiple registers based on this instruction.
  • the instruction decoding / recovery unit 3 is connected to an instruction execution operation unit 50 ′, and the instruction execution operation unit 50 ′ is connected to a register array 11 ′.
  • the instruction execution operation unit 50 ′ executes an arbitrary operation by designating the corresponding register in the register array 11 based on the program of the predetermined instruction length restored by the instruction decoding and restoration unit 3. You.
  • FIG. 14 is a flowchart showing a processing example in the arithmetic processing system 10.
  • a program is created by the program creation system I by editing instructions for executing arithmetic processing based on an arithmetic program that executes register-relative register addressing processing based on a predetermined program language.
  • data is processed by the program execution system II using the program and a plurality of registers.
  • the arithmetic processing unit 100 uses N registers, and the first to N-th serial numbers are assigned to the N registers. Calculation processing method).
  • the program creation system executes the arithmetic processing based on the arithmetic program that executes the register relative register addressing processing based on the predetermined program language in step AO1 of the flowchart in FIG. 14A.
  • register type is written in the instruction structure of the program. Will be described. For example, one set of registers that hold the augend and addend, and this is called “register type 1” for the register type of “register number 1” and “register type 2” for the register type of “register number 2” , And if the registers in the 1st to Kth groups are frequently used, code “0” is written in “register type 1” and “register type 2”. If the registers in the Kth to Kth to [th] groups are infrequently used, the code “1” is described in “Register type 1” and “Register type 2J”.
  • step AO4 a compression program AP having a different instruction length is created.
  • the number of instruction bits to specify the registers of the 1st to Kth groups is m bits
  • the number of instruction bits to specify the registers of the Kth to 1st to Nth groups Is n bits.
  • the instruction form including the register specification of the 1st to Kth groups has an instruction length 16 bits shorter than the instruction form including the register specification of the Kth to Nth groups. Become.
  • the compression program AP created in the program creation system is obtained in step B1 of the flowchart shown in FIG. 14B.
  • the compressed program AP is written into the storage unit 4 for storing the program constructed by the arithmetic processing unit 100, using a ROM writer or the like.
  • the register type is decoded in step B3.
  • register numbers of the 1st to Kth groups are decoded as the most frequently used registers from code “0”, and “register type 1” and “register type Regarding “2”, the register numbers of the K + 1 to Nth groups are decoded as the least used registers from code “1”.
  • step B4 the number of instruction bits specifying the register is restored in step B4.
  • groups 1 to K The number of instruction bits in the data is higher than ni bits, in this example, “0” is added to the upper 8 bits.
  • the number of instruction bits of the registers of the first to Kth groups is aligned to n bits in the same manner as the number of instruction bits of the registers of the K + 1th to Nth groups.
  • step B5 an arbitrary operation is performed by specifying a plurality of registers based on the restored instruction of a predetermined length. Then, it is determined in step B6 whether to end the arithmetic processing.
  • step B2 determines whether to execute the instruction and to continue the arithmetic processing.
  • the arithmetic processing is performed based on the arithmetic program that executes the register relative register addressing processing based on the predetermined program language.
  • the program creation device 200 uses registers frequently. The number of instruction bits for designating the register is compressed based on the above, and the type of register is described in the instruction structure of the program to create a compressed program AP having a different instruction length.
  • the arithmetic processing unit 100 obtains the compressed program AP created by the program creating unit 200, decodes the register type, and restores the number of instruction bits specifying the register based on the register type.
  • An arbitrary operation is executed by designating a plurality of registers based on an instruction having a predetermined length. Therefore, in the program creation system I, the length of the instruction can be changed according to the frequency of use of the register, so that a short-length instruction can be set in a frequently accessed register.
  • a compressed instruction can be set in the storage unit 4 such as a ROM, and the memory capacity of the storage unit 4 for storing program data can be reduced.
  • a processor is constructed with PLDs consisting of memory cells and logic operation elements, the occupancy of memory cells that function as ROM can be reduced, and more memory cells can be allocated to registers. become.
  • FIG. 15 shows a configuration of a microprocessor 101 according to a fourth embodiment of the present invention. It is a block diagram showing an example.
  • a microprocessor 101 is configured by connecting an external memory 2 to the arithmetic processing units 100, and executes arithmetic processing based on an arithmetic program that specifies a plurality of registers and executes register relative memory addressing processing.
  • an operation instruction for executing the register relative register addressing process may be described in the compression program AP.
  • the selectors 56 and 57 as shown in FIG. 1 may be connected to the input portion of the register array 11 and shown in FIG. 15, and the selectors 56 and 57 may be controlled by the execution state machine 51.
  • the effects of the first embodiment and the effects of the second embodiment are obtained in an overlapping manner.
  • a compressed program AP of machine language instructions created by the program creation system I is obtained, the register type is decoded, and the number of instruction bits for designating the register is restored based on this register type.
  • a program having an instruction structure with an instruction length of is restored. By doing so, it is possible to reduce the memory capacity of the ROM and the like for storing program data.
  • the microprocessor 101 shown in FIG. 15 compresses in advance the number of instruction bits for designating the register based on the frequency of use of the register, and sets the instruction length of the instruction type in which the register type is described in the instruction structure of the program. It is a device that processes data based on different compression programs AP.
  • the processor 101 acquires the compression program AP created by the program creation device 200, decodes the register type, restores the number of instruction bits designating the register based on the register type, and obtains an instruction of a predetermined length. An arbitrary operation is performed by designating a plurality of registers based on the.
  • the microprocessor 101 has, for example, a register array 11, an instruction bit restoration decoder (corresponding to the decoder of the first embodiment) 13, the ROM 14, and an instruction execution operation unit 50.
  • the register array 11 is a set of multiple registers.
  • a ROM 14 for storing a program which is an example of a storage unit, is mounted, and a compression program AP for specifying a corresponding register ri from the register array 11 is stored.
  • the compression program AP has a machine language instruction (Instruction) structure, and the one created by the program creation device 200 is used.
  • the compression program AP is written to ROM 14 using a ROM writer or the like.
  • the ROM 14 outputs the compression program AP based on the count output signal S5 from the program counter 54, for example.
  • the instruction bit restoration decoder 13 is connected to the ROM 14 and reads out the program AP for the instruction in the machine language from the ROM 14 to read the instruction control signal S 4, the instruction signal S 9, and each argument signal.
  • S 10 is generated.
  • the instruction signal S9 includes a 10 a d instruction, an a d d instruction, a cm p instruction, and a j u m p instruction.
  • access method # 1, access method # 2, "register type 1", “register type 2", register numbers r0, r1, Jumpa dress and the like are included.
  • This compression program AP contains operation instructions for executing register-relative memory addressing processing.
  • one register is selected based on the operation instruction, and the external memory 2 is selected according to the value held by the selected register.
  • This process is executed by, for example, access method # 1.
  • the above-described instruction control signal S 4 is output to the instruction read state machine 52.
  • An instruction execution operation unit 50 is connected to the register array 11 and the instruction bit restoration decoder 13 described above.
  • the instruction execution operation unit 50 executes an arbitrary operation by designating the corresponding register ri in the register array 11 '. Done.
  • the instruction execution operation unit 50 is composed of an arithmetic logic unit (ALU), an execution state machine 51, an instruction reading state machine 52, a selector 53, and a program counter (PC) 54. , +1 incrementer 55, an input selector 59, and a latch circuit 58, 510, 511 ', and execute register-relative memory addressing processing.
  • a data signal line L20 is connected to the register array 11, and this signal line L
  • ALU 1 and 2 are connected through 20.
  • the ALU 12 operates on the values such as X and Y read from the registers specified in the register array 11 '.
  • the value of the operation result is Z.
  • the operation types are addition, multiplication, subtraction, division, and the like.
  • the calculation type is set based on the ALU control signal S35 output from the execution state machine 51.
  • Latch circuits 58, 511, 59 and the like are connected to the data signal line L20 in addition to the ALU12. DATA, the augend X value, the addend Y value, etc. are transmitted to the data signal line L20.
  • the execution state machine 51 and the instruction reading state machine 52 are connected to the instruction bit 1 and the restoration decoder 13, and the register array is used to execute the operation instruction decoded by the instruction bit restoration decoder 13. 11 and ALU 12 are controlled.
  • the instruction read state machine 52 controls the program counter 54 and the execution state machine 51 based on the instruction control signal S4 output from the instruction bit restoration decoder 13. For example, the machine 52 outputs the instruction signal S 9 and the respective argument signals S 10 from the instruction bit restoration decoder 13 to the execution state machine 51 and outputs the instruction execution start signal S 29.
  • the register array 11 1 ′, the ALU 12, the latch circuits 58, 51 0, 51, and the selector 59 are connected to the execution state machine 51.
  • the machine 51 starts executing the instruction based on the instruction execution start signal S29. For example, when writing data, a write control signal Sw is output to the register arrays 11 and 1, and a select control signal S 24 is output to the selector 59. When reading data, the read address Ar is output to the register arrays 11 and 1.
  • the latch control signal S 34 is output to the latch circuit 58, and the latch control signal S 34 is output to the latch circuit 501.
  • An external control signal S 16 is output outside the processor.
  • the execution state machine 51 outputs an execution completion signal S 26 to the instruction reading state machine 52, and the value of the program counter 54 is advanced.
  • a selector 53 is connected to the execution state machine 51 and the instruction reading state machine 52, and the selector 53 selects either the increment output signal S7 or the branch control signal S27 based on the selection control signal S28. One of them is selected, and this is output to the program counter 54 as a selector output.
  • the selection control signal S 28 is supplied from the execution state machine 51.
  • the increment output signal S 7 is output from the incrementer 55 to the selector 53.
  • the +1 incrementer 55 is configured to increment the output signal S5 of the program counter 54 by +1 j to perform the increment.
  • the count control signal S 30 is supplied from the instruction decoding state machine 52. This count output signal S 5 is output to ROM 14 in addition to the +1 incrementer 55.
  • the selector 59 is connected to the data bus 19 A, the register array 11 ′ and the ALU 12, and the data (DATA) fetched from the data bus 19 A and the manuscript output from the register array 11 ′ Either the X value (addend Y value) or the operation result value Z output from the ALU 12 is input controlled based on the selection control signal S 24.
  • the latch circuit 58 is connected between the read port of the register array 11 'and ALU 12 and latches the output value X of the register ri based on the latch control signal S34.
  • the latch circuit 510 is connected to the comparison output section and the like of the ALU 12 and latches the match detection signal S22 based on the latch control signal S38 to generate a flag condition signal S2. It is made to output 3.
  • the latch circuit 5 11 1 is connected between the read port of the register array 11 1 ′ and the address path 19 B, and latches an external address (address) based on the latch control signal S 17. You.
  • a branch control signal S27 indicating the address of the jump destination is output from the execution state machine 51 to the selector 53.
  • the selector 53 selects the corresponding amount based on the selection control signal S28.
  • the branch control signal S27 is selected, and the branch control signal S27 is written to the program counter 54.
  • the external memory 2 is connected to the execution state machine 51, the selector 59, the data signal line L20, and the latch circuit 511 via the I / O interface 60. This is for operating the ALU 12 based on the register-relative memory addressing processing.
  • the I / O interface 60 and the external memory 2 are connected by the data bus 19A, the address path 19B and the control path 19C, data is transferred by the data path 19A, and the address is transferred by the address path 19B.
  • the external control signal S16 is transferred to the external memory 2 by the control bus 19C. This is for controlling the external memory 2.
  • the external memory 2 is, for example, a 512 Mbyte ⁇ 32-bit RAM (memory that can be written and read at any time).
  • FIG. 16 is a block diagram showing an example of the internal configuration of the register array 11 ′.
  • the 1 bit register is composed of a D-type flip-flop circuit and the like.
  • the write port 15 is connected to the selector 59 shown in FIG. 15, and outputs the data (DATA) fetched from the data path 19A and the register array 11 'based on the write control signal Sw and the write address Aw.
  • Either the augend X value (addend Y value) or the operation result value Z output from the ALU 12 is written to the registers rO to ri.
  • the write port 15 is connected to the execution state machine 51 and is adapted to supply a write address Aw.
  • the read port 16 is connected to the output of each register r i.
  • the read port 16 is connected to the ALU 12, the latch circuits 58, 511, the selector 59, etc. shown in FIG. 15 through the data signal line L20, and receives data from the register ri specified based on the read address Ar. (DATA) is read.
  • Read port 16 is connected to execution state machine 51 and is adapted to provide a read address Ar.
  • FIGS. 17A to 17E and FIGS. 18A to 18D Set in ROM 14 described earlier
  • FIG. 17A to FIG. 17E there are five types of instructions # F1 to # F5.
  • the instructions of the instruction forms # F2 to # F4 are restored to the instruction form of the instruction form # F1 and handled.
  • these instruction forms # F1 to # F5 each instruction is largely divided into a load instruction, an add instruction and a cmp instruction, and a jump instruction.
  • code 1 is described in the instruction as shown in Fig.
  • code 1 is written in the instruction for add instruction.
  • code "2" is described in the instruction.
  • the instruction form # F5 is a jump instruction, in which case the code "3" is described in the instruction. If the comparison results are the same for the cmp instruction, the zero flag is set to “1” based on the flag state signal S23 of the latch circuit 5110 shown in FIG. 15; “0” is set.
  • the loa d, a d d and cmp instructions are represented by 5 bits when the number of the register r i to be accessed can be represented by, for example, 5 bits, and 13 bits otherwise.
  • the instruction length is 32 bits
  • the instruction length is 24 bits
  • the instruction length is 24 bits
  • the instruction form # F4 has an instruction length of 16 bits
  • the first two bits indicate the instruction type. 1 o for instruction type ad indicates transfer, add indicates addition, cmp indicates comparison, and jump indicates control transfer (branch).
  • the instructions are followed by 2-bit access methods # 1, # 2. Operand is represented by access method # 1, "register number 1" on the left, and is represented by access method # 2, "register number 2" on the right.
  • access method # 1 indicates the access method of register r i indicated by “register number 1”
  • access method # 2 indicates the access method of register r i indicated by “register number 2”.
  • Access method # 1 and access method # 2 correspond to register number No. 1 and register number No. 2, respectively, and processing is performed between them. In each case, two types are prepared for access methods # 1 and # 2 as shown in Figure 18B. If code "0" is described for access methods # 1 and # 2, it is a method of directly accessing register ri indicated by register number 2. This indicates that the value of the register r i indicated by the register number is directly used. If code "1" is described for access methods # 1 and # 2, the value of register ri indicated by "register number 1" is used as the address, and the relevant microprocessor 101 accesses external memory 2. (See FIG. 18B).
  • access methods # 1 and # 2 are followed by 2-bit "register type 1" and "register type 2".
  • “Register type 1” indicates the type of register ri indicated by “register number 1”
  • “Register type 2” indicates the type of register ri indicated by “register number 2”.
  • register type 1 when “1” is described, it indicates a register ri whose register number is “32” or more and whose use frequency is low.
  • the program can be compressed by distinguishing the register numbers.
  • This “Register type 1” and “R “Register type 2” is followed by "Register number 1” and "Register number 2”.
  • “Register number 1” indicates, for example, a register ri holding an augend, and “register number 2” indicates a register ri holding an addend.
  • the instruction is described in the first 2bit, and the flag condition is described in the following 2bit.
  • a jump address is described.
  • the flag state is a condition for judging whether to shift the instruction execution control as shown in Figure 18D. Code "0” always transfers control unconditionally. Code “1” transfers control when “zero flagj” and the zero flag is “1". The code “2” is “non-zero flagj, and the control is transferred when the zero flag is” 0 ". Code "3" is unused.
  • FIG. 19 is a table showing an example of program creation in the program creation system I.
  • FIG. 19 is a table showing an example of program creation in the program creation system I.
  • P1 is an image of a program description screen
  • P2 shows the contents of the description
  • P3 describes conditions applicable in the embodiment.
  • Instructions for executing arithmetic processing based on an arithmetic program that executes register-relative memory addressing processing based on a predetermined program language are edited by the program creation device 200 shown in FIG. 1 to create a compression program. To do that.
  • the program creation device 200 displays the program description screen P1 in C language shown in Fig. 19 on the display device 24 shown in Fig. 1 and uses the keyboard 22 and the mouse 23 to compress the program. Is created.
  • data necessary for creating a program for the microphone processor 101 is read from the database 21.
  • [Global variable declaration], “function declaration”, “Local variable declaration”, “assignment”, “addition”, “comparison”, and “branch” necessary for describing a program in C language are read.
  • ⁇ Local variable declaration '' is made with the registers r 0 to r 31 in the 0th to 31st groups as the most frequently used class . That is, in this example, “Local variable declaration” is assigned to the third and lower registers ri.
  • “Global variable declaration” is performed with the registers r32 to r8191 of the 32nd to 8191st groups being used in a less frequently used category. In other words, “Global variable declaration” is assigned to the third and second or more registers ri.
  • “Register type 1” and “Register type 2” are described in the instruction structure of the program, and compressed programs AP with different instruction lengths are created.
  • the length of the instruction is changed according to the frequency of use of the register ri.
  • the frequently accessed registers r 0 to r 31 can set short-length instructions, and the memory capacity of the ROM 14 for program storage implemented in the microprocessor 101 can be set. Can be reduced.
  • FIG. 20 is a flowchart (main routine) showing a compilation example in the program creating device 200.
  • Fig. 21 is a flowchart (subroutine) showing an example of assignment and operation processing in the compiler.
  • a compression program is created by editing instructions for executing arithmetic processing based on an arithmetic program that executes register-relative memory addressing processing based on a program in the c language in the program creation system I.
  • the program creation system I sets the program address to “0” in step C1 of the flowchart in FIG. 20 in order to edit instructions based on a program in C language. afterwards, Go to step C2 to read a C language program.
  • the program description screen P1 of the display device 24 includes, for example, int * read-ada * write-add, counter, end-val indicating "global variable declaration";
  • step C6 the third to lower registers r0 to r31 are allocated. Since register ri is frequently used, the number n of instruction bits that specify register ri is reduced to 5 bits, which is 8 bits smaller than registers r32 to r8191 of "global variable declaration". This is for compression. Instructions are created in instruction forms # F2 to # F4. Then, the process proceeds to Step C14.
  • step C5 If the description is not "local variable declaration” in step C5 above, the process proceeds to step C7 to check whether "do" indicating the execution of the assignment and addition processing is described in the C language program. To check. At this time, the program description screen of display device 24
  • P1 indicates, for example, "do" do ⁇
  • read ⁇ add read _ add + added _ val
  • write-add write-add + added_val
  • step C8 the process proceeds to step C8 to store the current program address. Thereafter, the process proceeds to step C14.
  • step C7 If “do” is not described in step C7, the process proceeds to step C9 to check whether "while” indicating the processing between the two is described in the C language program. At this time, for example, (whilej is displayed on the program description screen P1 of the display device 24)
  • step C10 executes the assignment / arithmetic processing.
  • a subroutine shown in FIG. 21 is called, and at step E1 of the flowchart, it is checked whether or not the relevant line describes "while" in the C language program. In the case of the line in which “while” is described, the process proceeds to step E2, and the instruction generated in the subsequent processing is a cmp instruction. Then, go to step E6.
  • step E3 the process goes to step E3 to check whether the arithmetic processing is addition. If the arithmetic processing is addition, the process proceeds to step E4, and the instruction generated in the subsequent processing is set as an add instruction. If the arithmetic processing is not addition, the process proceeds to step E5, and the instruction generated in the subsequent processing is set as an Ioad instruction. Then, go to step E6.
  • step E6 the register number corresponding to the variable written to the register ri and the register number of the register ri corresponding to the variable read from the register array 11 ′ can be checked. Write address Aw T JP03 / 03716
  • step E7 it is checked whether both register numbers are “3 2” or more. If both register numbers are equal to or larger than “3 2”, the process proceeds to step E8 to generate an instruction in the instruction format # F1 shown in FIG. 17A.
  • this instruction form # F1 "1" is described in "register type 1” and "register type 2".
  • “register type 1” and “register type 2” are described in the instruction structure of the compressed program. For example, "1” is described in "Register type 1” and “Register type 2” for registers r32 to r8191 in the 32th to 8191st groups. . Thereafter, the process returns to step C10 of the main routine shown in FIG.
  • step E7 If both register numbers are not equal to or larger than "3 2" in step E7, the process proceeds to step E9 to check whether both register numbers are equal to or smaller than "3 1". If both register numbers are equal to or smaller than "3 1", the process proceeds to step E10 to generate an instruction in the instruction form # F4 shown in FIG. 17D.
  • this instruction form # F4 "0" is described in "register type 1” and "register type 2”.
  • “Register type 1” and “Register type 2” are described in the instruction structure of the compressed program. For example, “0” is described in “register type 1” and “register type 2” for the registers r 0 to r 31 in the 0th to 31st groups. Thereafter, the process returns to step C10 of the main routine shown in FIG.
  • step E11 to check whether the number of the register ri of the variable read from the register array 11 is equal to or larger than “3 2". If the number of the register ri of the variable to be read is equal to or greater than “3 2 _1”, the process proceeds to step E12 to generate an instruction in the instruction form # F2 shown in FIG. 17B. In “2,” “0” is described in “Register type 1” and “1” is described in “Register type 2”. Then, the process returns to step C10 of the main routine shown in FIG.
  • step E 13 executes the instruction form #F 3 shown in FIG. 17C. Generate instructions. In this instruction form # F3, "Register type 1" "1" is described, and "0" is described in "Register type 2". Thereafter, the process returns to step C10 of the main routine shown in FIG. Then, the process proceeds to step C11; an iump instruction is generated. The jump address of the jump command uses the previously stored program address. Thereafter, the process proceeds to step C14. If "while” is not described in step C9 described above, the flow shifts to step C12 to check whether data is assigned or added in a C language program.
  • step C13 In the case of data substitution or addition, the flow shifts to step C13 to execute data substitution or arithmetic processing.
  • step C13 the subroutine shown in FIG. 21 is called, and the process returns to step C13 of the main routine shown in FIG. 20 through steps E1 to E13 of the flowchart. Thereafter, the process proceeds to step C14.
  • step C14 the program is checked for the last line in the C language program. If it is not the last line, go to step C15 to advance the program address. Thereafter, the process returns to step C2 to repeat the above-described compile processing. The compilation process ends at the last line. As a result, it is possible to create a compression program AP having instruction formats # F1 to # F5 as shown in FIGS. 17A to 17E and different instruction lengths.
  • FIG. 22 is a table showing an example of operation instructions according to the restored operation program.
  • FIG. 23 is a diagram showing an example of the state of the registers r O, r 1..., R 32, r 33, r 34, r 35, etc.
  • FIG. 24 is a diagram showing an example of data storage in the external memory 2.
  • two sets of an array of ten memory cells as shown in FIG. 24 are prepared in the external memory 2 connected to the arithmetic processing unit 100,.
  • One is memory array #M 1 and the other is memory array #M 2.
  • “1” is added to the value stored in the set of memory arrays # M1,
  • Here is an example of the operation processing for storing the result in another memory array # M2.
  • Operation instructions (Instruction) # 11 to # 18 shown in FIG. 22 are based on the operation program after decompressing the compressed program AP of [10] ⁇ 14.
  • this arithmetic program as shown in FIG. 23, there are two registers r i that are frequently accessed, and these are assigned to r 0 and r 1 respectively.
  • the register indicated by the register number r0 is temporarily used, and the register indicated by the register number r1 stores the added value “1”.
  • the register indicated by the register number r32 stores the read address “0”
  • the register indicated by the register number r33 stores the write address “10”
  • the register indicated by the register number r34 Stores the initial value “0” of the counter, and the register indicated by the register number r35 contains the operation count value (end value) “10”.
  • Arithmetic instruction # I1 is load, r0, (r32) represented by 140020h in machine language in the instruction structure shown in FIG. 22, and the value of register r32 of register array 11 is used as an address.
  • the contents read from the external memory 2 are stored in the register r0.
  • the read address of the external memory 2 shown in FIG. 24 is “0”
  • the data “0” of the memory array # M1 is Is read, and the data “0” is written to the register r 0.
  • Arithmetic instruction #I 2 is add, r 0, rl represented by 4001 h in machine language, adds the value of register r 1 to register r 0 of register array 11, and stores the result in register r 0. This is the content to be stored.
  • the value “1” of the register r1 is added to the content “0” of the register r0, and as a result “1” is written to the register r0.
  • the operation instruction # I3 is load, (r33), r0 represented by 280420h in machine language, and the value of register r33 in register array 11 is used as the address, and the value of register r0 is stored in external memory. This is the content to be written to 2.
  • the operation is as follows: the memory array # M2 of the external memory 2 indicated by the register r33. Data "1" is written to the dress.
  • Arithmetic instruction # I4 is add, r32, rl represented by 480401h in machine language, adds the value of register r1 to register r32 of register array 1 1 ', and stores the result in register r32. Is the content to be stored. As an operation, the value “1” of the register r l is added to “0” which is the content of the register r 32, and the result “1” is written to the register r 32.
  • Operation instruction # I5 is add, r33, rl represented by 4804 21h in machine language. The value of register r1 is added to register r33 of register array 1 1 ', and the result is stored in register r. The contents are stored in 33. As an operation, the value “1” of the register r1 is added to “0” which is the content of the register r33, and as a result, “1” is written to the register r33.
  • Arithmetic instruction # I6 is add, r34, r1 represented by 480441h in machine language.
  • the value of register r1 is added to register r34 of register array 11, and the result is stored in register r. This is the content stored in 34.
  • the operation is to add “1” which is the value of register rl to “0” which is the content of register r and write “1” to register r as a result.
  • "1" is added in relation to this operation instruction # I 4 ⁇ # I 6 Niyotsu read in the counter of the execution state machine 5 in 1 Te Adoresu A r ⁇ Pi writes on address Aw.
  • Arithmetic instruction # I7 is c mp, r34, r35 represented by 8C0 44023h in machine language, compares the contents of register r34 of register array 11 with the contents of register r35. If the values are the same, set the zero flag to “1”; otherwise, set the flag to “0”. As the operation, since the values “1” and “10” of the registers r 34 and r 35 are different, “0” is set to the zero flag. The value of the zero flag is held by the latch circuit 510, and is referred to by subsequent instructions.
  • Arithmetic instruction # I 8 is a machine language represented by E 00000 h j ump n z,
  • the ROM 14 can be used more efficiently than when the number of instruction bits of all the registers ri is represented by a single method.
  • FIG. 25 is a flowchart showing an operation example of the microprocessor 101.
  • FIGS. 26A and 26B are flowcharts showing a processing example in the instruction bit restoration decoder 13.
  • the microprocessor 101 constitutes a program execution system II, and an operation program including the operation instructions #I 1 to #I 8 shown in FIG. 22 from the compression program AP read from the ROM 14 To restore.
  • the register number is extended by the instruction bit restoration decoder 13 Is performed.
  • “1” is added to the value of the memory array #Ml in the external memory 2 shown in FIG. 24 and stored in the memory array # M2.
  • r 0 is undefined, r 1 is set to the initial value “1”, r 32 and r 34 are set to the initial value “0”, r 33 and r 35 are set to the initial value “1 0”.
  • the execution state machine 51 outputs the write address Aw to the register array 11 and the initial values “0 J,” “1”, and “10” are set.
  • the instruction bit restoration decoder 13 sequentially receives the compressed programs (machine language instructions) AP from the ROM 14, and loads the program AP. It decodes and detects operation instructions # I1 to # I8 of a predetermined instruction length.
  • the instruction bit restoration decoder 13 calls, for example, a subroutine shown in FIG. 26A, extracts an instruction portion in step G1 of the flowchart, and outputs an instruction signal S9 to the execution state machine 51.
  • instruction bit restoration decoding In step D13, the process shifts to step G2 to check whether the instruction type is a jump instruction. If the instruction form is a jump instruction indicated by # F5, the flow shifts to step G12 to output a flag condition and a jump address. Then, return to step F1 of the main routine. If the instruction type is not a jump instruction in step G2, the process proceeds to step G4 to check whether the code described in “Register type 1” is “0” or “1” for the instruction type. I do.
  • step G10 If the code ⁇ 1 '' is described in ⁇ Register type 2 '' in step G7 above, go to step G10 to set the instruction bit number n of ⁇ register number 2 '' to 13 bit length and compress the program Remove from AP. Thereafter, the process proceeds to step G11 to detect "register number 1", “register number 2", "access method # 1", and "access method # 2". Then, the process returns to step F1 of the main routine shown in FIG. Therefore, the “register type 1” and the “register type 2” are not output to the execution state machine 51, and the instruction control signal S4 and the instruction signal based on the arithmetic instructions # I1 to # I8 having a predetermined instruction length are output. S 9 and each argument signal S 10 are output You.
  • the instruction signal S9 includes a 1 oad instruction, an add instruction, a cmp instruction, and a jump instruction.
  • Each of the argument signals S10 includes access method # 1, access method # 2, register numbers r0, r1,..., A flag condition, a jump address, and the like.
  • the instruction control signal S 4 is output from the decoder 13 to the instruction reading state machine 52.
  • the location (address) at which the compressed program AP is read from the ROM 14 is specified by the program counter 54 (PC). These read operations are controlled by an instruction read state machine 52.
  • the instruction read state machine 52 controls the program counter 54 and the execution state machine 51 based on the instruction control signal S 4 output from the instruction bit restoration decoder 13.
  • the machine 52 outputs the instruction signal S 9 and the respective argument signals S 10 from the instruction bit restoration decoder 13 to the execution state machine 51 and outputs the instruction execution start signal S 29.
  • the execution state machine 51 starts the execution of the instruction based on the instruction execution start signal S29. For example, at the time of data writing, a write control signal Sw is output to the register arrays 11 and 1, and a selection control signal S 24 is output to the selector 59. When reading data, the read address Ar is output to the register 11 '.
  • the latch control signal S34 is output to the latch circuit 58, and the latch control signal S38 is output to the latch circuit 50.
  • An external control signal S16 is output outside the processor.
  • the execution state machine 51 outputs an execution end signal S 26 to the instruction reading state machine 52, and the value of the program counter 54 is advanced.
  • the program counter 54 the location where the compression program AP is read from the ROM 14 is designated based on the force control signal S30.
  • the +1 incrementer 55 increments the count output signal S5 of the program counter 54 by "+1".
  • step F2 when the execution state machine 51 receives the instruction reading control of the instruction reading state machine 52 and receives the operation instruction # I1, it is represented by a machine language of 140200h 1 Write signal S 16 is output to external memory 2 based on oad, r 0, (r 32). This value is used to read the register array 11 Used as dress Ar.
  • the register array 1 1 ′ outputs the third value to the data signal line L 20. This value is held by the latch circuit 511 and output to the external memory 2 via the address path 19B. Then, the value of the register r32 of the register array 11 is used as an address, and the value read from the external memory 2 is stored in the register rO.
  • step F3 the execution state machine 51 receives the operation instruction # I2 under the instruction reading control of the instruction reading state machine 52, and receives add, r0 represented by a machine language of 4001h. , r 1, the value of register r 1 is added to register r 0 of register array 11, and the result is stored in register r 0. At this time, “lj”, the value of register r1, is added to “0”, the content of register rO, and as a result, “1” is written to register r0.
  • step F4 the execution state machine 51 receives the instruction read control of the instruction read state machine 52, receives the operation instruction # I3, and receives the operation instruction # I3 in machine language. Based on oad, (r33), r0, the value of register r33 of register 11 is used as an address, and the value of register r0 is written to external memory 2. At this time, data “1” is written to the address of the memory array # M2 of the external memory 2 indicated by the register r33.
  • step F5 the execution state machine 51 receives the instruction reading control of the instruction reading state machine 52 and receives the operation instruction # I4, and when the operation instruction # I4 is received, the add state represented by 4800401h in the machine language is added.
  • step F6 the execution state machine 51 receives the instruction reading control of the instruction reading state machine 52 and receives the operation instruction # I5. , r33, r1, the value of register r1 is added to register r33 of register array 11, and the result is stored in register r33. At this time, the value “1” of the register r l is added to the value “0” of the register r 33, and the result “1” is written to the register r 33.
  • the operation instruction # I5 "1" is added to the read address Ar and the write address Aw in the counter in the execution state machine 51.
  • the execution state machine 51 receives the instruction readout control of the instruction readout state machine 52 and receives the operation instruction # I6, and is represented by the machine language 480441h.
  • the value of register r1 is added to register r34 of register array 11, based on add, r34, r1, and the result is stored in register r34.
  • the value “1” of the register r l is added to the value “0” of the register r 34, and the result “1” is written to the register r 34.
  • the operation instruction # I6 "1" is added to the read address Ar and the write address Aw in the counter in the execution state machine 51.
  • step F8 it is determined in step F8 whether the value indicated by the register r35 has reached 10 times. For example, when the execution state machine 51 receives the operation instruction # I7 under the instruction reading control of the instruction reading state machine 52, the execution state machine 51 cmp, r 3 represented by 8 C 0 4 4 0 2 3 h in machine language 4, the contents of register r 3 4 of register array 1 1 ′ are compared with the contents of register r 3 5 based on r 3 5 .If the values are the same, zero flag is set to ⁇ 1 '', and If not, set to “0”. At this time, since the values “1” and “10” of the registers r34 and r35 are different, “0” is set to the zero flag.
  • Zero flag value is latch circuit 5 1 Held by 0 and referenced by subsequent instructions.
  • the execution state machine 51 receives the operation instruction # I8 under the instruction read control of the instruction read state machine 52, the execution state machine 51 sets a zero flag based on the jump nz and the LOOP represented by the machine language EO0000h. If “0”, control is transferred to the label indicated by LOOP. If the zero flag is "0”, control is transferred to the operation instruction # I1 in step F2. If the above operation is repeated 10 times in step F8, the value of register r34 will be
  • the register ri is used based on the frequency of use among the 8192 registers r0 to r8191.
  • the number of instruction bits to specify the data is compressed in advance, and the data is processed based on a compression program AP with different instruction lengths, with ⁇ Register type: U and ⁇ Register type 2 '' described in the instruction structure of the program. It is made to do.
  • the ROM 14 stores a compression program AP for designating the register r i among the 8192 registers r 0 to r 8191.
  • the instruction bit restoration decoder 13 reads the compressed program AP from the ROM 14 and decodes “register type 1 J” and “register type 2”. Based on the “register type lj” and “register type 2”, The number of instruction bits for specifying ri is restored.
  • the compression program AP has an instruction length that is variable according to the frequency of use of the register ri, and the short-length instruction is set in the frequently accessed registers r0 to r31. Since the compressed program data can be stored in the ROM 14, the memory capacity can be reduced. In this example, the memory capacity can be reduced by 16 bits X 32 2 X instructions compared to before the program is compressed. This makes it possible to reduce the occupancy of the memory cells that function as ROM when constructing the microprocessor 101 using PLDs composed of memory cells and logical operation elements, and allocate more memory cells to registers. Will be able to do it.
  • an external memory 2 is connected to the A case has been described where the processor 101 is configured to execute arithmetic processing based on an arithmetic program that executes register-relative memory addressing processing by designating a plurality of registers.
  • the present invention is not limited to this.
  • the operation instruction for executing the register relative register
  • the calculation process may be executed based on AP.
  • selectors 56 and 57 as shown in FIG. 1 are connected to the input part of the register array 11 and shown in FIG. 15, and the selectors 56 and 57 are connected to the execution state machine 5. You can control with 1.
  • the register array 11 of the first embodiment can be operated as a memory that can be written and read at any time, the board occupation area can be reduced, and the program of the second embodiment can be reduced.
  • the effect of reducing the memory capacity of the ROM and the like for storing data can be obtained in an overlapping manner.
  • the present invention can be applied to a single-chip microcomputer which can be built in various electronic devices and can be programmed, a CPU which performs various data processing based on an instruction execution program, and a built-in electronic device such as an MPU and a PLD. Very suitable for application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Executing Machine-Instructions (AREA)

Description

明 細 書 演算処理装置、 その構築方法、 演算処理システム及び演算処理方法 技術分野
本発明は、 システムプログラムに基づいて各種データ処理をする中央演算装置
( C P U) やマイクロプロセッサユニット (M P U) 等、 また、 プログラム可能 な論理演算素子 (P L D ) や、 これらの組み込み電子機器等に内蔵可能でプログ ラム可能な 1チップマイク口コンピュータ等に適用して好適な演算処理装置、 そ の構築方法、 演算処理システム及ぴ演算処理方法に関するものである。
詳しくは、 演算命令を実行するためのレジスタアレイ及ぴ演算部を制御する命 令実行制御部を備え、 演算命令に基づいて一のレジスタを選択すると共に、 この レジスタが保持する値によつて他のレジスタを選択するレジスタ相対レジスタァ ドレッシング処理を実行して、 レジスタァレイをデータの随時書込み及ぴ読出し 可能なメモリのように動作できるようにすると共に、 C P Uや、 R AM、 R OM 等を個々に基板に配置する場合に比べて基板占有面積を低減できるようにしたも のである。
この発明では、 複数のレジスタを指定して任意の演算を実行する演算処理装置 を備え、 プログラム作成系で作成された圧縮プログラムを取得してレジスタ種類 を解読し、 このレジスタ種類に基づいて当該レジスタを指定する命令ビット数を 復元し、 所定の命令長の命令構造を有するプログラムを復元するようにして、 プ 口グラムデータを格納する R OM等のメモリ容量を低減できるようにすると共に、 メモリセルや論理演算素子から成る P L Dによりプロセッサを構築する場合に、 R OMとして機能させるメモリセルの占有率を低減できるようにしたものである。 背景技術
近年、 携帯端末装置や、 電子カード、 情報処理装置等の各種電子機器に C P U (中央演算処理装置) を含むマイクロプロセッサが使用される場合が多くなつて きた。 この種のプロセッサで記憶装置にアクセスしようとした場合、 アクセス先 がレジスタである場合と外部メモリである場合とで別々のアクセス方法が採られ る。 アクセス先がレジスタである場合、 例えば、 A L U (Arithmetic L ogic Unit:算術論理演算ュュット) の周辺にはコピーレジスタやテンポラリレジスタ 等が配置され、 演算処理を行う場合、 コピーレジスタにデータを複写したり、 演 算処理後のデータをテンポラリレジスタに一時記憶するようになされる。 A L U がレジスタ対レジスタの演算処理に適しているためである。 ァクセス先が外部メ モリである場合、 例えば、 当該レジスタ番号が示す外部メモリの番地に情報を書 込む場合、 C P Uが当該外部メモリに対して、 その格納番地を指定する書込みァ ドレスと、 書き込み信号とを出力する。 当該レジスタ番号が示す外部メモリの番 地から情報を読み出す場合は、 C P Uが当該外部メモリに対して、 その格納番地 を指定する読出しァドレスと、 読出し信号を出力するようになされる。
このように、 当該レジスタ番号が示す外部メモリの番地に情報を格納したり、 当該レジスタ番号が示す外部メモリの番地から情報を読み出す際に、 C P Uが当 該外部メモリの格納番地 (書込みアドレス又は読出しアドレス) を指定する。 こ のような処理はレジスタ相対メモリアドレッシングと呼ばれる場合が多い。 これ は、 通常、 外部メモリがプロセッサと異なるデバイスに実装されているためであ る。
また、 この種のプロセッサには命令実行演算部の他に命令実行プログラムを格 納するための読み出し専用メモリ (以下、 R OMという) や、 命令実行演算処理 に使用される多くのレジスタ等が実装されている。 従来方式のマイクロプロセッ サによれば、 任意の電子機器に当該プロセッサを組み込んで用いる場合、 ある動 作を行う命令はその動作と、 その動作を行うための命令とが一対一に対応してい た。 つまり、 使用頻度が高いレジスタも、 使用頻度が低いレジスタも、 当該レジ スタを指定するための命令ビット数を同等にして一律の長さの命令により作成さ れたプログラムが使用される場合が多い。 このことで、 固定長の命令が R OMに 格納されて使用される。
他方で、 半導体集積回路技術の発展により、 多大な数のレジスタをプロセッサ (以下演算処理装置ともいう) 内に実装することが可能になってきた。 この場合、 レジスタを特定するための命令ビット数も益々多く必要になる。 例えば、 1 0 2 4個のレジスタが実装される場合、 1 0 2 4個のレジスタ中でその 1つを特定す るためには、 命令ビットとして 1 0ビットが必要となる。 し力 し、 実際のプログ ラムでは全てのレジスタへのアクセス頻度は一様ではなく、 アクセス頻度に斑が ある。 頻繁にァクセスされるレジスタの番号は一般的にコンパイラによつて決定 される。
ところで、 従来方式の演算処理装置によれば、 以下の理由により、 処理速度の 低下を招いていた。
① 外部メモリにアクセスするためのアクセス時間がかかることである。 これ は一般的に記憶装置は特定のプロセッサに特化して作られていることは希である ことから、 プロセッサ側で、 アクセスをしたい記憶装置に合わせたインターフエ ースを用意しなければならない。 従って、 記憶装置にアクセスする度にこのイン ターフェースを経由するため、 アクセス時間がかかり、 演算処理速度が低下する。
② 外部メモリから A L Uへ、 また A L Uから外部メモリへデータを転送する 際の時間がかかる。 これは一般的に A L Uがレジスタ対レジスタの演算処理に対 応しているため、 外部メモリ上に演算したいデータがある場合、 一旦、 外部メモ リからコピーレジスタへデータが複写され、 その後、 コピーレジスタから A L U へデータが転送されて演算処理を行うようになされる (レジスタ相対メモリアド レッシング) 。 従って、 演算処理速度が低下する原因となる。
③ C P Uや、 R AM、 R OM等の機能を 1チップに集合化して 1チップマイ クロコンピュータ等を構成しょうとした場合に、 同一半導体チップ上に C P Uを 配置し、 その周辺部に R AMや R OM等を配置する方法が考えられる。 この方法 は、 レジスタ相対メモリアドレッシング処理に依存することとなって、 演算処理 速度の向上が見込めない。
④ また、 従来方式の演算処理装置によれば、 命令実行プログラムを格納する R OMを実装するに当たり以下のような問題がある。
この命令実行プログラムのコード全体を眺めてみると、 レジスタを指定するた めの例えば、 1 0ビットの命令ビット内、 この 1 0ビット全体が一様に使用され ることが少ない。 従って、 命令実行プログラムを格納するメモリ中 (例えば R O Mやフラッシュメモリ) に無駄なビットが多く存在してしまう。 これにより、 全 てのレジスタを単一の命令ビット数で表現する方法は効率良く R OMを使用する ことに関して妨げとなる。
⑤ 更にまた、 メモリセルや論理演算素子から成るプログラマブル'ロジック 'デバイス (Programmable L ogic Device; P L D ) によりマイクロプロセッ サ等を構築しようとした場合に、 同一半導体チップ上に命令実行演算部を配置し、 その周辺部にレジスタアレイや、 R OM等を配置する方法が考えられる。 この場 合に、 プロセッサの多機能化の要求から命令実行プログラムが多くなると、 この プログラムを格納する R OMのメモリ容量が多く必要になる。 従って、 メモリセ ルが R OM構築に占有されてしまい、 多くのメモリセルをレジスタに割り当てる ことが困難になる。 発明の開示
本発明に係る第 1の演算処理装置は、 任意の演算プログラムに基づいて演算処 理をする装置である。 この演算処理装置には、 書込みアドレス及ぴ書込み制御信 号に基づいて任意の値を保持し、 及ぴ、 読出しアドレスに基づいて当該値を出力 するレジスタを複数有したレジスタアレイと、 このレジスタアレイから読み出さ れた値を演算する演算部と、 この演算部を動作させるための演算プログラムから 演算命令を解読する命令解読部と、 この命令解読部によつて解読された演算命令 を実行するためにレジスタアレイ及び演算部を制御する命令実行制御部とが備え られる。 この命令実行制御部は演算命令に基づいて一のレジスタを選択し、 ここ で選択されたレジスタが保持する値によって他のレジスタを選択するレジスタ相 対レジスタアドレッシング処理を実行するものである。
この第 1の演算処理装置によれば、 任意の演算プログラムに基づいて演算処理 をする場合に、 命令解読部では演算部を動作させるための演算プログラムから演 算命令が解読される。 命令解読部によって解読された演算命令を実行するために 命令実行制御部ではレジスタアレイ及び演算部を制御する。 これを前提にして、 命令実行制御部では、 演算命令に基づいて一のレジスタを選択し、 ここで選択さ れたレジスタが保持する値によつて他のレジスタを選択するレジスタ相対レジス タァドレッシング処理を実行するようになされる。 レジスタアレイの個々のレジ スタではレジスタ相対レジスタアドレツシング処理によつて指定される書込みァ ドレス及び書込み制御信号に基づいて任意の値を保持し、 及び、 読出しアドレス に基づいて当該値を出力するようになされる。 演算部ではレジスタアレイから読 み出された値を演算するようになされる。
従って、 レジスタアレイをデータの随時書込み及び読出し可能なメモリ (R A M) のように取り扱うことができるので、 従来方式の中央演算処理装置 (C P U) に比べて外部メモリの格納番地を指定するレジスタ相対メモリアドレツシン グ処理に依存しなくなる。 従来方式の C P Uの中に R AMや R O Mの機能を取り 込むことができるので、 高速演算処理を実行すること、 及び、 C P Uや、 R AM、 R OM等を個々に基板に配置する場合に比べて基板占有面積を低減することがで きる。 当該演算処理装置が適用される応用装置のコンパクト化を図ることができ る。 しかも、 同一半導体チップ上に、 レジスタアレイや読出し専用メモリをメモ リセルにより構成し、 演算部、 命令解読部及び命令実行制御部を算術論理演算素 子により構成することで、 当該演算処理装置をプログラマブル 'ロジック ·デパ イスによって構成することができる。
本発明に係る各々の演算処理装置の構築方法は、 任意の演算プログラムに基づ いて演算処理をする装置を構築する方法である。 この構築方法では、 予め同一半 導体チップ上に複数のメモリセル及び算術論理演算素子を形成し、 メモリセルを 組み合わせてレジスタァレイ及ぴ読出し専用メモリを画定すると共に、 算術論理 演算素子を組み合わせて演算部、 命令解読部及び命令実行制御部を画定し、 その 後、 レジスタアレイ、 読出し専用メモリ、 演算部、 命令解読部及び命令実行制御 部を予め設定された配線情報に基づいて結線すると共に、 読出し専用メモリに任 意の演算プログラムを書込むようになされる。
本発明に係る演算処理装置の構築方法によれば、 例えば、 電源オンと共に不揮 発性の記憶部から読み出された配線情報に基づいてレジスタアレイ、 読出し専用 メモリ、 演算部、 命令解読部及び命令実行制御部を結線するようになされる。 従 つて、 命令実行制御部で演算命令に基づいて一のレジスタを選択し、 このレジス タが保持する値によって他のレジスタを選択するレジスタ相対レジスタアドレツ シング処理を実行するようなプログラム可能な演算処理装置を電源オンと共に構 築することができる。 しかも、 従来方式の C P Uの中に R AMや R OMの機能を 取り込んだ演算処理装置を構築することができ、 高速演算処理を実行すること、 及び、 C P Uや、 R AM、 R OM等を個々に基板に配置する場合に比べて基板占 有面積を低減することができる。 当該演算処理装置が適用される応用装置のコン パクト化を図ることができる。
本発明に係る第 1の演算処理方法は、 演算プログラムに基づいて任意の演算処 理をする方法である。 この演算処理方法では、 書込みアドレス及び書込み制御信 号に基づいて任意の値を保持し、 及び、 読出しアドレスに基づいて当該値を出力 するレジスタを複数準備し、 その後、 演算プログラムから演算命令を解読し、 演 算命令に基づいて一のレジスタを選択し、 ここで選択されたレジスタが保持する 値によつて他のレジスタを選択するレジスタ相対レジスタアドレツシング処理を 実行すると共に、 演算命令に基づいて他のレジスタを選択し、 ここで選択された 他のレジスタが保持する値とレジスタ相対レジスタアドレツシング処理によって 選択されたレジスタの値とを演算するようになされる。
この第 1の演算処理方法によれば、 演算プログラムに基づいて任意の演算処理 をする場合に、 複数のレジスタをデータの随時書込み及ぴ読出し可能なメモリの ように取り扱うことができるので、 従来方式の中央演算処理装置と外部メモリと 組み合わせた演算処理方法に比べてレジスタ相対メモリアドレツシング処理に依 存しなくなる。 これにより、 従来方式に比べて高速演算処理を実行できるように なる。
本発明に係る第 2の演算処理装置は、 レジスタ相対レジスタァドレッシング処 理を実行する演算プログラムに基づいて演算処理をする装置であって、 複数のレ ジスタと、 レジスタを使用する頻度に基づいて当該レジスタを指定する命令ビッ ト数が予め圧縮されると共に、 前記プログラムの命令構造の中にレジスタ種類が 記述された命令長の異なる圧縮プログラムを記憶する記憶部と、 この記憶部から 圧縮プログラムを読み出してレジスタ種類を解読し、 当該レジスタ種類に基づい てレジスタを指定するための命令ビット数を復元する命令解読部と、 この命令解 読部によつて復元された所定長さの命令に基づいてレジスタを指定して任意の演 算を実行する命令実行演算部とを備えるものである。 この第 2の演算処理装置によれば、 レジスタを使用する頻度に基づいて当該レ ジスタを指定する命令ビット数が予め圧縮されると共に、 当該プログラムの命令 構造の中にレジスタ種類が記述された命令長の異なる圧縮プログラムに基づいて レジスタ相対レジスタァドレッシング処理を実行する場合に、 記憶部には複数の レジスタ中から当該レジスタを指定するための圧縮プログラムが記憶される。 命 令解読部では、 この記憶部から圧縮プログラムを読み出してレジスタ種類が解読 され、 このレジスタ種類に基づいて当該レジスタを指定するための命令ビット数 が復元される。 これを前提にして、 命令実行演算部では命令解読部によって復元 された所定の命令長のプログラムに基づいてレジスタを指定して任意の演算を実 行するようになされる。 従って、 レジスタの使用頻度に応じて可変された命令の 長さの圧縮プログラムであって、 頻繁にアクセスするレジスタには短い長さの命 令がセットされた、 圧縮プログラムデータを記憶部に格納することができるので、 そのメモリ容量を低減することができる。 これにより、 メモリセルや論理演算素 子から成る P L Dによりプロセッサを構築する場合に、 R OMとして機能させる メモリセルの占有率を低減することができ、 その分のメモリセルをレジスタに多 く割り当てることができる。
本発明に係る第 2の演算処理方法は、 レジスタ相対レジスタァドレッシング処 理を実行する演算プログラムに基づいて演算処理をする方法である。 この演算処 理方法では、 レジスタを使用する頻度に基づいて、 当該レジスタを指定する命令 ビット数が予め圧縮される共に、 プログラムの命令構造の中にレジスタ種類が記 述された命令長の異なる圧縮プログラムを記憶し、 この圧縮プログラムを読み出 してレジスタ種類を解読し、 当該レジスタ種類に基づ 、てレジスタを指定するた めの命令ビット数を復元し、 ここで復元された所定長さの命令に基づいてレジス タを指定して任意の演算を実行するようになされる。
この第 2の演算処理方法によれば、 レジスタ相対レジスタアドレッシング処理 を実行する演算プログラムに基づいて演算処理をする場合に、 レジスタの使用頻 度に応じて可変された命令の長さの圧縮プログラムであって、 頻繁にアクセスす るレジスタには短い長さの命令がセットされた、 圧縮プログラムデータをメモリ 領域に格納することができるので、 そのメモリ容量を低減することができる。 こ れにより、 メモリセルや論理演算素子から成る P L Dによりプロセッサを構築す る場合に、 R OMとして機能させるメモリセルの占有率を低減することができ、 その分のメモリセルをレジスタに多く割り当てることができる。
本発明に係る演算処理システムは、 一方で、 所定のプログラム言語に基づいて レジスタ相対レジスタァドレッシング演算を実行するための命令を編集してプロ グラムを作成するプログラム作成装置と、 他方で、 当該プログラムと複数のレジ スタとを使用してレジスタ相対レジスタアドレツシング演算を実行する演算処理 装置とを有する演算処理システムである。 このプログラム作成装置は、 レジスタ を使用する頻度に基づいて当該レジスタを指定する命令ビット数を圧縮すると共 に、 当該プログラムの命令構造の中にレジスタ種類を記述して命令長の異なる圧 縮プログラムを作成する。 この演算処理装置は、 プログラム作成装置で作成され た圧縮プログラムを取得してレジスタ種類を解読し、 レジスタ種類に基づ V、て当 該レジスタを指定する命令ビット数を復元し、 所定長さの命令に基づいて複数の レジスタを指定して任意の演算を実行するものである。
この演算処理システムによれば、 一方で、 所定のプログラム言語に基づいてレ ジスタ相対レジスタァドレッシング演算を実行するための命令を編集してプログ ラムを作成し、 他方で、 当該プログラムと複数のレジスタとを使用してレジスタ 相対レジスタァドレッシング演算を実行する場合に、 プログラム作成装置ではレ ジスタを使用する頻度に基づいて当該レジスタを指定する命令ビット数を圧縮す ると共に、 当該プログラムの命令構造の中にレジスタ種類を記述して命令長の異 なる圧縮プログラムが作成される。 演算処理装置では、 プログラム作成装置で作 成された圧縮プログラムを取得してレジスタ種類を解読し、 このレジスタ種類に 基づいて当該レジスタを指定する命令ビット数を復元し、 所定長さの命令に基づ いて複数のレジスタを指定して任意の演算が実行される。 従って、 プログラム作 成系ではレジスタの使用頻度に応じて命令の長さを可変できるので、 頻繁にァク セスするレジスタに短い長さの命令をセットすることができる。 これにより、 プ ログラム実行系では R OM等に圧縮した命令をセットすることができ、 プロダラ ムデータを格納する R OM等のメモリ容量を低減することができる。 また、 メモ リセルや論理演算素子から成る P L Dによりプロセッサを構築する場合に、 R O Mとして機能させるメモリセルの占有率を低減することができ、 その分のメモリ セルをレジスタに多く割り当てることができる。
本発明に係る第 3の演算処理方法は、 プログラム作成系で所定のプログラム言 語に基づいてレジスタ相対レジスタアドレツシング演算を実行するための命令を 編集してプログラムを作成し、 プログラム実行系で当該プログラムと複数のレジ スタとを使用してレジスタ相対レジスタアドレツシング演算を実行する演算処理 方法である。 プログラム作成系では、 レジスタを使用する頻度に基づいて当該レ ジスタを指定する命令ビット数を圧縮すると共に、 当該プログラムの命令構造の 中にレジスタ種類を記述して命令長の異なる圧縮プログラムを作成し、 プログラ ム実行系では、 プログラム作成系で作成された圧縮プログラムを取得してレジス タ種類を解読し、 ここで解読されたレジスタ種類に基づいて当該レジスタを指定 する命令ビット数を復元し、 ここで復元された所定長さの命令に基づいて複数の レジスタを指定して任意の演算を実行するようになされる。
この第 3の演算処理方法によれば、 プログラム作成系で所定のプログラム言語 に基づいてレジスタ相対レジスタアドレツシング演算を実行するための命令を編 集してプログラムを作成し、 プログラム実行系で当該プログラムと複数のレジス タとを使用してレジスタ相対レジスタァドレッシング演算を実行する場合に、 プ ログラム作成系ではレジスタの使用頻度に応じて命令の長さを可変できるので、 頻繁にアクセスするレジスタに短い長さの命令をセットすることができる。 従つ て、 プログラム実行系では R OM等に圧縮した命令をセットすることができ、 プ 口グラムデータを格納する R OM等のメモリ容量を低減することができる。 また、 メモリセルゃ論理演算素子から成る P L Dによりプロセッサを構築する場合に、 R OMとして機能させるメモリセルの占有率を低減することができ、 その分のメ モリセルをレジスタに多く割り当てることができる。 図面の簡単な説明
図 1は、 本発明に係る第 1の実施例としての演算処理装置 1 0 0の構成例を示 すブロック図である。
図 2は、 レジスタアレイ 1 1の内部構成例を示すプロック図である。 図 3 A〜図 3 Eは演算処理装置 100で取り扱う命令の構造例を示すフォーマ ット等である。 図 3Aは 1 o a d、 a d d及び c m p命令の構造例、 図 3Bは j ump命令の構造例、 図 3 Cは命令の構造例、 図 3Dはアクセス方法の内容例及 ぴ図 3 Eはフラグ状態の内容例である。
図 4は、 ROMセル 14の演算プログラムによる演算命令の例を示す表図であ る。
図 5は、 レジスタ r 0〜r 12等の状態例を示す図である。
図 6は、 演算処理装置 100の動作例を示すフローチャートである。
図 7は本発明に係る第 2の実施例としての演算処理装置 100の構築例を示す 半導体チップの平面図である。
図 8は、 演算処理装置 100のレイァゥト構築例を示す平面図である。
図 9は、 演算処理装置 100の配線構築例を示す図である。
図 10は、 フラッシュメモリ 70に格納される配線情報例を示す表図である。 図 11は、 演算処理装置 100における結線例を示す図である。
図 12は演算処理装置 100の回路搆築例を示す回路接続図である。
図 13は、 本発明に係る第 3の実施例としての演算処理システム 10の構成例 を示すブロック図である。
図 14は、 演算処理システム 10における処理例を示すフローチヤ一トである。 図 15は、 本発明に係る第 4の実施例としてのマイクロプロセッサ 101の構 成例を示すプ口ック図である。
図 16は、 レジスタアレイ 1 1' の内部構成例を示すブロック図である。
図 17 〜図1 7 Eはマイクロプロセッサ 101で取り扱う命令の構造例を示 すフォーマットでぁる。 図17 は命令形態#? 1に係る 1 0 & (1、 a d d、 c mp命令の構造例、 図 1 7Bは命令形態 #F 2に係る 1 o a d、 a d d, cmp 命令の構造例、 図 1 7Cは命令形態 #F 3に係る 1 o a d、 a d d, cmp命令 の構造例、 図 1 7Dは命令形態 # F4に係る 1 o a d、 a d d, cmp命令の構 造例及び、 図 17 Eは命令形態 # F 5に係る j ump命令の構造例を各々示して いる。
図 18 〜図1 8 Dは命令構造における記述内容例を示す表図である。 図 18 Aは命令の構造例、 図 1 8 Bはアクセス方法 # 1 , # 2の内容例、 図 1 8 Cはレ ジスタ種類 1, 2の内容例及び、 図 1 8 Dはフラグ状態の内容例を各々示してい る。
図 1 9は、 プログラム作成系 Iにおけるプログラム作成例を示す表図である。 図 2 0は、 プログラム作成装置 2 0 0におけるコンパイル例を示すフローチヤ ート (メインルーチン) である。
図 2 1は、 コンパイラにおける代入及ぴ演算処理例を示すフローチャート (サ ブルーチン) である。
図 2 2は、 復元された演算プログラムによる演算命令の例を示す表図である。 図 2 3は、 r 0, r 1 · · · · r 3 2 , r 3 3 , r 3 4 , r 3 5等のレジスタ の状態例を示す図である。
図 2 4は、 外部メモリ 2におけるデータ格納例を示す図である。
図 2 5は、 マイクロプロセッサ 1 0 1における動作例を示すフローチャートで め 。
図 2 6 A及ぴ図 2 6 Bは、 命令ビット復元デコーダ 1 3における処理例を示す フローチャートである。
発明を実施するための最良の形態
この発明は、 従来の課題を解決したものであって、 C P Uや、 R AM、 R OM 等の機能を 1チップに集合化する場合に、 レジスタの集合体をデータの随時書込 み及び読出し可能なメモリのように動作できるようにすると共に、 これらの機能 部品等を個々に基板に配置する場合に比べて基板占有面積を低減できるようにし た演算処理装置、 その構築方法、 演算処理システム及び演算処理方法を提供する ことを目的とする。
更にこの発明は、 レジスタの使用頻度に応じて命令の長さを可変できるように すると共に、 頻繁にアクセスするレジスタには短い長さの命令をセットできるよ うにし、 プログラムデ一タを格納する R OM等のメモリ容量を低減できるように した演算処理装置、 その構築方法、 演算処理システム及び演算処理方法を提供す ることを目的とする。 続いて、 この発明に係る演算処理装置、 その構築方法、 演算処理システム及び 演算処理方法の一実施の形態について、 図面を参照しながら説明をする。
( 1 ) 第 1の実施例
図 1は本発明に係る第 1の実施例としての演算処理装置 1 0 0の構成例を示す ブロック図である。
この実施例では演算命令を実行するためのレジスタァレイ及ぴ演算部を制御す る命令実行制御部を備え、 演算命令に基づいて一のレジスタを選択すると共に、 このレジスタが保持する値によつて他のレジスタを選択するレジスタ相対レジス タァドレッシング処理を実行して、 レジスタァレイをデータの随時書込み及ぴ読 出し可能なメモリ (R AM) のように動作できるようにすると共に、 C P Uや、 R AM, R OM等を個々に基板に配置する場合に比べて基板占有面積を低減でき るようにしたものである。
図 1に示す演算処理装置 1 0 0はプログラム可能な 1チップマイクロコンピュ ータ等に適用して好適なプロセッサであり、 任意の演算プログラムに基づいて演 算処理をするものである (第 1の演算処理装置) 。 この例で演算処理装置 1 0 0 はプログラマブル-ロジック ·デバイスを構成し、 同一半導体チップ上に形成さ れたメモリセル及ぴ算術論理演算素子を配線情報に基づいて結線し、 複数のメモ リセルによりレジスタアレイ 1 1、 及ぴ R OMセル 1 4を構成し、 複数の算術論 理演算素子により A L U 1 2、 デコーダ 1 3及び命令実行制御部 5 0を構成した ものである。 演算処理装置 1 0 0はインタフェース 6 0を通じて外部のシステム バス等に接続される。
演算処理装置 1 0 0はレジスタアレイ 1 1を有している。 レジスタアレイ 1 1 は複数のレジスタを有しており、 各々のレジスタは書込みァドレス Aw及び書込 み制御信号 S wに基づいて任意の値を保持し、 及び、 読出しアドレス A rに基づ いて被数 Xや加数 Y等の値を出力するようになされる。 レジスタアレイ 1 1には 例えば、 8 1 9 2個 X 3 2 b i tのレジスタが設けられる。 このレジスタアレイ 1 1には演算部の一例となる算術論理演算ユニット (Arithmetic and Logic Unit:以下で A L Uという) 1 2がデータ信号線 L 2 0を通じて接続されており、
L 1の中で指定されたレジスタから読み出された Xや Y等の値を 演算するようになされる。 演算結果の値は Zである。 演算種目は足し算、 かけ算、 引き算、 わり算等である。 演算種目は命令実行制御部 50から出力される ALU 制御信号 S 35に基づいて設定される。 データ信号線 L 20には、 ALU12の 他にラッチ回路 58、 51 1、 セレクタ 56、 57、 59等が接続されている。 データ信号線 L 20には DATA、 被数 X値、 加数 Y値等が伝送される。
この演算処理装置 100には ALU12を動作させるために命令解読部 (以下 でデコーダという) 13が備えられている。 デコーダ 1 3には読出し専用メモリ (ROMセル) 14が接続されており、 ALU 12の演算動作に必要な演算プロ グラム APが機械語の命令 (Instruction) で格納される。 ROMセル 14はプ ログラムカウンタ 54からのカウント出力信号 S 5に基づいて演算プログラム A Pを出力するようになされる。 ROMセル 14もプロセッサ内部に実装される。 デコーダ 13では、 予め準備された演算プログラム APから演算命令を解読す るようになされる。 例えば、 デコーダ 1 3は ROMセル 14から読み出された機 械語の命令を解読して命令制御信号 S 4、 命令信号 S 9及ぴ各引数信号 S 10を 発生するようになされる。 命令信号 S 9には 1 o a d命令、 a d d命令、 cmp 命令、 j ump命令が含まれる。 各引数信号 S 10にはアクセス方法 # 1, ァク セス方法 # 2, レジスタ番号 r O, r 1 · · .等、 フラグ状態 (flag
condition) 及びジャンプアドレス等が含まれる。 命令制御信号 S 4は命令読出し ステートマシーン 52に出力される。 この演算プログラム APには、 レジスタ相 対レジスタアドレッシング処理を実行するため 演算命令を含んでいる。 レジス タ相対レジスタアドレツシング処理とは演算命令に基づいて一のレジスタを選択 し、 ここで選択されたレジスタが保持する値によって他のレジスタを選択する処 理をいう。 この処理はアクセス方法 # 1によって実行される。
デコーダ 13には命令実行制御部 50が接続されており、 デコーダ 1 3によつ て解読された演算命令を実行するためにレジスタアレイ 1 1及ぴ ALU12を制 御するようになされる。 命令実行制御部 50は実行ステートマシーン 51、 命令 読出しステートマシーン 52、 セレクタ 53、 プログラムカウンタ (PC) 54、 + 1インクリメンタ 55、 第 1のセレクタ 56、 第 2のセレクタ 57、 入力用の セレクタ 5 9、 ラッチ回路 58、 5 10、 5 1 1を有しており、 レジスタ相対レ ジスタアドレッシング処理を実行するようになされる。 命令読出しステートマシ ーン 5 2ではデコーダ 1 3から出力される命令制御信号 S 4に基づいてプロダラ ムカウンタ 5 4及ぴ実行ステートマシーン 5 1を制御する。 例えば、 当該マシー ン 5 2はデコーダ 1 3から命令信号 S 9及び各引数信号 S 1 0が実行ステートマ シーン 5 1へ出力されると共に命令実行開始信号 S 2 9を出力する。
実行ステートマシーン 5 1には A L U 1 2、 セレクタ 5 6、 5 7、 5 9、 ラッ チ回路 5 8 , 5 1 0、 5 1 1が接続されている。 セレクタ 5 6の出力は読出しァ ドレス線 L 1 4を介在してレジスタアレイ 1 1に接続され、 その入力はデータ信 号線 L 2 0及ぴァドレス信号線 L 3 3に各々接続されている。 読出しァドレス A r又は読出し実行アドレス A rのいずれかを選択するためである。 セレクタ 5 7 の出力は書込みァドレス線 L 1 3を介在してレジスタアレイ 1 1に接続され、 そ の入力はデータ信号線 L 2 0及ぴァドレス信号線 L 3 4に各々接続されている。 書込みァドレス A w又は書込み実行ァドレス Awのいずれかを選択するためであ る。 当該マシーン 5 1では命令実行開始信号 S 2 9に基づいて命令の実行を開始 する。 例えば、 データの書込み時には、 書込み制御信号 S wがレジスタアレイ 1 1に出力され、 セレクタ 5 9には選択制御信号 S 2 4が出力される。 データの読 出し時には、 選択制御信号 S 3 2がセレクタ 5 6に出力されると共に、 読出しァ ドレス A rが出力される。 演算時には、 ラッチ制御信号 S 3 4がラッチ回路 5 8 に出力され、 ラッチ回路 5 1 0にはラッチ制御信号 S 3 8が出力される。 当該プ 口セッサ外部には外部制御信号 S 1 6が出力される。 命令の実行が終了すると、 実行ステートマシーン 5 1は命令読み出しステートマシーン 5 2へ実行終了信号 S 2 6を出力し、 プログラムカウンタ 5 4の値を進めるようになされる。
この実行ステートマシーン 5 1及び命令読み出しステートマシーン 5 2にはセ レクタ 5 3が接続されており、 選択制御信号 S 2 8に基づいてインクリメント出 力信号 S 7又は分岐制御信号 S 2 7のいずれか一方を選択し、 これをセレクタ出 力としてプログラムカウンタ 5 4に出力するようになされる。 選択制御信号 S 2 8は実行ステートマシーン 5 1から供給される。 インクリメント出力信号 S 7は インクリメンタ 5 5からセレクタ 5 3へ出力される。 プログラムカウンタ 5 4で はカウント制御信号 S 3 0に基づいて R OMセル 1 4から演算プログラム A Pを 読み出す場所が指定される。 + 1インクリメンタ 5 5はプログラムカウンタ 5 4 のカウント出力信号 S 5を 「+ l j してインクリメンとするようになされる。 力 ゥント制御信号 S 3 0は命令解読ステートマシーン 5 2から供給される。
この例で実行ステートマシーン 5 1に接続されたセレクタ 5 6では、 —のレジ スタを選択するための読出し実行ァドレス A r又は当該レジスタを再度選択する ための読出しァドレス A rのいずれか一方を選択するようになされる。 セレクタ 5 6は実行ステートマシーン 5 1からの選択制御信号 S 3 2によっていずれか一 方のァドレスを選択するようになされる。 読出し実行ァドレス A rは実行ステー トマシーン 5 1からセレクタ 5 7に出力される。 読出しァドレス A rはレジスタ アレイ 1 1から出力される。 セレクタ 5 6の他に実行ステートマシーン 5 1には セレクタ 5 7が接続されており、 一のレジスタを選択するための書込み実行アド レス Aw又は当該レジスタを再度選択するための書込みァドレス Awのいずれか 一方を選択するようになされる。 セレクタ 5 7は実行ステートマシーン 5 1から の選択制御信号 S 3 1によっていずれか一方のアドレスを選択するようになされ る。 書込み実行ァドレス Awは実行ステートマシーン 5 1からセレクタ 5 7に出 力される。 書込みァドレス Awはレジスタアレイ 1 1から出力される。
セレクタ 5 9はデータバス 1 9 A、 レジスタアレイ 1 1及ぴ A L U 1 2に接続 されており、 データバス 1 9 Aから取り込んだデータ (DATA) 、 レジスタアレイ 1 1から出力される被数 X値 (加数 Y値) 又は A L U 1 2から出力される演算結 果値 Zのいずれかを選択制御信号 S 2 4に基づいて入力制御するようになされる。 ラッチ回路 5 8はレジスタアレイ 1 1の読出しポートと A L U 1 2の間に接続さ れており、 ラッチ制御信号 S 3 4に基づいてレジスタ r iの出力値 Xをラッチす るようになされる。 ラッチ回路 5 1 0は A L U 1 2の比較出力部等に接続されて おり、 ラッチ制御信号 S 3 8に基づいて一致検出信号 S 2 2をラッチして、 フラ グ状態 (flag condition) 信号 S 2 3を出力するようになされる。 ラッチ回路 5 1 1はレジスタアレイ 1 1の読出しポートとァドレスバス 1 9 Bとの間に接続さ れており、 ラッチ制御信号 S 1 7に基づいて外部アドレス (address) をラッチす るようになされる。
なお、 実行された命令によってジャンプ (命令分岐) が発生した場合は、 ジャ ンプ先のァドレスを示す分岐制御信号 S 27を実行ステ一トマシン 5 1からセレ クタ 53へ出力される。 セレクタ 53では選択制御信号 S 28に基づいてその分 岐制御信号 S 27を選択し、 この分岐制御信号 S 27をプログラムカウンタ 54 へ書き込むようになされる。 また、 実行ステートマシーン 51にはコントロール パス 1 9 Cが接続され、 外部制御信号 S 16を外部へ出力するようになされる。 これは外部周辺機器を制御するためである。
図 2はレジスタアレイ 11の内部構成例を示すブロック図である。 図 2に示す レジスタアレイ 1 1によれば、 例えば、 8192個の 32 b i tのレジスタ r 0 〜r n ( i =0〜n ; 81 91) が備えられ、 各々のレジスタ r 0〜r nの入力 には書込みポート 15が接続されている。 1 b i tのレジスタは D型のフリップ • フロップ回路等から構成される。 書込みポート 15は図 1に示したセレクタ 5 9に接続されており、 書込み制御信号 Sw及ぴ書込みァドレス Awに基づいて、 データパス 19 Aから取り込んだデータ (DATA) 、 レジスタアレイ 1 1から出力 される被数 X値 (加数 Y値) 又は ALU 12から出力される演算結果値 Zのいず れかをレジスタ r 0〜r nに書き込むようになされる。 書込みポート 15は書込 みアドレス線 L 13を介在して図 1に示したセレクタ 57に接続されている。 書 込み実行ァドレス Aw又は書込みァドレス Awを供給するためである。
各々のレジスタ r 0〜r nの出力には読出しポート 16が接続されている。 読 出しポート 16はデータ信号線 L 20を通じて図 1に示した ALU 12、 ラッチ 回路 58、 51 1、 セレクタ 56、 57、 59等に接続されており、 読出しアド レス A rに基づいて指定されたレジスタ r iからデータ (DATA) を読み出すよう になされる。 読出しポート 16は読出しァドレス線 L 14を介在して図 1に示し たセレクタ 56に接続されている。 読出し実行ァドレス A r又は読出しァドレス A rを供給するためである。 書込みアドレス線 L 13を介在して図 1に示したセ レクタ 57に接続されている。 書込み実行ア ドレス Aw又は書込みアドレス Aw を供給するためである。
次に、 演算処理装置 100で取り扱う命令の構造例を示すフォーマツト等につ いて説明をする。 図 3 Aに示すフォーマットによれば、 命令は 32ビットの固定 長であり、 大きく分けて 1 o a d命令や、 a d d命令、 cmp命令等と; j ump 命令とによって取り扱われる。 l o a d、 a d d及び c m p命令においては、 最 初の 2ビットが命令の種類を表している。 命令は図 3 Cに示すように 4種類であ る。 命令は図 3 Cにおいて、 コード 「0」 で 1 o a dを示し転送命令、 コード 「1」 で a d dを示し加算命令、 コード 「2」 で c m pを示し比較命令である。 コード 「3」 は j u m pで分岐命令を示している。 c m p命令に関しては比較結 果が同じであった場合は、 図 1に示したラッチ回路 5 1 0のフラグ状態信号 S 2 3に基づいて zero flagが 1にセットされ、 同じでなかった場合は 0がセットされ る。
図 3 Aに示す命令に続く 2ビットにはアクセス方法 # 1が記述され、 それに続 く 2 b i tにはアクセス方法 # 2が記述される。 Operandは左がアクセス方法 # 1、 レジスタ番号 1で表され、 右がアクセス方法 # 2、 レジスタ番号 2で表される。 つまり、 アクセス方法 # 1はレジスタ番号 1で示されるレジスタ r iのアクセス 方法を示しており、 アクセス方法 # 2はレジスタ番号 2で示されるレジスタ r i のアクセス方法を示している。 アクセス方法 # 1とアクセス方法 # 2はそれぞれ レジスタ番号 N o . 1、 レジスタ番号 N o . 2に対応し、 これらの間で処理が行 われる。
いずれも、 図 3 Dに示すようにアクセス方法は 4種類が準備されている。 図 3 Dにおいて、 コード 「0」 は 「レジスタ直接」 でレジスタ番号で示されるレジス タ r iの値を直接用いることを示している。 コード 「1」 は 「レジスタ相対レジ スタ」 でレジスタ番号で示されるレジスタの値を再度レジスタ番号と解釈し、 そ のレジスタ番号で示されるレジスタの値を用いることを示している。 コード 「2」 は 「レジスタ相対外部」 でレジスタ番号で示されるレジスタ値を外部アド レスとして扱い、 当該演算処理装置 1 0 0の外部に対してアクセスをすることを 示している。 コード 「3」 は未使用である。 アクセス方法 # 1とアクセス方法 # 2はそれぞれレジスタ番号 1、 レジスタ番号 2に対応し、 これらの間で処理が行 われる。 例えば、 レジスタ番号 1は被数を保持するレジスタ r iを示し、 レジス タ番号 2は加数を保持するレジスタ r iを示す。
また、 図 3 Bに示す j u m p命令のフォーマットによれば、 最初の 2 b i tに 命令が記述され、 続く 2 b i tにはフラグ状態 (flag condition) が記述される。 続く 28 b i tにはジャンプアドレスが記述される。 フラグ状態は図 3 Eに示す ように、 命令実行制御を移すかどうかの判断をするための条件である。 コード 「0」 は 「無条件」 で常に制御を移す。 コード 「1」 は 「zero flagj で zero flagが 「1」 である場合に、 制御を移す。 コード 「2」 は 「non- zero flagj で zero flagが 「0」 である場合に制御を移すようになされる。 コード 「3」 は未使 用である。
図 4は R OMセル 14の演算プログラム A Pによる演算命令の例を示す表図で ある。 図 5はレジスタ r 0〜r 12等の状態例を示す図である。 この例ではレジ スタアレイ 1 1の 1 3個のレジスタ r i ( i = 0〜 1 2) のいずれかを使用して、 そのレジスタ r iに格納された値に 「1」 を加算し、 そのレジスタ r iの値が示 す任意のレジスタに演算結果を格納する場合を想定する。 図 4に示す演算命令 (Instruction) # 1 1〜# I 4は ROMセル 14の演算プログラム A Pに記述 されたものである。
各々の演算命令 # I 1〜# I 4には、 ユーモニックによる表現、 機械語による 表現及び処理の内容が示されている。 図 4に示す演算命令 # I 1は図 3 Aに示し た命令構造において、 機械語で 5001400 B hによって表される a d d
[r 10] , r 1 1であり、 レジスタアレイ 1 1の r 10で示されるレジスタ番 号のレジスタ r 10の値に、 r 10で示されるレジスタ番号のレジスタ r 1 1の 値を加算し、 その結果を r 10で示されるレジスタ番号のレジスタ r 10に格納 する内容である。
演算命令 # I 2は機械語で 4001400 B hによって表される a d d r 1 0, r 1 1であり、 レジスタ r 10の値にレジスタ r 1 1の値を加算してその演 算結果をレジスタ r 10に書き戻す内容である。 演算命令 # I 3は機械語で 80 0 1400 Chによって表される cmp r 10, r l 2であり、 レジスタ r 1 0の内容とレジスタ r 1 2の内容とを比較し、 同じ値の場合は zero flagに 「1」 をセットし、 異なっている場合は 「0」 にセットする内容である。 命令 # 14は 機械語で E 000000 Ohによって表される j ump n z, LOOPであり、 zero flagが 「0」 の場合は、 LOOPで示されるラベルへ制御を移す内容である。 図 5に示すレジスタアレイ 1 1の 13個のレジスタ状態例によれば、 レジスタ r 0〜r 1 0の初期値はいずれも 「0」 であり、 レジスタで 1 1の初期値は 「1」 、 レジスタ r 1 2の初期値は 「1 0」 である。 図 4に示した命令 # 1 1を 実行する場合、 図 5に示すレジスタ r 1 0の値は 「0」 であるので、 レジスタ r 0が選択される。 そのレジスタ r 0の値である 「0」 が読出しポート 1 6に読み 出され、 続いてレジスタ r 1 1の値である 「1 J が読出しポート 1 6に読み出さ れ、 これらの値が加算され、 その演算結果である 「1」 がレジスタ r Oに格納さ れる。 これにより、 レジスタ r Oの値が 「1」 ずつ増加するようになされる。 こ の例ではレジスタ r 1 2の値である 1 0回まで加算処理が繰り返される。
図 4に示した命令 # I 2を実行する場合は、 図 5に示すレジスタ r 1 0の値で ある 「0」 にレジスタ r 1 1の値である 「1」 が加算され、 その演算結果の
「1」 がレジスタ r 1 0に格納される。 これにより、 次のレジスタへ処理が移る ようになされる。 図 4に示した命令 # I 3を実行する場合、 zero flagの値がラッ チ回路 5 1 0によって保持され、 以降の命令によって参照される。 これを前提に してレジスタ r 1 0の値 「0」 とレジスタ r 1 2の値である 「1 0」 とが比較さ れる。
この例では、 レジスタ r 1 0の値 「0」 とレジスタ r 1 2の値 「1 0 J とが異 なるので、 zero flagには 「0」 がセットされる。 zero flagに 「1 J がセットさ れるのは、 レジスタ r 1 0の値 「1 0」 とレジスタ r 1 2の値 「1 0」 とが一致 した場合である。 図 4に示した命令 # I 4を実行する場合、 zero flagが 「 0 j な ので制御を命令 # I 1に移す (LOOP) 。 上記の動作が 1 0回、 繰り返されるとレ ジスタ r 1 0の値が 「1 0」 になり、 レジスタ r 1 0の値 「1 0」 とレジスタ r 1 2の値 「1 0」 とが一致するので、 命令 # I 3により zero flagが 「 1」 にセッ トされ、 命令 # I 4で制御が命令 # I 1に移らなくなり、 演算処理が終了する。 続いて、 本発明に係る第 1の演算処理方法について当該演算処理装置 1 0 0の 動作例を説明する。 図 6は演算処理装置 1 0 0の動作例を示すフローチャートで ある。
この実施例では、 図 4に示した演算命令 # I 1〜# I 4を形成する演算プログ ラム A Pに基づいて加算処理を実行する場合を想定する。 もちろん、 演算処理装 置 1 0 0には書込みァドレス Aw及び書込み制御信号 S wに基づいて任意の値を 保持し、 及び、 読出しアドレス A rに基づいて当該値を出力するレジスタアレイ 1 1が予め準備されている場合を前提とする。 レジスタアレイ 1 1のレジスタ状 態については、 図 5に示したように、 例えば、 1 3個のレジスタ r 0〜r 1 0の 初期値がいずれも 「0」 であり、 レジスタ r 1 1の初期値が 「1」 、 レジスタ r 1 2の初期値が 「1 0」 である。 これらの初期値を書き込む場合は、 実行ステー トマシーン 5 1ではァドレス信号線 L 3 4に書き込みァドレス Awが出力され、 セレクタ 5 7が選択制御信号 S 3 1に基づいてレジスタ r 1 0、 レジスタ r 1 1 及びレジスタ r 1 2を選択することで、 その初期値 「0」 、 「1」 、 「1 0」 カ 設定される。
これを動作条件にして、 図 6に示すフローチャートのステップ A 1で、 まず、 デコーダ 1 3は ROMセル 1 4から演算プログラム (機械語命令) APを受け取 り、 演算プログラム APを解読して演算命令 # I 1〜# I 4を検出する。 このと き、 デコーダ 1 3では図 4で説明した機械語の 5 0 0 1 4 0 0 B hによって示さ れる a d d [ r 1 0] , r 1 1に係る演算命令 # I 1や、 機械語で 4 00 1 4 00 B hによって表される a d d r l O, r 1 1に係る演算命令 # I 2、 機械 語で 8 0 0 1 4 0 0 C hによって表される c mp r 1 0, r 1 2に係る演算命 令 # I 3、 機械語で E 0 0 0 0 0 0 Ohによって表される j ump n z , LO OPに係る演算命令 # I 4を検出し、 これらの演算命令 # I 1〜# I 4力 ら、 命 令制御信号 S 4、 命令信号 S 9及び各引数信号 S 1 0が生成され、 これらの信号 S 9及び S 1 0が実行ステートマシーン 5 1に出力するようになされる。 命令信 号 S 9には l o a d命令、 a d d命令、 c mp命令、 j ump命令が含まれる。 各引数信号 S 1 0にはアクセス方法 # 1, アクセス方法 # 2, レジスタ番号 r 0, r 1 · · '等、 フラグ状態 (flag condition) 及びジャンプアドレス等が含まれ る。 命令制御信号 S 4はデコーダ 1 3から命令読出しステートマシーン 5 2に出 力される。
その後、 ステップ A 2で実行ステートマシーン 5 1は命令読出しステートマシ ーン 5 2の命令読出し制御を受けて演算命令 # I 1を受け取り、 5 0 0 1 4 0 0 B hによって示される a d d [r l O] , r 1 1に基づいて一のレジスタ r 1 0を選択する。 このとき、 アドレス信号線 L 3 3にレジスタの番号 「1 0」 を出 力する。 選択制御信号 S 3 2を用いてセレクタ 5 6がァドレス信号線 L 3 3を選 択するようにする。 これにより、 読出しアドレス線 L 1 4にレジスタ番号 「1 0」 が出力される。 この値 「1 0」 はレジスタアレイ 1 1でレジスタ番号 1 0の レジスタで 1 0を読み出すァドレス A rとして用いられる。 レジスタアレイ 1 1 ではレジスタ r 1 0が選択される。 レジスタ r 1 0の値は 「0」 である。
そして、 ステップ A 3でレジスタ r 1 0が保持する値 「0」 によってレジスタ 相対レジスタアドレッシング処理を実行する。 このとき、 レジスタ r 1 0の値 「0」 は読出しポート 1 6からデータ信号線 L 2 0に出力するようになされる。 他のレジスタ r 0を選択するためである。 これにより、 レジスタアレイ 1 1から データ信号線 L 2 0に出力されたレジスタ r 0の値 「0」 はラッチ回路 5 8で保 持される。 これと共に、 実行ステートマシーン 5 1は選択制御信号 S 3 2に基づ いてデータ信号線 L 2 0を選択するようなされる。 これにより、 セレクタ 5 6は 読み出しァドレス線 L 1 4にレジスタ r 1 0の値 「0」 を出力するようになる。 レジスタアレイ 1 1ではレジスタ r 0が選択される。
そして、 ステップ A 4に移行して演算命令 # I 1に基づいて他のレジスタ r 1 1を選択する。 このとき、 実行ステートマシーン 5 1は選択制御信号 S 3 2をセ レクタ 5 6に出力してセレクタ 5 6により読出し実行ァドレス A rを選択するよ うにする。 これ共に、 アドレス信号線 L 3 3に読出し実行アドレス A rとして値 「 1 1」 を出力する。 この値 「1 1 J はレジスタアレイ 1 1でレジスタ番号 「1 1」 のレジスタ r 1 1を読み出すアドレスとして用いられる。 レジスタ r 1 1の 値は 「1」 である。 これにより、 読出しアドレス A rに基づいてレジスタ r 1 1 が選択される。 この選択によって読出しポート 1 6からデ タ信号線 L 2 0ヘレ ジスタ r 1 1の出力値である Y値- 「1」 を出力するようになされる。 これらの 操作により、 データ信号線 L 2 0に出力されたレジスタ r 1 1の Y値- 「1」 と、 ラッチ回路 5 8の出力である X値- 「0」 とが A L U 1 2に入力される。 つまり、 レジスタ r 1 0が保持する値 「0」 によって指定されたレジスタ r 0の X値 = 「0」 (レジスタ相対レジスタァドレッシング処理によって選択されたレジスタ r Oの値) とレジスタ r l lの 値= 「1」 とが A L U 1 2に入力される。
そして、 ステップ A 5でレジスタ r 1 1が保持する丫値= 「1」 とレジスタ相 対レジスタアドレッシング処理によって選択されたレジスタ r 0の X値 = 「0」 とが A L U 1 2によって加算するようになされる。 このとき、 A L U 1 2には加 算命令を示す演算命令信号 S 3 5が入力されている。 これにより、 A L U 1 2で は X = 「0」 値に Y値- 「1」 を加算し、 その加算結果値 Z = 「1」 を演算結果 信号 S 2 1としてセレクタ 5 9に出力するようになされる。
そして、 ステップ A 6で機械語で 4 0 0 1 4 0 0 B hによって表される演算命 令 # I 2に基づいて演算結果値 Zがセレクタ 5 9によって選択される。 このとき、 セレクタ 5 9では選択制御信号 S 2 4により演算結果値 Zを選択するようにセッ トされる。 演算結果値 Zがレジスタアレイ 1 1に入力される。 レジスタアレイ 1 1ではレジスタ相対レジスタァドレツシング処理によつて指定されるレジスタ r 0に、 書込みァドレス Aw及び書込み制御信号 S wに基づいて演算結果値 Zを格 納するようになされる。 つまり、 レジスタ r 1 0が指定するレジスタ r 0に A L U 1 2の演算結果値 Zを書き戻す場合は、 まず、 実行ステートマシーン 5 1はァ ドレス信号線 L 3 3には書込み実行アドレス Awとして値 「1 0」 を出力する。 このとき、 読出し用のセレクタ 5 6には選択制御信号 S 3 2を出力してアドレス 信号線 L 3 3を選択するようにされる。
そして、 レジスタアレイ 1 1の読出しポート 1 6にはレジスタ r 1 0の値 「0」 が出力されるので、 今度は、 書込み用のセレクタ 5 7には選択制御信号 S 3 1を出力してデータ信号線 2 0を選択するようにされる。 この選択によってレ ジスタアレイ 1 1の読出しポート 1 6からセレクタ 5 7を通じてレジスタ r 0を 選択する値 「0」 が書き込みアドレス Awとしてレジスタアレイ 1 1に入力され る。 ここまででレジスタアレイ 1 1には書き込みアドレス Awと書き込む内容が 入力される。 その後、 実行ステートマシーン 5 1は書き込み信号 S Wを用いて実 際に値の書き込みを指示する。 このようにして、 演算命令 # I 1の a d d [ r 1 0 ] , r 1 1を演算することができる。
この例では、 ステップ A 7でレジスタ r 1 2が示す値 = 1 0回に至ったかが判 別される。 この際の判別では演算命令 # I 3に基づいてラッチ回路 5 1 0に保持 されている zero flagの値が参照される。 zero flagの値はレジスタ r 1 0の値と レジスタ r 1 2の値 「1 0」 とが比較され、 両方の値が異なる場合は zero flagに 「0」 がセットされる。 両方の値が一致する場合は zero flagに 「1」 がセットさ れる。 従って、 レジスタ r 1 2が示す値 = 1 0回に至っていない場合は zero flagに 「0」 がセットされることから、 演算命令 # I 4に基づいてステップ A 5 に戻って (LOOPして) レジスタ 1 1の値である 「l j が読出しポート 1 6に読 み出される。 この値 「1」 が繰り返し加算処理がなされ、 レジスタ r 0の値が 「1」 ずつ増加するようになされ、 その演算結果である 「1」 、 「2」 、 「3」 • · 'がレジスタ r 0に格納される。 これにより、 書込みアドレス Aw及び書込 み制御信号 S wに基づいて演算結果値 Zをレジスタ r 0に格納することができる。 そして、 ステップ A 7でレジスタ r 1 2が示す値 = 1 0回に至った場合は、 レジ スタ r 1 0の値 「1 0」 とレジスタ r 1 2の値 「1 0」 とが一致するので、 命令 # 1 3により zero flagが 「 1 j にセットされ、 命令 # I 4で制御が命令 # I 1に 移行されなくなくなるので、 ステップ A 5に LOOPすることなく演算処理が終了す る。
このように、 本発明に係る第 1の実施例としての演算処理装置及び演算処理方 法によれば、 図 6に示したフローチャートのステップ A 1でデコーダ 1 3によつ て解読された演算命令 # I 1〜# I 4等は命令信号 S 9及び各引数信号 S 1 0と なって実行ステートマシーン 5 1へ出力される。 実行ステートマシーン 5 1では ステップ A 2で演算命令 # I 1〜# I 4に基づいて一のレジスタ r 1 0を選択し、 ステップ A 3でレジスタ r 1 0が保持する値 「0」 によってレジスタ相対レジス タアドレッシング処理を実行するようになされる。 また、 ステップ A 4で他のレ ジスタ r 0が選択されると、 ステップ A 5で X値と Y値とが A L U 1 2によって 加算され、 レジスタアレイ 1 1のレジスタ r 0ではレジスタ相対レジスタァドレ ッシング処理によって指定される書込みアドレス A w及び書込み制御信号 S wに 基づいて演算結果値 Zを保持し、 及び、 ステップ A 5で読出しアドレス A rに基 づいて当該演算結果値 Zを次の演算の加数 X値として出力するようになされる。 A L U 1 2ではレジスタアレイ 1 1から読み出された X値及ぴ Y値を加算するよ うになされる。
従って、 レジスタアレイ 1 1をデータの随時書込み及ぴ読出し可能なメモリ (R AM) のように取り扱うことができるので、 レジスタ r 0〜!: 1 2等を通常 のプロセッサの RAM (メモリ) のように扱いながら、 レジスタアレイ 1 1 (レ ジスタ) にアクセスをすることが可能となる。 これにより、 従来方式の中央演算 処理装置 (CPU) に比べて外部メモリの格納番地を指定するレジスタ相対メモ リ了ドレッシング処理に依存しなくなる。 従来方式の CPUの中に RAMや RO Mの機能を取り込むことができるので、 高速演算処理を実行すること、 及び、 C PUや、 RAM、 ROM等を個々に基板に配置する場合に比べて基板占有面積を 低減することができる。 当該演算処理装置 100が適用される応用装置のコンパ クト化を図ることができる。
(2) 第 2の実施例
図 7は本発明に係る第 2の実施例としての演算処理装置 100の構築例を示す 半導体チップの平面図である。
この実施例では図 1に示した演算処理装置 100を構築する場合に、 予め同一 半導体チップ上に複数のメモリセル及び算術論理演算素子を形成し、 このメモリ セルを組み合わせてレジスタアレイ 1 1及び ROMセル 14を画定すると共に、 算術論理演算素子を組み合わせて A L U12、 デコーダ 13及び命令実行制御部 50を画定する。 その後、 レジスタアレイ 1 1、 ROMセル 24、 ALU 12、 デコーダ 13及び命令実行制御部 50を予め設定された配線情報に基づいて結線 すると共に、 ROMセル 14に上述した演算プログラム APを書込むようになさ れる。
図 7に示す演算処理装置 100は予め同一半導体チップ上に複数のメモリセル M S E及ぴ算術論理演算素子 L A Yを形成したプログラム可能な半導体デバイス (P LD ; Programmable Logic Device) である。 この半導体デバイスの行 方向には例えば N= 7本 (i = l, 2, i · · · N) の配線パターン (以下で行 配線 CO l〜CO 7という) が配置される。 列方向には同様にして M= 7本 (j = 1, 2, j · · ·Μ) の配線パターン (以下で列配線 RO l〜RO 7という) が配置される。 この行配線 CO l〜CO 7と直交するように配置された列配線 R O 1〜RO 7によって P LDが格子状を構成するようになされている。 各々の格 子内には複数のメモリセル M S E及ぴ算術論理演算素子 LAYを一単位とするメ モリセル Z算術論理演算素子ブロック (以下で単にセルプロックという) S E i j (i = l〜8、 j = 1〜8) が設けられている。
この例では 8 X 8 = 64個のセルプロック SE 11〜SE88が同一半導体チ ップ上に形成されている。 1つのセルブロック SE i jの上半分には複数のメモ リセル MS Eが配置され、 その下半分には複数の算術論理演算素子 LAYが配置 されている。 また、 レジスタアレイ 11及ぴ ROMセル 14はセルプロック S E i j内のメモリセルを組み合わせて画定する場合と、 他のセルブロック SE i j 内のメモリセルをも組み合わせてレジスタアレイ 11及び ROMセル 14を画定 する場合とを想定している。
各々の行配線 C O 1〜 C O 7の両終端側及ぴ列配線 R O 1〜R O 7の両終端側 には IZOインタフェース 60〜63が設けられ、 I /Οインタフェース 61に は行配線 C Ο 1〜C Ο 7の一端側が接続され、 その他端側には I ZOィンタフエ ース 63が接続されている。 I ZOインタフェース 60には列配線 RO l〜RO 7の一端側が接続され、 その他端側には IZOインタフヱース 62が接続されて いる。 セルブロック SE 11に最も近い行配線 CO 1や、 列配線 RO1等を使用 して I/Oインタフェース 60又は I/Oインタフェース 63に配線をプログラ ムすることが可能となされている。 もちろん、 他の行配線 CO 2〜CO 7や、 列 配線 R02〜RO8等を使用して他のセルプロック SE i j 1に配線をプログラ ムすることが可能となされている。
4つの I ZOィンタフェース 60〜63は例えば、 格子内の 64個のセルプロ ック S E i jの内、 外周縁部を構成するセルブロック SE 11, S E 12 · · · SE 18、 SE 11, S E 21 · · * SE81、 SE81、 S E 82 · · - S E 88、 及ぴ SE I 8, S E 28 · · · S E 88に沿ってこれらを取り囲むように 配置されている。 各セルブロック SE i j内のメモリセル間、 算術論理演算素子 間の配線や、 セルプロック SE I 1〜SE88間の配線、 これらの間を結線する 列配線 RO l〜RO 7と IZOインタフェース間には複数のスィッチ素子 (トラ ンジスタ) が至る所に配置され、 配線情報に基づいてスィッチ素子を ONするこ とで、 回路要素間を自在に接続できるようになされている。
なお、 この段階ではレジスタアレイ 1 1、 ALU12、 デコーダ 13、 ROM セル 14及び命令実行制御部 50等が画定されておらず、 汎用性を有したプログ ラマプル'ロジック .デバイスを成している。 この例では、 プログラマブル'口 ジック ·デバイスを電子機器に CPUとして組み込む場合に、 各機能回路にセル プロック SE 1 1〜SE 88を割り当てたり、 これらの間を列配線 RO l〜RO 7や、 行配線 CO l〜CO 7等を使用して結線し、 当該電子機器で要求される演 算機能に対して自在にプログラムしてユーザの希望に合った CPU機能等を構築 するようになされる。
続いて、 演算処理装置 100のレイアウト構築例について説明する。 図 8にお いては、 図 7で準備された半導体チップ上に、 図 8に示す波線で囲むようなレジ スタアレイ 11、 ALU 12、 デコーダ 13、 ROMセル 14、 実行ステートマ シーン 5 1、 命令読出しステートマシーン 52、 セレクタ 53、 プログラムカウ ンタ 54、 インクリメンタ 55、 セレクタ 56、 セレクタ 57、 入力用のセレク タ 59、 ラッチ回路 58、 510、 51 1を画定して演算処理装置 100をレイ アウトする。
なお、 実行ステートマシーン 51、 命令読出しステートマシーン 52、 セレク タ 53、 プログラムカウンタ 54、 インクリメンタ 55、 セレクタ 56、 セレク タ 57、 入力用のセレクタ 59及びラッチ回路 58、 5 10、 51 1は図 1に示 した命令実行制御部 50を構成する。 この例で、 レジスタアレイ 1 1には例えば、 セルブロック SE 1、 SE 14, S E 23及ぴ S E 43を割り当てて構成する。 8 192個のレジスタ r 0〜 r nにはこれらのセルブロック S E 1、 SE 14, SE 23及ぴ SE43のメモリセル MSEを使用する。 レジスタアレイ 1 1は書 込みァドレス Aw及ぴ書込み制御信号 Swに基づいて任意の値を保持し、 及ぴ、 読出しァドレス A rに基づいて当該値を出力する複数のレジスタ r 0〜r nを備 えるようにメモリセノレ MS Eを割り当てる。
図 2に示した書込みポート 15及び読出しポート 16には、 例えば、 セルプロ ック SE 1、 SE 14, S E 23及び S E 43の算術論理演算素子 LAYの入力 バッファ回路や、 出力バッファ回路を使用するとよい。 これらの間の配線には列 配線 R01、 RO 2及ぴ行配線 CO 2, CO 3, C O 4を使用して結線するよう になされる。 ALU 12にはセルブロック S E 26及び S E 36等を割り当てて 構成する。 セルプロック SE 26及ぴ SE 36の算術論理演算素子 LAYを使用 して ALU 12を構築する。 これらの間の配線には列配線 RO 1、 RO 2及ぴ行 配線 CO 5, CO 6等を使用して結線するようになされる。
デコーダ 13にはセルプロック S E 54及ぴ S E 64等を割り当てて構成する。 セルプロック S E 54及ぴ S E 64等の算術論理演算素子 LAYを使用してデコ —ダ 13を構築する。 これらの間の配線には列配線 RO 5及ぴ行配線 CO 3, C O 4等を使用して結線するようになされる。 ROMセル 14にはセルブロック S E 52及ぴ S E 62等を割り当てて構成する。 セルプロック S E 52及び S E 6 2等のメモリセル M S Eを使用して読出し専用メモリを構築する。 算術論理演算 素子 L A Yの入カバッファ回路や、 出力パッファ回路を使用して演算プログラム A Pの書込み Z読出し回路を構成するようになされる。 これらの間の配線には列 配線 R O 5及ぴ行配線 C O 1、 C O 2等を使用して結線するようになされる。 実行ステートマシーン 51にはセルブロック S E 56、 SE 57、 S E 58、 SE 66、 SE 67及び SE 68等を割り当てて構成する。 これらの間の配線に は列配線 RO 5及ぴ行配線 CO 5, CO 6, CO 7等を使用して結線するように なされる。 実行ステートマシーン 51は演算命令 # I 1〜# I 4に基づいて一の レジスタ r iを選択し、 ここで選択されたレジスタ r iが保持する値によって他 のレジスタを選択するレジスタ相対レジスタァドレツシング処理を実行するもの である。 命令読出しステートマシーン 52にはセノレブ口ック S E 85及び S E 8 6等を割り当てて構成する。 これらの間の配線には列配線 RO 7及び行配線 CO 4, CO 5, C06等を使用して結線するようになされる。 セレクタ 53及びプ ログラムカウンタ 54には、 セルプロック S E 73等を割り当てて構成する。 他 の回路との間の配線には列配線 R O 7及ぴ行配線 C O 2等を使用して結線するよ うになされる。 インクリメンタ 55にはセルブロック SE83等を割り当てて構 成する。 他の回路との間の配線には列配線 RO 7及ぴ行配線 CO 2、 CO 3等を 使用して結線するようになされる。
セレクタ 56にはセルブロック S E 33等を割り当てて構成する。 他の回路と の間の配線には行配線 C O 3及び CO 4等を使用して結線するようになされる。 セレクタ 56は一のレジスタを選択するための読出し実行ァドレス A r又は当該 レジスタを再度選択するための読出しァドレス A rのいずれか一方を選択するも のである。 セレクタ 57にはセルブロック S E 34等を割り当てて構成する。 他 の回路との間の配線には行配線 C O 2及び C O 3等を使用して結線するようにな される。 セレクタ 57は一のレジスタ r iを選択するための書込み実行アドレス 又は当該レジスタを再度選択するための書込みァドレス Awのいずれか一方を選 択するものである。
入力用のセレクタ 59にはセルブロック SE 12、 SE22等を割り当てて構 成する。 他の回路との間の配線には列配線 RO 1及ぴ行配線 CO 1等を使用して 結線するようになされる。 ラッチ回路 58にはセルプロック SE 35等を割り当 てて構成する。 他の回路との間の配線には列配線 RO 2及ぴ行配線 CO 5等を使 用して結線するようになされる。 ラッチ回路 510にはセルプロック SE 37等 を割り当てて構成する。 他の回路との間の配線には列配線 RO 2及び行配線 C O 6, CO 7等を使用して結線するようになされる。 ラッチ回路 51 1にはセルブ ロック SE41等を割り当てて構成する。 他の回路との間の配線には列配線 RO 3及び行配線 CO 1等を使用して結線するようになされる。
次に、 演算処理装置 100の配線構築例について説明をする。 図 9においては、 図 8で画定されたレジスタアレイ 1 1、 ALU 1 2、 デコーダ 1 3、 ROMセル 14、 実行ステートマシーン 51、 命令読出しステートマシーン 52、 セレクタ 53、 プログラムカウンタ 54、 インクリメンタ 55、 セレクタ 56、 セレクタ 57、 入力用のセレクタ 59、 ラッチ回路 58、 5 10、 51 1間を配線情報に より結線して演算処理装置 100を構築するようになされる。 この例では電子機 器の例えば、 プリント配線基板に、 演算処理装置 100を構築するプログラマプ ル ·ロジック ·デバイスを取り付けると共に、 書き換え可能な不揮発性の記憶装 置の一例となるフラッシュメモリ 70が取り付けられる。
このフラッシュメモリ 70には、 各セノレブロック SE i j内のメモリセノレ間、 算術論理演算素子間の配線や、 セルプロック SE 1 1〜SE 88間の配線、 これ らの間を結線する列配線 RO 1〜R07と Iノ Oインタフェース間等の至る所に 配置されたスィツチ素子を ONするための配線情報が格納されている。
図 10はフラッシュメモリ 70に格納される配線情報例を示す表図である。 図 10に示す配線情報例では配線情報 D 1〜D 38 · · ·に対する信号線 L 1〜L 38 · · · と共に、 当該信号線 L 1〜L 38に伝送される信号又は DATA等の用途 を示している。 配線情報 D1〜D38 · · ·は回路技術言語により作成され、 ネ ットリスト (結線情報) として準備される。 この例でフラッシュメモリ 70に格 納される配線情報 D 1〜D 38 · · ·は当該演算処理装置 100の機能に応じて 随時書き換えられるものである。
なお、 演算プログラム APは ROMセル 14に書込むようになされる。 この例 で演算プログラム APには、 レジスタ相対レジスタァドレッシング処理を実行す るための演算命令 # I 1〜# I 4が含まれている。 この演算プログラム APを配 線情報 D 1〜D 38 · · ·とリンクさせてデコーダ 1 3に出力するようにしても よい。 フラッシュメモリ 70によって ROMセル 14の機能を兼用できるように なる。
次に、 演算処理装置 100における結線例について説明をする。 図 1 1に示す 結線例によれば、 例えば、 セルプロック S E 22と、 セルプロック SE 66とを 信号線 L 24で接続する場合、 セルプロック S E 22と列配線 R 03との間に配 置されたスイッチング用のトランジスタ T 23と、 列配線 R03と行配線 CO 6 との間に配啬されたトランジスタ T 63と、 行配線 CO 6とセルプロック SE 6 6との間に配置されたトランジスタ T 66とを使用する。 各々のトランジスタ T 23, T63, T 66はゲート制御可能になされている。 これを前提にして、 電 源オンと共にフラッシュメモリ 70カ ら、 例えば図 1 1に示した表図の配線情報 D 24が読み出される。 配線情報 D 24はトランジスタ T 23, T63, T 66 の各々のゲートに設定される。 これにより、 各々のトランジスタ T 23, T 63, T 66が ONする。 これらのトランジスタ T 23, T 63, T 66の ONにより、 セルプロック S E 22と列配線 R 03との間、 列配線 R 03と行配線 C O 6との 間及ぴ行配線 CO 6とセルプロック S E 66との間が電気的に接続され、 信号線 L 24を構築することができる。 この例でセルプロック SE 22はセレクタ 59 に割り当てられ、 セルブロック S E 66は実行ステートマシーン 51に割り当て られており、 信号線 L 24は当該セレクタ 59の選択制御信号 S 24を伝送する 際に使用される。
このように、 各セルプロック SE i j内のメモリセル間等の至る所に配置され たスィツチング用のトランジスタに配線情報 D 1〜D 3 8 · · ·等が設定され、 この配線情報 D 1〜D 3 8 · · '等に基づいて当該トランジスタにより回路要素 間を自在に接続する。 これにより、 レジスタアレイ 1 1、 A L U 1 2、 デコーダ 1 3、 R OMセル 1 4及ぴ命令実行制御部 5 0等を結線するようになされる。 こ の設定により R OMセル 1 4に格納される演算プログラム A Pのサイズを小さく することができる。
続いて、 演算処理装置 1 0 0の回路構築例について説明をする。 図 1 2は電源 オンと共に結線された演算処理装置 1 0 0の回路図を示している。 図 1に示した 演算処理装置 1 0 0の構成図に関して複数の信号線等を記述したものである。 こ こで記述した信号線はフラッシュメモリ 7 0に記録される配線情報 D 1〜D 3 8 等に基づくものである。 配線情報 D 1〜D 3 8等は信号線毎に準備される。 この 例では配線情報 D 3に基づいて図 1 1に示したようなスィツチング用のトランジ スタが O Nすることで、 信号線 L 3がデコーダ 1 3と R OMセル 1 4を接続する。 信号線 L 3には演算プログラム A Pが伝送される。 同様にして信号線 L 4は配線 情報 D 4に基づいてデコーダ 1 3と命令読出しステートマシーン 5 2とを接続す る。 信号線 L 4には命令制御信号 S 4が伝送される。
信号線 L 5は配線情報 D 5に基づいて R OMセル 1 4と命令読出しステートマ シーン 5 2とプログラムカウンタ 5 4とを接続する。 信号線 L 5にはカウント出 力信号 S 5が伝送される。 信号線 L 6は配線情報 D 6に基づいてセレクタ 5 3と プログラムカウンタ 5 4とを接続する。 信号線 L 6にはセレクタ出力として分岐 制御信号 S 2 7又はインクリメント出力信号 S 7のいずれかが伝送される。 信号 線 L 7は配線情報 D 7に基づいてィンクリメンタ 5 5とセレクタ 5 3とを接続す る。 信号線 L 7にはインクリメント出力信号 S 7が伝送される。 信号線 L 9、 信 号線 L 1 0は配線情報 D 1 0に基づいてデコーダ 1 3と実行ステートマシーン 5 1とを接続する。 信号線 L 9には命令信号 S 9が伝送され、 信号線 L 1 0には各 引数信号 S 1 0が伝送される。 信号線 L 1 1は配線情報 D 1 1に基づいてデータ パス 1 9 Aと入力用のセレクタ 5 9とを接続する。 信号線 L 1 1にはデータ (DA TA) が伝送される。 信号線 L 1 2は配線情報 D 1 2に基づいてレジスタアレイ 1 1と実行ステートマシーン 5 1とを接続する。 信号線 L 1 2には書込み制御信号 S wが伝送される。
書込みァドレス線 L 1 3は配線情報 D 1 3に基づいてレジスタアレイ 1 1とセ レクタ 5 7とを接続する。 書込みァドレス線 L 1 3には書込みァドレス Awが伝 送される。 読出しアドレス線 L 1 4は配線情報 D 1 4に基づいてレジスタアレイ 1 1とセレクタ 5 6とを接続する。 読出しァドレス線 L 1 4には読出しァドレス A rが伝送される。 信号線 L 1 5は配線情報 D 1 5に基づいてラッチ回路 5 1 1 とアドレスバス 1 9 Bとを接続する。 信号線 L 1 5には外部ァドレスが伝送され る。 信号線 L 1 6は配線情報 D 1 6に基づいて実行ステートマシーン 5 1とコン トロールバス 1 9 Cとを接続する。 信号線 L 1 6には外部制御信号 S 1 6が伝送 される。 信号線 L 1 7は配線情報 D 1 7に基づいてラッチ回路 5 1 1と実行ステ 一トマシーン 5 1とを接続する。 信号線 L 1 7にはラッチ制御信号 S 1 7が伝送 される。
データ信号線 L 2 0は配線情報 D 2 0に基づいてレジスタアレイ 1 1と、 A L U 1 2と、 データバス 1 9 Aと、 セレクタ 5 7と、 セレクタ 5 6と、 5 8と、 入 力用のセレクタ 5 9とを接続する。 データ信号線 L 2 0にはデータ (DATA) 、 X 値、 Y値等が伝送される。 信号線 L 2 1は配線情報 D 2 1に基づいて A L U 1 2 と入力用のセレクタ 5 9とを接続する。 信号線 L 2 1には演算結果値 Zが伝送さ れる。 信号線 L 2 2は配線情報 D 2 2に基づいて A L U 1 2とラツチ回路 5 1 0 とを接続する。 信号線 L 2 2には一致検出信号 S 2 2が伝送される。 信号線 L 2 3は配線情報 D 2 3に基づいて実行ステートマシーン 5 1とラッチ回路 5 1 0と を接続する。 信号線 L 2 3にはフラグ状態信号 S 2 3が伝送される。 信号線 L 2 4は配線情報 D 2 4に基づいて入力用のセレクタ 5 9と実行ステートマシーン 5 1とを接続する。 信号線 L 2 4には選択制御信号 S 2 4が伝送される。
信号線 L 2 5は配線情報 D 2 5に基づいて入力用のセレクタ 5 9とレジスタァ レイ 1 1とを接続する。 信号線 L 2 5にはデータ、 演算結果値 Z、 被数 X値等が 伝送される。 信号線 L 2 6は配線情報 D 2 6に基づいて実行ステートマシーン 5 1と命令読出しステートマシーン 5 2とを接続する。 信号線 L 2 6には実行終了 信号 S 2 6が伝送される。 信号線 L 2 7は配線情報 D 2 7に基づいて実行ステー トマシーン 5 1とセレクタ 5 3とを接続する。 信号線 L 2 7には分岐制御信号 S 2 7が伝送される。 信号線 L 2 8は配線情報 D 2 8に基づいて実行ステートマシ ーン 5 1とセレクタ 5 3とを接続する。 信号線 L 2 8には選択制御信号 S 2 8カ 伝送される。
信号線 L 2 9は配線情報 D 2 9に基づいて命令読出しステートマシーン 5 2と 実行ステートマシーン 5 1とを接続する。 信号線 L 2 9には命令実行開始信号 S 2 9が伝送される。 信号線 L 3 0は配線情報 D 3 0に基づいて命令読出しステー トマシーン 5 2とプログラムカウンタ 5 4とを接続する。 信号線 L 3 0にはカウ ント制御信号 S 3 0が伝送される。 信号線 L 3 1は配線情報 D 3 1に基づいてセ レクタ 5 7と実行ステートマシーン 5 1とを接続する。 信号線 L 3 1には選択制 御信号 S 3 1が伝送される。 信号線 L 3 2は配線情報 D 3 2に基づいてセレクタ 5 6と実行ステートマシーン 5 1とを接続する。 信号線 L 3 2には選択制御信号 S 3 2が伝送される。 ァドレス信号線 L 3 3は配線情報 D 3 3に基づいてセレク タ 5 6と実行ステートマシーン 5 1とを接続する。 ァドレス信号線 L 3 3には読 出しァドレス A rが伝送される。 信号線 L 3 4は配線情報 D 3 4に基づいてラッ チ回路 5 8と実行ステートマシーン 5 1とを接続する。 信号線 L 3 4にはラッチ 制御信号 S 5 8が伝送される。
信号線 L 3 5は配線情報 D 3 5に基づいて A L U 1 2と実行ステートマシーン 5 1とを接続する。 信号線 L 3 5には A L U制御信号 S 3 5が伝送される。 信号 線 3 6は配線情報 D 3 6に基づいてラッチ回路 5 8と A L U 1 2とを接続する。 信号線 L 3 6にはラッチ出力として X値 「0」 等が伝送される。 アドレス信号線 L 3 7は配線情報 D 3 7に基づいてセレクタ 5 7と実行ステートマシーン 5 1と を接続する。 アドレス信号線 L 3 7には書込みアドレス Awが伝送される。 信号 線 L 3 8は配線情報 D 3 8に基づいて実行ステートマシーン 5 1とラッチ回路 5 1 0とを接続する。 信号線 L 3 8にはラツチ制御信号 S 3 8が伝送される。
このように、 本発明に係る第 2の実施例としての演算処理装置 1 0 0の構築方 法によれば、 電源オンと共にフラッシュメモリ 7 0から読み出された配線情報 D 1〜D 3 8 · · ·等に基づいてレジスタアレイ 1 1、 A L U 1 2、 デコーダ 1 3、 R OMセノレ 1 4、 実行ステートマシーン 5 1、 命令読出しステートマシーン 5 2、 セレクタ 5 3、 プログラムカウンタ 5 4、 インクリメンタ 5 5、 セレクタ 5 6、 セレクタ 5 7、 入力用のセレクタ 5 9及びラッチ回路 5 8、 5 1 0、 5 1 1を結 線するようになされる。 従って、 実行ステートマシーン 5 1で演算命令 # I 1〜 # I 4に基づいて一のレジスタ r 1 0を選択し、 このレジスタ r 1 0が保持する 値 「0」 によって他のレジスタ r 0を選択するレジスタ相対レジスタアドレツシ ング処理を実行するようなプログラム可能な演算処理装置 1 0 0を電源オンと共 に構築することができる。 1チップでメモリセルを含むプロセッサを効率良く構 築することが可能となる。
この装置構築後のデコーダ 1 3では A L U 1 2を動作させるための演算プログ ラム A Pから演算命令 # I 1〜# I 4が解読され、 命令実行制御部 5 0ではデコ ーダ 1 3によって解読された演算命令 # I 1〜# I 4を実行するためにレジスタ アレイ 1 1及ぴ A L U 1 2が制御される。 A L U 1 2ではレジスタアレイ 1 1か ら読み出された X値、 Y値が演算される。 そのレジスタ r 1 0が示す値 「0」 の レジスタ r 0にその演算結果値 Zを格納することができる。
また、 命令実行制御部 5 0では P L D内部のメモリ機能を持つ部分の全てをレ ジスタとして极ぅことができるので、 メモリセルとレジスタを区別してアクセス する種類のプロセッサと比べて、 高速な動作が可能になる。 しかも、 C P Uや、 R AM, R OM等を個々に基板に配置する場合に比べて基板占有面積を低減する ことができる。 当該演算処理装置 1 0 0が適用される携帯端末装置等の電子機器 のコンパクト化を図ることができる。
( 3 ) 第 3の実施例
図 1 3は本発明に係る第 3の実施例としての演算処理システム 1 0 0 ' の構成 例を示すプロック図である。
この実施例では複数のレジスタを指定してレジスタ相対レジスタアドレツシン グ処理を実行する演算プログラムに基づいて演算処理を実行する演算処理装置 (第 2の演算処理装置) 1 0 0, を備え、 プログラム作成系で作成された圧縮プ ログラムを取得してレジスタ種類を解読し、 このレジスタ種類に基づ!/、て当該レ ジスタを指定する命令ビット数を復元し、 所定の命令長の命令構造を有するプロ グラムを復元するようにして、 プログラムデータを格納する R OM等のメモリ容 量を低減できるようにすると共に、 メモリセルや論理演算素子から成る P L Dに よりプロセッサを構築する場合に、 R OMとして機能させるメモリセルの占有率 を低減できるようにしたものである (第 2の演算処理方法) 。 また、 プログラム 作成系ではレジスタの使用頻度に応じて命令の長さを可変できるようにすると共 に、 頻繁にアクセスするレジスタには短い長さの命令をセットできるようにする (第 3の演算処理方法) 。
図 1 3に示す演算処理システム 1 0は、 一方で、 所定のプログラム言語に基づ いてレジスタ相対レジスタアドレツシング処理を実行する演算プログラムに基づ いて演算処理を実行するための命令を編集してプログラムを作成し、 他方で、 当 該プログラムと複数のレジスタとを使用してデータを処理するシステムである。 演算処理システム 1 0ではプログラム作成系 Iを成すプログラム作成装置 2 0 0 が準備される。 新規に設計製造される演算処理装置 1 0 0 ' を動作させるための プログラムを作成するためである。 演算処理装置 1 0 0, はプログラム実行系 II を構成し、 当該装置 1 0 0 ' 内には命令実行演算部や、 記憶部、 複数のレジスタ 等が実装される。 プログラム作成装置 2 0 0では、 演算処理装置 1 0 0 ' でレジ スタを使用する頻度に基づいて当該レジスタを指定するための命令ビット数を圧 縮すると共に、 当該プログラムの命令構造の中にレジスタ種類を記述して命令長 の異なる圧縮プログラム A Pを作成するようになされる。 演算処理装置 1 0 0, に実装されるプログラム格納用の記憶部のメモリ容量を削減するためである。 プログラム作成装置 2 0 0は例えば、 データベース 2 1、 キーボード 2 2、 マ ウス 2 3、 表示装置 2 4及び制御装置 2 5を有している。 データベース 2 1には 演算処理装置 1 0 0 ' のプログラム作成に必要なデータが格納される。 例えば、 C言語によるプログラムの記述に必要な 「Global変数宣言」 、 「関数宣言」 、 「LOCal変数宣言」 、 「代入」 、 「加算」 、 「比較」 及び 「分岐」 が格納される。 データベース 2 1には制御装置 2 5が接続されており、 この制御装置 2 5にはキ 一ボード 2 2、 マウス 2 3及ぴ表示装置 2 4が接続されている。 プログラム作成 装置 2 0 0では表示装置 2 4に C言語によるプログラム記述画面を表示して、 キ 一ボード 2 2及ぴマウス 2 3を使用してプログラムが作成される。
例えば、 新規な設計製造に係る演算処理装置 1 0 0 ' が N個のレジスタを使用 する場合であって、 N個のレジスタに第 1番から第 N番のシリアル番号を付与し たとき、 第 1番から第 K番のグループのレジスタを使用頻度が高い部類として
("Local変数宣言」 がなされ、 第 K+ 1番から第 N番のグループのレジスタを使用 頻度が低い部類として 「Global変数宣言」 がなされる。 これらの宣言はキーボー ド 2 2や、 マウス 2 3を使用して指定され、 これはレジスタ種類を 2つに分類し て使用頻度が,高いレジスタは短い命令ビット数で命令セットし、 使用頻度が低い レジスタは長い命令ビット数で命令セットするためである。 演算処理装置 1 0 0 ' においてレジスタの数が例えば、 4千〜 8千個程度になると、 これを指定する 命令ビット数が 1 2乃至 1 3ビット必要になる。
制御装置 2 5ではレジスタの使用頻度に応じて命令の長さを可変するようにな される。 頻繁にアクセスするレジスタは短い長さの命令をセットするためである。 使用頻度が高いレジスタは短い命令ビット数が割り当てられ、 使用頻度が低いレ ジスタは長い命令ビット数が割り当てられる。 演算処理装置 1 0 0, ではこのプ ログラム作成装置 2 0 0で作成された圧縮プログラム A Pを取得してレジスタ種 類を解読し、 このレジスタ種類に基づいて当該レジスタを指定する命令ビット数 を復元し、 所定長さの命令に基づいて複数のレジスタを指定して任意の演算を実 行するようになされる。
演算処理装置 1 0 0, は例えば、 命令解読復元部 3、 記憶部 4、 レジスタァレ ィ 1 1, 及ぴ命令実行演算部 5 0, を有している。 レジスタアレイ 1 1, は複数 のレジスタを集合したものである。 記憶部 4にはレジスタアレイ 1 1, の中から 該当レジスタを指定するための圧縮プログラム A Pが格納される。 圧縮プロダラ ム A Pはプログラム作成装置 2 0 0で作成されたものが使用される。 例えば、 圧 縮プログラム A Pは演算処理装置 1 0 0 ' で構築されたプログラム格納用の記憶 部 4に、 R OMライタ等を使用して書き込まれる。 これは演算処理装置 1 0 0, に関して、 複数のメモリセルや算術論理素子により構成されるプログラマプル' ロジック 'デバイス (Programmable Logic Device; P L D) からプロセッサ を構築する場合があるからである。 R OMとして機能させるメモリセルの占有率 を低減することができる。 もちろん、 プログラム格納用の記憶部 4を演算処理装 置 1 0 0 ' とは別個に製造し、 個々の記憶部 4に圧縮プログラム A Pを格納して から同一基板上に実装する方法であってもよい。 記憶部 4として読み出し専用の メモリ (R OM) や、 E E P R OM (フラッシュメモリ) が使用されるからであ る。
記憶部 4には命令解読復元部 3が接続されており、 この記憶部 4から圧縮プロ グラム A Pを読み出してレジスタ種類を解読し、 このレジスタ種類に基づいて当 該レジスタを指定するための命令ビット数を復元するようになされる。 命令長を 揃え、 この命令に基づいて複数のレジスタを指定するためである。 命令解読復元 部 3には命令実行演算部 5 0 ' が接続されており、 この命令実行演算部 5 0 ' に はレジスタアレイ 1 1 ' が接続されている。 命令実行演算部 5 0 ' では命令解読 復元部 3によつて復元された所定の命令長のプログラムに基づいてレジスタァレ ィ 1 1, 内で該当レジスタを指定して任意の演算を実行するようになされる。 続いて、 本発明に係る演算処理方法について、 当該演算処理システム 1 0にお ける処理例について説明をする。 図 1 4は演算処理システム 1 0における処理例 を示すフローチャートである。 このシステム 1 0ではプログラム作成系 Iで所定 のプロダラム言語に基づいてレジスタ相対レジスタァドレツシング処理を実行す る演算プログラムに基づいて演算処理を実行するための命令を編集してプロダラ ムを作成し、 プログラム実行系 IIで当該プログラムと複数のレジスタとを使用し てデータを処理する場合を前提とする。 この演算処理装置 1 0 0 ' が N個のレジ スタを使用する場合であって、 N個のレジスタに第 1番から第 N番のシリアル番 号が付与される場合を例にとる (第 2の演算処理方法) 。
これを処理条件にして、 プログラム作成系では図 1 4 Aにフローチャートのス テツプ A O 1で所定のプログラム言語に基づいてレジスタ相対レジスタアドレツ シング処理を実行する演算プログラムに基づいて演算処理を実行するための命令 を編集する。 そして、 ステップ A O 2でレジスタを使用する頻度に基づいて当該 レジスタを指定する命令ビット数を圧縮し、 命令長を短くする。 例えば、 第 K + 1番から第 N番のグループのレジスタを指定する命令ビット数を nビットとし、 第 1番から第 K番のグループのレジスタを指定する命令ビット数を mビットとし たとき、 例えば、 n— m= 8ビットとなるように、 第 1番から第 K番のグループ のレジスタを指定する命令ビット数が圧縮される。
その後、 ステップ A O 3で当該プログラムの命令構造の中にレジスタ種類を記 述する。 例えば、 被数及び加数を保持する 1組のレジスタ、 これを 「レジスタ番 号 1」 のレジスタの種類を 「レジスタ種類 1」 、 及び 「レジスタ番号 2」 のレジ スタの種類を 「レジスタ種類 2」 としたとき、 第 1番から第 K番のグループのレ ジスタに関して使用頻度が高い場合は 「レジスタ種類 1」 及ぴ 「レジスタ種類 2」 にコード 「0」 が記述される。 また、 第 K + 1番から第 [番のグループのレ ジスタに関して使用頻度が低い場合は 「レジスタ種類 1」 及び 「レジスタ種類 2 J にコード 「1」 が記述される。
そして、 ステップ A O 4で命令長の異なる圧縮プログラム A Pを作成する。 こ の圧縮プログラム A Pにおいて、 第 1番から第 K番のグループのレジスタを指定 する命令ビット数に関しては mビットであり、 第 K + 1番から第 N番のグループ のレジスタを指定する命令ビット数に関しては nビットである。 上述の例で第 1 番から第 K番のグループのレジスタ指定を含む命令形態では、 第 K + 1番から第 N番のグループのレジスタ指定を含む命令形態に比べて命令長が 1 6ビット短く なる。
—方、 プログラム実行系ではプログラム作成系で作成された圧縮プログラム A Pを図 1 4 Bに示すフローチャートのステップ B 1で取得する。 例えば、 圧縮プ ログラム A Pは演算処理装置 1 0 0, で構築されたプログラム格納用の記憶部 4 に、 R OMライタ等を使用して書き込まれる。 この圧縮プログラム A Pでは使用 頻度が高いレジスタは短い命令ビット数 ==mビットで命令セットされ、 使用頻度 が低いレジスタは長い命令ビット数 = nビットで命令セットされている。 そして、 ステップ B 2で命令を実行するかを判断する。 この際の判断は周知技術によりな される。 命令を実行する場合はステップ B 3でレジスタ種類を解読する。 例えば、 「レジスタ種類 1 J 及び 「レジスタ種類 2」 に関してコード 「0」 から使用頻度 が高いレジスタとして第 1番から第 K番のグループのレジスタ番号が解読され、 「レジスタ種類 1」 及び 「レジスタ種類 2」 に関してコード 「1」 から使用頻度 が低いレジスタとして第 K+ 1番から第 N番のグループのレジスタ番号が解読さ れる。
そして、 解読されたレジスタ種類に基づいてステップ B 4で当該レジスタを指 定する命令ビット数を復元する。 例えば、 第 1番から第 K番のグループのレジス タの命令ビット数 =niビットの上位、 この例で上位 8ビットに 「0」 が付加され る。 第 1番から第 K番のグループのレジスタの命令ビット数が、 第 K + 1番から 第 N番のグループのレジスタの命令ビット数と同様にして nビットに揃えられる。 ここで復元された所定長さの命令に基づいてステップ B 5で複数のレジスタを指 定して任意の演算を実行する。 その後、 ステップ B 6で演算処理を終了するかを 判断する。 演算処理を終了しない場合はステップ B 2に戻って命令を実行するか を判断して演算処理を継続する。 演算処理を終了する場合は電源オフ情報等を検 出して当該演算処理を終了する。
このように、 本発明に係る第 3の実施例としての演算処理システム 1 0によれ ば、 一方で、 所定のプログラム言語に基づいてレジスタ相対レジスタアドレツシ ング処理を実行する演算プログラムに基づいて演算処理を実行するための命令を 編集してプログラムを作成し、 他方で、 当該プログラムと複数のレジスタとを使 用してデータを処理する場合に、 プログラム作成装置 2 0 0ではレジスタを使用 する頻度に基づいて当該レジスタを指定する命令ビット数を圧縮すると共に、 当 該プログラムの命令構造の中にレジスタ種類を記述して命令長の異なる圧縮プロ グラム A Pが作成される。 演算処理装置 1 0 0, では、 プログラム作成装置 2 0 0で作成された圧縮プログラム A Pを取得してレジスタ種類を解読し、 このレジ スタ種類に基づいて当該レジスタを指定する命令ビット数を復元し、 所定長さの 命令に基づいて複数のレジスタを指定して任意の演算が実行される。 従って、 プ ログラム作成系 Iではレジスタの使用頻度に応じて命令の長さを可変できるので、 頻繁にアクセスするレジスタに短い長さの命令をセットすることができる。 これ により、 プログラム実行系 IIでは R OM等の記憶部 4に圧縮した命令をセットす ることができ、 プログラムデータを格納する記憶部 4のメモリ容量を低減するこ とができる。 また、 メモリセルや論理演算素子から成る P L Dによりプロセッサ を構築する場合に、 R OMとして機能させるメモリセルの占有率を低減すること ができ、 その分のメモリセルをレジスタに多く割り当てることができるようにな る。
( 4 ) 第 4実施例
図 1 5は本発明に係る第 4の実施例としてのマイクロプロセッサ 1 0 1の構成 例を示すブロック図である。
この実施例では演算処理装置 100, に外部メモリ 2を接続してマイクロプロ セッサ 101を構成し、 複数のレジスタを指定してレジスタ相対メモリアドレツ シング処理を実行する演算プログラムに基づいて演算処理を実行する。 もちろん、 第 1の実施例と同様にして、 レジスタ相対レジスタアドレッシング処理を実行す るための演算命令を圧縮プログラム A Pに記述してもよい。 この場合には、 図 1 5に示すレジスタアレイ 11, の入力部分に図 1に示したようなセレクタ 56, 57を接続し、 このセレクタ 56, 57を実行ステートマシン 51で制御すれば よい。 第 1の実施例の効果と第 2の実施例の効果とが重複して得られる。
この例では、 プログラム作成系 Iで作成された機械語の命令の圧縮プログラム A Pを取得してレジスタ種類を解読し、 このレジスタ種類に基づいて当該レジス タを指定する命令ビット数を復元し、 所定の命令長の命令構造を有するプロダラ ムを復元するようにした。 そうすることでプログラムデータを格納する R OM等 のメモリ容量を低減できるようにしたものである。
図 15に示すマイクロプロセッサ 101は、 レジスタを使用する頻度に基づい て当該レジスタを指定する命令ビット数が予め圧縮されると共に、 当該プロダラ ムの命令構造の中にレジスタ種類が記述された命令長の異なる圧縮プログラム A Pに基づいてデータを処理する装置である。 このプロセッサ 101ではプログラ ム作成装置 200で作成された圧縮プログラム APを取得してレジスタ種類を解 読し、 このレジスタ種類に基づいて当該レジスタを指定する命令ビット数を復元 し、 所定長さの命令に基づいて複数のレジスタを指定して任意の演算を実 する ようになされる。
マイクロプロセッサ 101は例えば、 レジスタアレイ 1 1, 、 命令ビット復元 デコーダ (第 1の実施例のデコーダに相当) 1 3、 ROM14、 及び命令実行演 算部 50, を有している。 レジスタアレイ 1 1, は複数のレジスタを集合したも のである。 レジスタアレイ 1 1, には例えば、 81 92個 X 32 b i tのレジス タ r i ( i =0〜8191) が設けられる。 各々のレジスタ r iは書込みァドレ ス Aw及び書込み制御信号 Swに基づいて任意の値を保持し、 及び、 読出しアド レス A rに基づいて被数 Xや加数 Y等の値を出力するようになされる。 このマイクロプロセッサ 1 0 1は記憶部の一例となるプログラム格納用の R O M l 4が実装されており、 レジスタアレイ 1 1, の中から該当レジスタ r iを指 定するための圧縮プログラム A Pが格納される。 圧縮プログラム A Pは機械語の 命令 (I nstruction) 構造を有しており、 プログラム作成装置 2 0 0で作成され たものが使用される。 例えば、 圧縮プログラム A Pは R OMライタ等を使用して R OM 1 4に書き込まれる。 命令実行時、 R OM 1 4は例えば、 プログラムカウ ンタ 5 4からのカウント出力信号 S 5に基づいて圧縮プログラム A Pを出力する ようになされる。
R OM 1 4には命令ビット復元デコーダ 1 3が接続されており、 この R OM 1 4から機械語の命令の圧縮プログラム A Pを読み出して命令制御信号 S 4、 命令 信号 S 9及ぴ各引数信号 S 1 0を発生するようになされる。 命令信号 S 9には 1 0 a d命令、 a d d命令、 c m p命令、 j u m p命令が含まれる。 各引数信号 S 1 0にはアクセス方法 # 1 , アクセス方法 # 2, 「レジスタ種類 1」 , 「レジス タ種類 2」 , レジスタ番号 r 0, r 1 · · ·等、 フラグ状態 (flag condition) 及びジャンプァドレス等が含まれる。
この圧縮プログラム A Pにはレジスタ相対メモリアドレッシング処理を実行す るための演算命令を含んでいる。 この処理では演算命令に基づいて一のレジスタ を選択し、 ここで選択されたレジスタが保持する値によって外部メモリ 2を選択 するようになされる。 この処理は例えば、 アクセス方法 # 1によって実行される。 この例で命令ビット復元デコーダ 1 3は、 「レジスタ種類 1」 及ぴ 「レジスタ種 類 2」 を解読し、 この 「レジスタ種類 1」 及び 「レジスタ種類 2」 に基づいて当 該レジスタ r iを指定するための命令ビット数 == nビットを復元するようになさ れる。 命令長を圧縮前のビット数に揃え、 この命令に基づいて複数のレジスタ r i等を指定するためである。 上述の命令制御信号 S 4は命令読出しステートマシ ーン 5 2に出力される。 上述のレジスタアレイ 1 1, 及ぴ命令ビット復元デコー ダ 1 3には命令実行演算部 5 0, が接続されている。 命令実行演算部 5 0, では 命令ビット復元デコーダ 1 3によって復元された所定の命令長のプログラムに基 づいてレジスタアレイ 1 1 ' 内で該当レジスタ r iを指定して任意の演算を実行 するようになされる。 命令実行演算部 5 0, は、 算術論理演算ユニット (Arithmetic and Logic Unit:以下で ALUという) 1 2、 実行ステートマシーン 5 1、 命令読出しステ 一トマシーン 5 2、 セレクタ 53、 プログラムカウンタ (PC) 54、 + 1イン クリメンタ 55、 入力用のセレクタ 5 9、 ラッチ回路 5 8、 5 1 0、 5 1 1 ' を 有しており、 レジスタ相対メモリアドレッシング処理を実行するようになされる。 レジスタアレイ 1 1, にはデータ信号線 L 20が接続されており、 この信号線 L
20を通じて ALU 1 2が接続されている。 ALU 1 2ではレジスタアレイ 1 1 ' の中で指定されたレジスタから読み出された Xや Y等の値を演算するようにな される。 演算結果の値は Zである。 演算種目は足し算、 かけ算、 引き算、 わり算 等である。 演算種目は実行ステートマシーン 5 1から出力される ALU制御信号 S 3 5に基づいて設定される。 データ信号線 L 20には、 ALU 1 2の他にラッ チ回路 58、 5 1 1、 5 9等が接続されている。 データ信号線 L 20には DATA、 被数 X値、 加数 Y値等が伝送される。
命令ビッ 1、復元デコーダ 1 3には実行ステートマシーン 5 1及ぴ命令読出しス テートマシーン 5 2が接続されており、 命令ビット復元デコーダ 1 3によって解 読された演算命令を実行するためにレジスタアレイ 1 1, 及ぴ ALU 1 2を制御 するようになされる。 命令読出しステートマシーン 5 2では命令ビット復元デコ ーダ 1 3から出力される命令制御信号 S 4に基づいてプログラムカウンタ 54及 ぴ実行ステートマシーン 5 1を制御する。 例えば、 当該マシーン 52は命令ビッ ト復元デコーダ 1 3から命令信号 S 9及ぴ各引数信号 S 1 0が実行ステートマシ ーン 5 1へ出力されると共に命令実行開始信号 S 2 9を出力する。
実行ステートマシーン 5 1にはレジスタアレイ 1 1 ' 、 ALU 1 2、 ラッチ回 路 5 8, 5 1 0、 5 1 1及びセレクタ 5 9が接続されている。 当該マシーン 5 1 では命令実行開始信号 S 29に基づいて命令の実行を開始する。 例えば、 データ の書込み時には、 書込み制御信号 Swがレジスタアレイ 1 1, に出力され、 セレ クタ 5 9には選択制御信号 S 24が出力される。 データの読出し時には、 読出し アドレス Arがレジスタアレイ 1 1, に出力される。 演算時には、 ラッチ制御信 号 S 34がラッチ回路 5 8に出力され、 ラッチ回路 5 1 0にはラッチ制御信号 S
38が出力される。 当該プロセッサ外部には外部制御信号 S 1 6が出力される。 命令の実行が終了すると、 実行ステートマシーン 5 1は命令読み出しステートマ シーン 5 2へ実行終了信号 S 2 6を出力し、 プログラムカウンタ 5 4の値を進め るようになされる。
この実行ステートマシーン 5 1及ぴ命令読み出しステートマシーン 5 2にはセ レクタ 5 3が接続されており、 選択制御信号 S 2 8に基づいてインクリメント出 力信号 S 7又は分岐制御信号 S 2 7のいずれか一方を選択し、 これをセレクタ出 力としてプログラム力ゥンタ 5 4に出力するようになされる。 選択制御信号 S 2 8は実行ステートマシーン 5 1から供給される。 インクリメント出力信号 S 7は インクリメンタ 5 5からセレクタ 5 3へ出力される。 プログラムカウンタ 5 4で はカウント制御信号 S 3 0に基づいて R OM 1 4から圧縮プログラム A Pを読み 出す場所が指定される。 + 1インクリメンタ 5 5はプログラムカウンタ 5 4の力 ゥント出力信号 S 5を Γ+ 1 j してインクリメンとするようになされる。 カウン ト制御信号 S 3 0は命令解読ステートマシーン 5 2から供給される。 このカウン ト出力信号 S 5は + 1インクリメンタ 5 5の他に R OM 1 4に出力される。
セレクタ 5 9はデータバス 1 9 A、 レジスタアレイ 1 1 ' 及び A L U 1 2に接 続されており、 データバス 1 9 Aから取り込んだデータ (DATA) 、 レジスタァレ ィ 1 1 ' から出力される被数 X値 (加数 Y値) 又は A L U 1 2から出力される演 算結果値 Zのいずれかを選択制御信号 S 2 4に基づいて入力制御するようになさ れる。 ラッチ回路 5 8はレジスタアレイ 1 1 ' の読出しポートと A L U 1 2の間 に接続されており、 ラッチ制御信号 S 3 4に基づいてレジスタ r iの出力値 Xを ラッチするようになされる。 ラッチ回路 5 1 0は A L U 1 2の比較出力部等に接 続されており、 ラッチ制御信号 S 3 8に基づいて一致検出信号 S 2 2をラッチし て、 フラグ状態 (flag condition) 信号 S 2 3を出力するようになされる。 ラッ チ回路 5 1 1はレジスタアレイ 1 1 ' の読出しポートとアドレスパス 1 9 Bとの 間に接続されており、 ラッチ制御信号 S 1 7に基づいて外部アドレス (address) をラッチするようになされる。
なお、 実行された命令によってジャンプ (命令分岐) が発生した場合は、 ジャ ンプ先のァドレスを示す分岐制御信号 S 2 7を実行ステートマシン 5 1からセレ クタ 5 3へ出力される。 セレクタ 5 3では選択制御信号 S 2 8に基づいてその分 岐制御信号 S 27を選択し、 この分岐制御信号 S 27をプログラムカウンタ 54 へ書き込むようになされる。 また、 実行ステートマシーン 51、 セレクタ 59、 データ信号線 L 20及ぴラッチ回路 51 1には I/Oインタフェース 60を通じ て外部メモリ 2が接続されている。 レジスタ相対メモリアドレッシング処理に基 づいて ALU 12を動作させるためである。 I /Oインタフェース 60と外部メ モリ 2との間はデータバス 19 A、 ァドレスパス 1 9 B及びコントロールパス 1 9Cによって接続され、 データパス 19 Aによってデータが転送され、 アドレス パス 1 9 Bによってァドレスが転送され、 コントロールバス 19 Cによって外部 制御信号 S 16が外部メモリ 2へ転送される。 外部メモリ 2を制御するためであ る。 外部メモリ 2には例えば、 512Mバイト X 32ビットの RAM (随時書き 込み読み出し可能なメモリ) が使用される。
図 16はレジスタアレイ 1 1 ' の内部構成例を示すブロック図である。 図 1 6 に示すレジスタアレイ 1 1, によれば、 例えば、 81 92個の 32 b i tのレジ スタ r i ( i =0〜81 91) が備えられ、 各々のレジスタ r iの入力には書込 みポート 1 5が接続されている。 1 b i tのレジスタは D型のフリップ ' フロッ プ回路等から構成される。 書込みポート 15は図 15に示したセレクタ 59に接 続されており、 書込み制御信号 Sw及び書込みアドレス Awに基づいて、 データ パス 1 9 Aから取り込んだデータ (DATA) 、 レジスタアレイ 1 1 ' から出力され る被数 X値 (加数 Y値) 又は ALU 1 2から出力される演算結果値 Zのいずれか をレジスタ r O〜r iに書き込むようになされる。 書込みポート 15は実行ステ 一トマシーン 51に接続され、 書込みァドレス Awを供給するようになされる。 各々のレジスタ r iの出力には読出しポート 16が接続されている。 読出しポー ト 16はデータ信号線 L 20を通じて図 15に示した ALU 12、 ラッチ回路 5 8、 51 1、 セレクタ 59等に接続されており、 読出しァドレス A rに基づいて 指定されたレジスタ r iからデータ (DATA) を読み出すようになされる。 読出し ポート 16は実行ステートマシーン 51に接続され、 読出しアドレス A rを供給 するようになされる。
次に、 図 17 A〜E及ぴ図 18 A〜図 18Dを参照しながら、 ROM 14にセ ットされる命令の構造例について説明する。 先に説明した ROM 14にセットさ れる命令形態は、 図 1 7 A〜図 1 7 Eに示すように、 # F 1〜# F 5の 5種類で ある。 マイクロプロセッサ 1 0 1では命令形態 #F 2〜#F 4の命令を命令形態 # F 1の命令の形態に復元して取り扱われる。 これらの命令形態 #F 1〜#F 5 で各々の命令は l o a d、 a d d及ぴ cmp命令と、 j ump命令とに大きく 2 つに分かれる。 命令形態 # F 1〜# F 4において、 1 o a d命令の場合は図 1 8 Aに示すように命令にコード 「0」 が記述され、 a d d命令の場合は命令にコー ド 「1」 が記述され、 cmp命令の場合は命令にコード 「2」 が各々記述される。 命令形態 #F 5は j ump命令であって、 この場合は命令にコード 「3」 が記述 される。 cmp命令に関しては比較結果が同じであった場合は、 図 1 5に示した ラッチ回路 5 1 0のフラグ状態信号 S 23に基づいて zero flagが 「1」 にセット され、 同じでなかった場合は 「0」 がセットされる。
この例では、 l o a d、 a d d及ぴ cmp命令はアクセスするレジスタ r iの 番号が例えば、 5ビットで表現できるときは 5ビット、 それ以外は 1 3ビットで 表現される。 つまり、 使用頻度が高い第 0番のレジスタ r 0から第 3 1番のレジ スタ r 3 1を m= 5ビットで表現する。 使用頻度が低い第 32番のレジスタ r 3 2から第 8 1 9 1番のレジスタ r 8 1 9 1を m= 1 3ビットで表現するようにな される。 命令形態 #F 1では命令長が 3 2ビットであり、 「レジスタ番号 1」 で 示されるレジスタ r iの命令ビット数は n= 1 3ビットであり、 「レジスタ番号 2」 で示されるレジスタ r iの命令ビット数も n = 1 3ビットである。 命令形態 #F 2では命令長が 24ビットであり、 「レジスタ番号 1」 で示されるレジスタ r iの命令ビット数は m== 5ビットであり、 「レジスタ番号 2」 で示されるレジ スタ r iの命令ビット数は n= 1 3ビットである。
また、 命令形態 # F 3でも命令長が 24ビットであり、 「レジスタ番号 1」 で 示されるレジスタ r iの命令ビット数は n== 1 3ビットであり、 「レジスタ番号 2」 で示されるレジスタ r iの命令ビット数は m= 5ビットである。 命令形態 # F 4は命令長が 1 6ビットであり、 「レジスタ番号 1」 で示されるレジスタ r i の命令ビット数は m=5ビットであり、 Γレジスタ番号 2」 で示されるレジスタ r iの命令ビット数も m= 5ビットである。 いずれの命令形態 # F 1〜 # F 4に おいても、 最初の 2ビットは命令の種類を示している。 命令種類に関して、 1 o a dは転送、 a d dは加算、 cmpは比較、 ; j umpは制御移行 (分岐) を各々 示している。 l o a d、 a d d, cmp命令の場合は、 命令の後に 2ビッ トのァ クセス方法 # 1、 # 2が続く。 Operandは左がアクセス方法 # 1、 「レジスタ番号 1」 で表され、 右がアクセス方法 # 2、 「レジスタ番号 2」 で表される。
つまり、 アクセス方法 # 1は 「レジスタ番号 1」 で示されるレジスタ r iのァ クセス方法を示しており、 アクセス方法 # 2は 「レジスタ番号 2」 で示されるレ ジスタ r iのアクセス方法を示している。 アクセス方法 # 1とアクセス方法 # 2 はそれぞれレジスタ番号 No. 1、 レジスタ番号 No. 2に対応し、 これらの間 で処理が行われる。 いずれも、 図 1 8 Bに示すようにアクセス方法 # 1、 # 2に は 2種類が準備されている。 アクセス方法 # 1、 # 2に関してコード 「0」 が記 述された場合は、 レジスタ番号 2で示されるレジスタ r iに対し直接アクセスす る方法である。 当該レジスタ番号で示されるレジスタ r iの値を直接用いること を示している。 アクセス方法 # 1、 # 2に関してコード 「1」 が記述された場合 は、 「レジスタ番号 1」 で示されるレジスタ r iの値をァドレスとし、 当該マイ クロプロセッサ 101で外部メモリ 2に対してアクセスする方法である (図 18 B参照) 。
また、 図 1 7 A〜図 1 7 Dにおいて、 アクセス方法 # 1、 # 2の後には 2ビッ トの 「レジスタ種類 1」 、 「レジスタ種類 2」 が続けて記述されている。 「レジ スタ種類 1」 は 「レジスタ番号 1」 で示されるレジスタ r iの種類を示し、 「レ ジスタ種類 2」 は 「レジスタ番号 2」 で示されるレジスタ r iの種類を示してい る。 レジスタ種類は図 18 Cに示すように 2種類が準備されている。 「レジスタ 種類 1」 及ぴ 「レジスタ種類 2」 に関して、 コード 「0」 が記述される場合は、 レジスタ番号が 「31」 以下で使用頻度が高いレジスタ r iを示している。 この レジスタ r i (i =0〜31) はレジスタ番号を m= 5ビットで表現することが できる。 この 「レジスタ種類 1」 及び 「レジスタ種類 2」 に関して、 「1」 が記 述される場合は、 レジスタ番号が 「32」 以上で使用頻度が低いレジスタ r iを 示している。 このレジスタ r i (i =32〜8191) はレジスタ番号を n= 1 3ビットで表現するようになされる。 このように、 レジスタ番号の大きさを区別 することでプログラムを圧縮することができる。 この 「レジスタ種類 1」 、 「レ ジスタ種類 2」 の後には 「レジスタ番号 1」 、 「レジスタ番号 2」 が続けて記述 されている。 「レジスタ番号 1」 は例えば、 被数を保持するレジスタ r iを示し、 「レジスタ番号 2」 は加数を保持するレジスタ r iを示す。
また、 図 1 7 Eに示す j u m p命令のフォーマツトによれば、 最初の 2 b i t に命令が記述され、 続く 2 b i tにはフラグ状態 (flag condition) が記述され る。 続く 2 0 b i tにはジャンプアドレスが記述される。 フラグ状態は図 1 8 D に示すように、 命令実行制御を移すかどうかの判断をするための条件である。 コ ード 「0」 は 「無条件」 で常に制御を移す。 コード 「1」 は 「zero flagj で zero flagが 「1」 である場合に、 制御を移す。 コード 「2」 は 「non- zero flagj で zero flagが 「0」 である場合に制御を移すようになされる。 コード 「 3」 は未使用である。
続いて、 プログラム作成系 Iにおける処理例について説明をする。 図 1 9はプ ログラム作成系 Iにおけるプログラム作成例を示す表図である。 図 1 9において、
P 1はプログラム記述画面をイメージし、 P 2にはその記述内容を示し、 P 3に は実施例で該当する条件を記述したものである。 所定のプログラム言語に基づい てレジスタ相対メモリアドレッシング処理を実行する演算プログラムに基づいて 演算処理を実行するための命令を、 図 1に示したプログラム作成装置 2 0 0で編 集して圧縮プログラムを作成するためである。
プログラム作成装置 2 0 0では図 1に示した表示装置 2 4に図 1 9に示す C言 語によるプログラム記述画面 P 1を表示して、 キーボード 2 2及ぴマウス 2 3を 使用して圧縮プログラムが作成される。 このとき、 データベース 2 1からマイク 口プロセッサ 1 0 1のプログラム作成に必要なデータが読み出される。 例えば、 C言語によるプログラムの記述に必要な [Global変数宣言」 、 「関数宣言」 、 「Local変数宣言」 、 「代入」 、 「加算」 、 「比較」 及び 「分岐」 が読み出される。 この例で新規な設計製造に係るマイクロプロセッサ 1 0 1で、 N = 8 1 9 2個の 3 2ビットのレジスタ r iを使用する場合であって、 8 1 9 2個のレジスタ r i に第 0番から第 8 1 9 1番のシリアル番号を付与したとき、 第 0番から第 3 1番 のグループのレジスタ r 0〜r 3 1 ,を使用頻度が高い部類として 「Local変数宣 言」 がなされる。 つまり、 この例では第 3 1番目以下のレジスタ r iに 「Local変数宣言」 が割り 当てられる。 また、 第 3 2番から第 8 1 9 1番のグループのレジスタ r 3 2〜r 8 1 9 1を使用頻度が低い部類として 「Global変数宣言」 がなされる。 つまり、 第 3 2番目以上のレジスタ r iには 「Global変数宣言」 が割り当てられる。 プロ グラム作成装置 2 0 0では 「Global変数宣言」 がなされた第 3 2番から第 8 1 9 1番のグループのレジスタ r 3 2〜r 8 1 9 1の命令ビット数を n = 1 3ビット としたとき、 Local変数宣言がなされたレジスタ r 0〜r 3 1の命令ビット数は、 これよりも 8ビット少ない m= 5ビットに圧縮される。 これと共に、 当該プログ ラムの命令構造の中に 「レジスタ種類 1」 、 「レジスタ種類 2」 を記述して命令 長の異なる圧縮プログラム A Pを作成するようになされる。
図 1 3に示した制御装置 2 5ではレジスタ r iの使用頻度に応じて命令の長さ を可変するようになされる。 この例では、 使用頻度が高いレジスタ r 0〜r 3 1 を短い命令ビット数 m= 5ビットで命令セットし、 使用頻度が低いレジスタ r 3 2〜r 8 1 9 1は長い命令ビット数 n = 1 3ビットで命令セットするようになさ れる。 このようにすると、 頻繁にアクセスするレジスタ r 0〜r 3 1は短い長さ の命令をセットすることができ、 マイクロプロセッサ 1 0 1に実装されるプログ ラム格納用の R OM 1 4のメモリ容量を削減することができる。
続いて、 プログラム作成装置 2 0 0におけるコンパイル例について説明をする。 図 2 0はプログラム作成装置 2 0 0におけるコンパイル例を示すフローチヤ一ト (メインルーチン) である。 図 2 1はコンパイラにおける代入及ぴ演算処理例を 示すフローチャート (サブルーチン) である。
この実施例ではプログラム作成系 Iで c言語によるプログラムに基づいてレジ スタ相対メモリアドレツシング処理を実行する演算プログラムに基づいて演算処 理を実行するための命令を編集して圧縮プログラムを作成する場合を前提とする。 また、 マイクロプロセッサ 1 0 1が 8 1 9 2個のレジスタ r 0〜r 8 1 9 1を使 用する場合であって、 8 1 9 2個のレジスタ r iに第 0番から第 8 1 9 1番のシ リアル番号が付与される場合を例にとる。 これを処理条件にして、 プログラム作 成系 Iでは C言語によるプログラムに基づいて命令を編集するために、 図 2 0に フローチャートのステップ C 1でプログラムアドレスを 「0」 にする。 その後、 ステップ C 2に移行して C言語によるプログラムを一行読み込む。 このとき、 表 示装置 2 4のプログラム記述画面 P 1には、 例えば、 「global変数宣言」 を示す int *read― ada *write― add, counter, end― val;
が表示され、 また、 関数宣言を示す
void main 0
{
が表示される。
そして、 ステップ C 3で当該プログラムの記述が 「global変数宣言」 であるか をチェックする。 当該記述が 「global変数宣言」 である場合は、 ステップ C 4に 移行して第 3 2番目以上のレジスタ r 3 2〜r 8 1 9 1を割り当てる。 このグル ープのレジスタ r 3 2〜r 8 1 9 1を指定する命令ビット数を mビットとしたと き、 m= 1 3ビットである。 命令は命令形態 # F 1で作成される。 その後、 ステ ップ C 1 4に移行する。 また、 ステップ C 3で当該記述が 「global変数宣言」 で はない場合はステップ C 5に移行して 「local変数宣言」 かをチェックする。 この とき、 表示装置 2 4のプログラム記述画面 P 1には、 例えば、 「local変数宣言」 を示す
mt temp, a aed val;
が表示される。 当該記述が 「local変数宣言」 である場合は、 ステップ C 6に移行 して第 3 1番目以下のレジスタ r 0〜r 3 1を割り当てる。 レジスタ r iを使用 する頻度が高いことから、 当該レジスタ r iを指定する命令ビット数 nを、 「gl obal変数宣言」 されたレジスタ r 3 2〜 r 8 1 9 1よりも 8ビット少ない 5ビッ トに圧縮するためである。 命令は命令形態 # F 2乃至 # F 4で作成される。 その 後、 ステップ C 1 4に移行する。
上述のステップ C 5で当該記述が 「local変数宣言」 ではない場合はステップ C 7に移行して、 C言語のプログラムで代入'加算処理等の実行を示す 「do」 が記 述されているかをチェックする。 このとき、 表示装置 2 4のプログラム記述画面
P 1には、 例えば、 「do」 を示す d o {
temp = *read一 add;
temp = temp + added― val ;
*write― add = temp
read― add = read _ add + added _ val ;
write― add = write― add + added _ val;
counter = counter + added― va丄 j
}
が表示される。 このような代入 ·加算等の処理を示す 「do」 が記述されている場 合は、 ステップ C 8に移行して現在のプログラムアドレスを記憶する。 その後、 ステップ C 1 4に移行する。
ステップ C 7で 「do」 が記述されていない場合はステップ C 9に移行して C言 語のプログラムでその間の処理を示す 「while」 が記述されているかをチェックす る。 このとき、 表示装置 2 4のプログラム記述画面 P 1には、 例えば、 (whilej を示す
while (counter ! =end― val) ;
が表示される。 このような比較'分岐等の処理を示す 「while」 が記述されている 場合は、 ステップ C 1 0に移行して代入 ·演算処理を実行する。 例えば、 図 2 1 に示すサブルーチンをコールして、 そのフローチヤ一トのステップ E 1で C言語 のプログラムにおいて、 当該行が 「while」 を記述している行かがチェックされる。 「while」 が記述されている行の場合は、 ステップ E 2に移行して後続の処理で生 成する命令を c m p命令とする。 その後、 ステップ E 6に移行する。
ステップ E 1で 「while」 が記述されていない行の場合は、 ステップ E 3に移行 して演算処理は加算かをチェックする。 演算処理が加算の場合はステップ E 4に 移行して後続の処理で生成する命令を a d d命令とする。 演算処理が加算ではな い場合はステップ E 5に移行して後続の処理で生成する命令を I o a d命令とす る。 その後、 ステップ E 6に移行する。 ステップ E 6ではレジスタ r iに書き込 まれる変数に対応するレジスタ番号と、 レジスタアレイ 1 1 ' から読み出される 変数に対応するレジスタ r iのレジスタ番号を調べられる。 書込みアドレス Aw T JP03/03716
50
及ぴ読み出しアドレス A rを決めるためである。 その後、 ステップ E 7に移行す る。
ステップ E 7では両方のレジスタ番号が 「3 2」 以上かをチェックする。 両方 のレジスタ番号が 「3 2」 以上の場合はステップ E 8に移行して図 1 7 Aに示し た命令形態 # F 1で命令を生成する。 この命令形態 # F 1で 「レジスタ種類 1」 及ぴ 「レジスタ種類 2」 には 「1」 が記述される。 このとき、 「レジスタ種類 1」 及ぴ 「レジスタ種類 2」 は圧縮プログラムの命令構造の中に記述される。 例 えば、 第 3 2番から第 8 1 9 1番のグループのレジスタ r 3 2〜r 8 1 9 1に関 して 「レジスタ種類 1」 及び 「レジスタ種類 2」 に 「1」 が記述される。 その後、 図 2 0に示したメインルーチンのステップ C 1 0にリターンする。
また、 ステップ E 7で両方のレジスタ番号が 「3 2」 以上ではない場合はステ ップ E 9に移行して両方のレジスタ番号が 「3 1」 以下かをチェックする。 ここ で両方のレジスタ番号が 「3 1」 以下の場合はステップ E 1 0に移行して図 1 7 Dに示した命令形態 # F 4で命令を生成する。 この命令形態 # F 4で 「レジスタ 種類 1」 及ぴ 「レジスタ種類 2」 には 「0」 が記述される。 このとき、 「レジス. タ種類 1」 及ぴ 「レジスタ種類 2」 は圧縮プログラムの命令構造の中に記述され る。 例えば、 第 0番から第 3 1番のグループのレジスタ r 0〜r 3 1に関して 「レジスタ種類 1」 及び 「レジスタ種類 2」 に 「0」 が記述される。 その後、 図 2 0に示したメインルーチンのステップ C 1 0にリターンする。
更に、 両方のレジスタ番号が 「3 1」 以下ではない場合はステップ E 1 1に移 行してレジスタアレイ 1 1, から読み出される変数のレジスタ r iの番号が 「3 2」 以上かをチェックする。 読み出される変数のレジスタ r iの番号が 「3 2 _1 以上の場合は、 ステップ E 1 2に移行して図 1 7 Bに示した命令形態 # F 2で命 令を生成する。 この命令形態 # F 2で 「レジスタ種類 1」 に 「0」 が記述され、 「レジスタ種類 2」 には 「1」 が記述される。 その後、 図 2 0に示したメインル 一チンのステップ C 1 0にリターンする。
更にまた、 レジスタアレイ 1 1, から読み出される変数のレジスタ r iの番号 カ 「3 2」 以上ではない場合は、 ステップ E 1 3に移行して図 1 7 Cに示した命 令形態 # F 3で命令を生成する。 この命令形態 # F 3では 「レジ タ種類 1」 に 「1」 が記述され、 「レジスタ種類 2」 に 「0」 が記述される。 その後、 図 20 に示したメインルーチンのステップ C 10にリターンする。 その後、 ステップ C 1 1に移行して; i ump命令を生成する。 j ump命令の飛び先は先に記憶した プログラムアドレスを用いる。 その後、 ステップ C 14に移行する。 上述のステ ップ C 9で 「while」 が記述されていない場合はステップ C 1 2に移行して C言語 のプログラムにおいて、 データの代入又は加算かをチェックする。 データの代入 又は加算の場合はステップ C 13に移行してデータの代入又は演算処理を実行す る。 このステップ C 13では、 図 21に示したサブルーチンをコールして、 その フローチャートのステップ E 1〜E 13を経て図 20に示したメインルーチンの ステップ C 13にリターンする。 その後、 ステップ C 14に移行する。
また、 ステップ C 12で C言語のプログラムにおいて、 データの代入又は加算 ではない場合はステップ C 14に移行する。 ステップ C 14では C言語のプログ ラムに関して最後の行かをチェックされる。 最後の行ではない場合は、 ステップ C 15に移行してプログラムアドレスを進める。 その後、 ステップ C 2に戻って 上述したコンパイル処理を繰り返すようになされる。 最後の行に至ってこのコン パイル処理を終了する。 これにより、 図 17A〜図 1 7Eに示したような命令形 態 #F 1〜#F 5であって、 命令長の異なる圧縮プログラム APを作成すること ができる。 この圧縮プログラム APにおいて、 第 0番から第 31番のグループの レジスタ r 0〜r 3 1を指定する命令ビット数に関しては m=5ビットであり、 第 32番から第 81 91番のグループのレジスタ r 32〜r 8191を指定する 命令ビット数に関しては n= 1 3ビットである。
続いて、 プログラム実行系 IIにおける処理例について説明をする。 図 22は復 元された演算プログラムによる演算命令の例を示す表図である。 図 23はレジス タ r O, r 1 · - - · r 32, r 33, r 34, r 35等の状態例、 図 24は外 部メモリ 2におけるデータ格納例を各々示す図である。 この例では、 演算処理装 置 100, に接続された外部メモリ 2の中に図 24に示すような 10個のメモリ セルの配列を二組用意する。 一方はメモリ配列 #M 1で、 他方はメモリ配列 #M 2である。 そして、 図 22に示す 8つの演算命令 (Instruction) # 1 1~# 1 8に基づいて、 その一組のメモリ配列 #M1に格鈉された値に 「1」 を加算し、 もう一組のメモリ配列 #M 2にその結果を格納する演算処理の例を挙げる。
図 22に示す演算命令 ( I nstruction) # 1 1〜# 1 8は1 0]^14の圧縮プ ログラム APを復元した後の演算プログラムによるものである。 この演算プログ ラムでは図 23に示すように、 アクセス頻度が高いレジスタ r iが 2つあるため、 これらをそれぞれ r 0と r 1に割り当てた。 これにより、 プログラム全体の長さ を圧縮する前の演算プログラムに比べて効率よく短縮することができた。 また、 図 23において、 レジスタ番号 r 0で示されるレジスタは一時的に使用され、 レ ジスタ番号 r 1で示されるレジスタには加算値 「1」 が格納される。 また、 レジ スタ番号 r 32で示されるレジスタには読み出しアドレス 「0」 が格納され、 レ ジスタ番号 r 33で示されるレジスタには書込みアドレス 「10」 が格納され、 レジスタ番号 r 34で示されるレジスタにはカウンタの初期値 「0」 が格納され、 レジスタ番号 r 35で示されるレジスタには演算回数値 (終了値) 「10」 が格 糸内される。
図 22に示す各々の演算命令 # I 1〜# I 8には、 ニーモニックによる表現、 機械語による表現及ぴ処理の内容が示されている。 演算命令 # I 1は図 22に示 した命令構造において、 機械語で 140020 hによって表される l o a d, r 0, (r 32) であり、 レジスタアレイ 1 1, のレジスタ r 32の値をァドレス とし、 外部メモリ 2から読み出した値をレジスタ r 0に格納する内容である。 動 作としては例えば、 レジスタ r 32の値を 「0」 としたとき、 図 24に示した外 部メモリ 2の読み出しアドレスが 「0」 の内容である、 メモリ配列 #M1のデー タ 「0」 が読み出され、 このデータ 「0」 がレジスタ r 0に書き込まれる。
演算命令 # I 2は機械語で 4001 hによって表される a d d, r 0, r lで あり、 レジスタアレイ 1 1, のレジスタ r 0にレジスタ r 1の値を加算し、 その 結果をレジスタ r 0に格納する内容である。 動作としてはレジスタ r 0の内容で ある 「0」 にレジスタ r 1の値である 「1」 が加算され、 その結果 「1」 がレジ スタ r 0に書き込まれる。 演算命令 # I 3は機械語で 280420 hによって表 される l o a d, (r 33) , r 0であり、 レジスタアレイ 1 1, のレジスタ r 33の値をァドレスとして、 レジスタ r 0の値を外部メモリ 2に書き込む内容で ある。 動作としてはレジスタ r 33が示す外部メモリ 2のメモリ配列 #M2のァ ドレスにデータ 「1」 が書き込まれる。
演算命令 # I 4は機械語で 480401 hによって表される a d d, r 32, r lであり、 レジスタアレイ 1 1 ' のレジスタ r 32にレジスタ r 1の値を加算 して、 その結果をレジスタ r 32に格納する内容である。 動作としてはレジスタ r 32の内容である 「0」 にレジスタ r lの値である 「1」 が加算され、 その結 果 「1」 がレジスタ r 32に書き込まれる。 演算命令 # I 5は機械語で 4804 21 hによって表される a d d, r 33, r lであり、 レジスタアレイ 1 1' の レジスタ r 33にレジスタ r 1の値を加算して、 その結果をレジスタ r 33に格 納する内容である。 動作としてはレジスタ r 33の内容である 「0」 にレジスタ r 1の値である 「 1」 が加算され、 その結果 「 1」 がレジスタ r 33に書き込ま れる。
演算命令 # I 6は機械語で 480441 hによって表される a d d, r 34, r 1であり、 レジスタアレイ 1 1, のレジスタ r 34にレジスタ r 1の値を加算 して、 その結果をレジスタ r 34に格納する内容である。 動作としてはレジスタ r 34の内容である 「0」 にレジスタ r lの値である 「1」 が加算され、 その結 果 「1」 がレジスタ r 34に書き込まれる。 この演算命令 # I 4〜# I 6によつ て実行ステートマシーン 51内のカウンタでは読み出しァドレス A r及ぴ書き込 みアドレス Awに関して 「1」 が加算される。 演算命令 # I 7は機械語で 8C0 44023 hによって表される c mp, r 34, r 35であり、 レジスタアレイ 1 1, のレジスタ r 34の内容とレジスタ r 35.の内容とを比較し、 その値が同 じ場合は、 zero flagに 「1」 をセットし、 異なっている場合は 「0」 にセットす る内容である。 動作としてはレジスタ r 34とレジスタ r 35の値である 「1」 と 「10」 は異なるので、 zero flagには 「0」 がセットされる。 zero flagの値 はラッチ回路 510によって保持され、 以降の命令によって参照される。
演算命令 # I 8は機械語で E 00000 hによって表される j ump n z ,
LOOPであり、 zero flagが 「0」 の場合は、 LOOPで示されるラベルへ制御を移 す内容である。 動作としては、 zero flagが 「0」 の場合は制御を演算命令 # I 1 に移す。 上記の動作が 10回、 繰り返されるとレジスタ r 34の値が 「10」 に なり、 演算命令 # I 7により zero flagが 「 1」 にセットされ、 演算命令 # I 8で 制御が移らなくなり、 演算処理を終了するようになされる。 このように、 全ての レジスタ r iの命令ビット数を単一の方法で表現した場合と比べて、 効率良く R OM 1 4を使用することが可能になる。
続いて、 マイクロプロセッサ 1 0 1における動作例について説明をする。 図 2 5はマイクロプロセッサ 1 0 1における動作例を示すフローチャートである。 図 2 6 A及ぴ図 2 6 Bは命令ビット復元デコーダ 1 3における処理例を示すフロー チヤ一トである。
この実施例ではマイクロプロセッサ 1 0 1がプログラム実行系 IIを構成し、 R OM 1 4から読み出された圧縮プログラム A Pから図 2 2に示した演算命令 # I 1〜# I 8を含む演算プログラムを復元する。 このとき、 命令形態 # F 1〜# F 4に関して 「レジスタ種類 1」 及ぴ、 「レジスタ種類 2」 にコード 「0」 が記述 されている場合は、 命令ビット復元デコーダ 1 3によってレジスタ番号の拡張が 行われる。 この際の命令ビットの拡張では、 例えば、 「レ^スタ番号 1」 の命令 ビット数 m= 5ビットの上位に 8ビットの 「0」 を追加するようになされる。 こ の演算プログラムに基づいて、 図 2 4に示した外部メモリ 2の中のメモリ配列 # M lの値に 「1」 を加算し、 メモリ配列 #M 2に格納するようになされる。
レジスタアレイ 1 1, のレジスタ状態については、 図 2 3に示したように例え ば、 6個のレジスタ r 0, r 1 , r 3 2 , r 3 3 , r 3 4 , r 3 5に関して、 r 0が不定、 r 1が初期値 「 1」 、 r 3 2及び r 3 4が共に初期値 「 0」 、 r 3 3 及び r 3 5が初期値 「1 0」 が設定される。 これらの値を書き込む場合は、 実行 ステートマシーン 5 1ではレジスタアレイ 1 1, に書き込みァドレス Awが出力 され、 その初期値 「0 J 、 「1」 、 「1 0」 が設定される。 これを動作条件にし て、 図 2 5に示すフローチャートのステップ F 1で、 まず、 命令ビット復元デコ ーダ 1 3は ROM 1 4から圧縮プログラム (機械語命令) A Pを順次受け取り、 このプログラム A Pを解読して所定の命令長の演算命令 # I 1〜# I 8を検出す る。
この命令ビット復元デコーダ 1 3は例えば、 図 2 6 Aに示すサブルーチンをコ ールしてそのフローチャートのステップ G 1で命令部分を取り出し、 命令信号 S 9を実行ステ一トマシーン 5 1に出力する。 これと共に、 命令ビット復元デコー ダ 1 3ではステップ G 2に移行して当該命令形態が j u m p命令であるかをチェ ックする。 当該命令形態が # F 5で示される j u m p命令の場合はステップ G 1 2に移行して flag condition, jump addressを出力する。 その後、 メインルーチ ンのステップ F 1にリターンする。 また、 ステップ G 2で当該命令形態が〗 u m p命令でない場合は、 ステップ G 4に移行して当該命令形態に関して 「レジスタ 種類 1」 に記述されているコードは 「0」 又は 「1」 かをチェックする。 「レジ スタ種類 1」 にコード 「0」 が記述されている場合はステップ G 4に移行して 「レジスタ番号 1」 の命令ビット数 mを 5 b i t長として圧縮プログラム A P力、 ら取り出す。 その後、 ステップ G 5に移行して 「レジスタ番号 1」 の命令ビット 数 m= 5 b i tの上位 8ビットに 「0」 を付加して 1 3 b i t長とする。 その後、 図 2 6 Bに示すフローチャートのステップ G 7に移行する。
'なお、 上述のステップ G 3で 「レジスタ種類 1」 にコード 「1」 が記述されて いる場合はステップ G 6に移行して 「レジスタ番号 1」 の命令ビット数 nを 1 3 b i t長として圧縮プログラム A Pから取り出す。 そして、 図 2 6 Bに示すフロ 一チャートのステップ G 7に移行して、 当該命令形態に関して 「レジスタ種類 2 J に記述されているコードは 「0」 又は 「1」 かをチェックする。 「レジスタ 種類 2」 にコード 「0」 が記述されている場合はステップ G 8に移行して 「レジ スタ番号 2」 の命令ビット数 mを 5 b i t長として圧縮プログラム A Pから取り 出す。 その後、 ステップ G 9に移行して 「レジスタ番号 2」 の命令ビット数 m= 5 b i tの上位 8ビットに 「0」 を付加して 1 3 b i t長とする。 その後、 ステ ップ G 1 1に移行する。
上述のステップ G 7で 「レジスタ種類 2」 にコード 「1」 が記述されている場 合はステップ G 1 0に移行して 「レジスタ番号 2」 の命令ビット数 nを 1 3 b i t長として圧縮プログラム A Pから取り出す。 その後、 ステップ G 1 1に移行し て、 「レジスタ番号 1」 、 「レジスタ番号 2」 、 「アクセス方法 # 1」 及び 「ァ クセス方法 # 2」 を検出する。 その後、 図 2 5に示したメインルーチンのステツ プ F 1にリターンする。 従って、 実行ステートマシン 5 1には 「レジスタ種類 1」 及ぴ 「レジスタ種類 2」 は出力されず、 所定の命令長の演算命令 # I 1〜# I 8に基づく命令制御信号 S 4、 命令信号 S 9及び各引数信号 S 1 0が出力され る。
この命令信号 S 9には 1 o a d命令、 a d d命令、 c m p命令、 j u m p命令 が含まれる。 各引数信号 S 1 0にはアクセス方法 # 1, アクセス方法 # 2, レジ スタ番号 r 0 , r 1 · · ·等、 フラグ状態 (flag condition) 及びジャンプアド レス等が含まれる。 命令制御信号 S 4はデコーダ 1 3から命令読出しステートマ シーン 5 2に出力される。 なお、 R OM 1 4で圧縮プログラム A Pを読み出す場 所 (アドレス) はプログラムカウンタ 5 4 ( P C ) によって指定される。 これら の読み出しの動作は命令読み出しステートマシーン 5 2によって制御される。 命令読出しステートマシーン 5 2では命令ビット復元デコーダ 1 3から出力さ れる命令制御信号 S 4 基づいてプログラムカウンタ 5 4及ぴ実行ステートマシ ーン 5 1を制御する。 例えば、 当該マシーン 5 2は命令ビット復元デコーダ 1 3 から命令信号 S 9及び各引数信号 S 1 0が実行ステートマシーン 5 1へ出力され ると共に命令実行開始信号 S 2 9を出力する。 実行ステートマシーン 5 1では命 令実行開始信号 S 2 9に基づいて命令の実行を開始する。 例えば、 データの書込 み時には、 書込み制御信号 S wがレジスタアレイ 1 1, に出力され、 セレクタ 5 9には選択制御信号 S 2 4が出力される。 データの読出し時には、 レジスタァレ ィ 1 1 ' に読出しアドレス A rが出力される。
演算時には、 ラッチ制御信号 S 3 4がラッチ回路 5 8に出力され、 ラッチ回路 5 1 0にはラッチ制御信号 S 3 8が出力される。 当該プロセッサ外部には外部制 御信号 S 1 6が出力される。 命令の実行が終了すると、 実行ステートマシーン 5 1は命令読み出しステートマシーン 5 2へ実行終了信号 S 2 6を出力し、 プログ ラムカウンタ 5 4の値を進めるようになされる。 プログラムカウンタ 5 4では力 ゥント制御信号 S 3 0に基づいて R OM 1 4から圧縮プログラム A Pを読み出す 場所が指定される。 + 1インクリメンタ 5 5はプログラムカウンタ 5 4のカウン ト出力信号 S 5を 「+ 1」 してインクリメントするようになされる。
そして、 ステップ F 2で実行ステートマシーン 5 1は命令読出しステートマシ ーン 5 2の命令読出し制御を受けて演算命令 # I 1を受け取ると、 機械語で 1 4 0 0 2 0 hによって表される 1 o a d, r 0, ( r 3 2 ) に基づいて書込み信号 S 1 6を外部メモリ 2に出力する。 この値はレジスタアレイ 1 1, の読み出しァ ドレス A rとして用いられる。 レジスタアレイ 1 1 ' は 3 2番目の値をデータ信 号線 L 2 0に出力する。 この値はラッチ回路 5 1 1によって保持され、 アドレス パス 1 9 Bを経由し、 外部メモリ 2へ出力される。 そして、 レジスタアレイ 1 1 , のレジスタ r 3 2の値をァドレスとし、 外部メモリ 2から読み出した値をレジ スタ r Oに格納する。 このとき、 レジスタ r 3 2の値が 「0」 であるので、 図 2 4に示した外部メモリ 2のアドレスが 「0」 の内容であるメモリ配列 # M 1のデ ータ 「0」 が読み出され、 このデータ 「0」 がレジスタ r 0に書き込まれる。 つまり、 外部メモリ 2力 らァドレスバス 1 9 Bによって転送されたァドレス (場所) のデータがセレクタ 5 9に出力される。 実行ステートマシーン 5 1では このデータが選択されるように、 選択信号 S 2 4を出力する。 これにより、 デー タがレジスタアレイ 1 1, に入力される。 そして、 実行ステートマシーン 5 1で は書き込みァドレス Aw = 「0」 をレジスタアレイ 1 1, に出力する。 その後、 実行ステートマシン 5 1は書き込み信号 S wを用いて実際に、 演算結果値の書き 込みを指示するようになされる。 その後、 ステップ F 3で実行ステートマシン 5 1は命令読出しステートマシーン 5 2の命令読出し制御を受けて演算命令 # I 2 を受け取ると、 機械語で 4 0 0 1 hによって表される a d d , r 0 , r 1に基づ いてレジスタアレイ 1 1, のレジスタ r 0にレジスタ r 1の値を加算し、 その結 果をレジスタ r 0に格納する。 このとき、 レジスタ r Oの内容である 「0」 にレ ジスタ r 1の値である 「l j が加算され、 その結果 「1」 がレジスタ r 0に書き 込まれる。
そして、 ステップ F 4で実行ステートマシン 5 1は命令読出しステートマシー ン 5 2の命令読出し制御を受けて演算命令 # I 3を受け取ると、 機械語で 2 8 0 4 2 0 hによって表される 1 o a d, ( r 3 3 ) , r 0に基づいてレジスタァレ ィ 1 1, のレジスタ r 3 3の値をアドレスとして、 レジスタ r 0の値を外部メモ リ 2に書き込む。 このとき、 レジスタ r 3 3が示す外部メモリ 2のメモリ配列 # M 2のアドレスにデータ 「1」 が書き込まれる。 その後、 ステップ F 5で実行ス テートマシン 5 1は命令読出しステートマシーン 5 2の命令読出し制御を受けて 演算命令 # I 4を受け取ると、 機械語で 4 8 0 4 0 1 hによって表される a d d , r 3 2 , r 1に基づいてレジスタアレイ 1 1, のレジスタ r 3 2にレジスタ r 1 の値を加算して、 その結果をレジスタ r 3 2に格納する。 このとき、 レジスタ r 3 2の内容である 「0」 にレジスタ r lの値である 「1」 が加算され、 その結果 「1」 がレジスタ r 3 2に書き込まれる。 この演算命令 # I 4によって実行ステ 一トマシーン 5 1内のカウンタでは読み出しァドレス A r及ぴ書き込みァドレス Awに関して 「1」 が加算される。
そして、 ステップ F 6で実行ステートマシン 5 1は命令読出しステートマシー ン 5 2の命令読出し制御を受けて演算命令 # I 5を受け取ると、 機械語で 4 8 0 4 2 1 hによって表される a d d , r 3 3 , r 1に基づいてレジスタアレイ 1 1 , のレジスタ r 3 3にレジスタ r 1の値を加算して、 その結果をレジスタ r 3 3 に格納する。 このとき、 レジスタ r 3 3の内容である 「0」 にレジスタ r lの値 である 「1」 が加算され、 その結果 「1」 がレジスタ r 3 3に書き込まれる。 こ の演算命令 # I 5によって実行ステートマシーン 5 1内のカウンタでは読み出し アドレス A r及び書き込みアドレス Awに関して 「1」 が加算される。 その後、 ステップ F 7で実行ステートマシン 5 1は命令読出しステートマシーン 5 2の命 令読出し制御を受けて演算命令 # I 6を受け取ると、 機械語で 4 8 0 4 4 1 hに よって表される a d d , r 3 4 , r 1に基づいてレジスタアレイ 1 1, のレジス タ r 3 4にレジスタ r 1の値を加算して、 その結果をレジスタ r 3 4に格納する。 このとき、 レジスタ r 3 4の内容である 「0」 にレジスタ r lの値である 「1」 が加算され、 その結果 「1」 がレジスタ r 3 4に書き込まれる。 この演算命令 # I 6によって実行ステートマシーン 5 1内のカウンタでは読み出しァドレス A r 及ぴ書き込みアドレス A wに関して 「1」 が加算される。
この例では、 ステップ F 8でレジスタ r 3 5が示す値 = 1 0回に至ったかが判 別される。 例えば、 実行ステートマシン 5 1は命令読出しステートマシーン 5 2 の命令読出し制御を受けて演算命令 # I 7を受け取ると、 機械語で 8 C 0 4 4 0 2 3 hによって表される c m p, r 3 4 , r 3 5に基づいてレジスタアレイ 1 1 ' のレジスタ r 3 4の内容とレジスタ r 3 5の内容とを比較し、 その値が同じ場 合は、 zero flagに 「1」 をセットし、 異なっている場合は 「0」 にセットする。 このとき、 レジスタ r 3 4とレジスタ r 3 5の値である 「1」 と 「1 0」 は異な るので、 zero flagには 「0」 がセットされる。 zero flagの値はラッチ回路 5 1 0によって保持され、 以降の命令によって参照される。 そして、 実行ステートマ シン 5 1は命令読出しステートマシーン 52の命令読出し制御を受けて演算命令 # I 8を受け取ると、 機械語で E O 0000 hによって表される j ump n z, LOOPに基づいて zero flagが 「0」 の場合は、 LOOPで示されるラベルへ制御を 移行する。 zero flagが 「0」 の場合は制御をステップ F 2の演算命令 # I 1に移 す。 上記の動作がステップ F 8で 1 0回繰り返されるとレジスタ r 34の値が
「1 0」 になり、 演算命令 # I 7により zero flagが 「1」 にセットされ、 演算命 令 # 1 8で制御が移らなくなり、 演算処理を終了するようになされる。
このように、 本発明に係る第 4の実施例としてのマイクロプロセッサ 1 0 1に よれば、 8 1 92個のレジスタ r 0〜r 8 1 9 1の中でその使用頻度に基づいて 当該レジスタ r iを指定する命令ビット数が予め圧縮されると共に、 当該プログ ラムの命令構造の中に 「レジスタ種類: U 及び 「レジスタ種類 2」 が記述された 命令長の異なる圧縮プログラム APに基づいてデータを処理するようになされる。 ROM1 4には 8 1 9 2個のレジスタ r 0〜r 8 1 9 1の中から当該レジスタ r iを指定するための圧縮プログラム APが記憶される。 命令ビット復元デコーダ 1 3では、 この ROM14から圧縮プログラム APを読み出して 「レジスタ種類 1 J 及び 「レジスタ種類 2」 が解読され、 この 「レジスタ種類 lj 及ぴ 「レジス タ種類 2」 に基づいて当該レジスタ r iを指定するための命令ビット数が復元さ れる。
従って、 レジスタ r iの使用頻度に応じて可変された命令の長さの圧縮プログ ラム APであって、 頻繁にアクセスするレジスタ r 0〜r 3 1には短い長さの命 令がセットされた、 圧縮プログラムデータを ROM 14に格納することができる ので、 そのメモリ容量を低減することができる。 この例ではプログラムを圧縮す る前に比べて 1 6ビット X 3 2個 X命令数分だけメモリ容量を低減できる。 これ により、 メモリセルや論理演算素子から成る PLDによりマイクロプロセッサ 1 0 1を構築する場合に、 ROMとして機能させるメモリセルの占有率を低減する ことができ、 その分のメモリセルをレジスタに多く割り当てることができるよう になる。
この実施例では演算処理装置 1 00, に外部メモリ 2を接続してマイクロプロ セッサ 1 0 1を構成し、 複数のレジスタを指定してレジスタ相対メモリアドレツ シング処理を実行する演算プログラムに基づいて演算処理を実行する場合につい て説明したが、 これに限られることはなく、 第 1の実施例と同様にして、 レジス タ相対レジスタァドレッシング処理を実行するための演算命令を圧縮プログラム
A Pに基づいて演算処理を実行するようにしてもよい。 この場合には、 図 1 5に 示したレジスタアレイ 1 1, の入力部分に、 図 1に示したようなセレクタ 5 6 , 5 7を接続し、 このセレクタ 5 6, 5 7を実行ステートマシン 5 1で制御すれば よい。 このようにすると、 第 1の実施例のレジスタアレイ 1 1を随時書込み及び 読出し可能なメモリのように動作できるという効果、 基板占有面積を低減できる という効果に加えて、 第 2の実施例のプログラムデータを格納する R OM等のメ モリ容量を低減できるという効果とを重複して得られるようになる。 産業上の利用可能性
この発明は各種電子機器に内蔵可能でプログラム可能な 1チップマイクロコン ピュータ等に、 また、 命令実行プログラム等に基づいて各種データ処理をする C P Uや、 MP U、 P L D等、 これらの組み込み電子機器に適用して極めて好適で める。

Claims

請 求 の 範 囲
1 . 任意の演算プログラムに基づいて演算処理をする装置であって、
書込みアドレス及ぴ書込み制御信号に基づいて任意の値を保持し、 及び、 読出 しァドレスに基づいて当該値を出力するレジスタを複数有したレジスタアレイと、 前記レジスタァレイから読み出された値を演算する演算部と、
前記演算部を動作させるための演算プログラムから演算命令を解読する命令解 読部と、
前記命令解読部によって解読された演算命令を実行するために前記レジスタァ レイ及び演算部を制御する命令実行制御部とを備え、
前記命令実行制御部は、
前記演算命令に基づいて一の前記レジスタを選択し、
選択された前記レジスタが保持する値によって他のレジスタを選択するレジス タ相対レジスタアドレッシング処理を実行することを特徴とする演算処理装置。
2 . 前記演算プログラムを格納した読出し専用メモリセルを備えることを特徴と する請求項 1に記載の演算処理装置。
3 . 前記演算プログラムには、
前記レジスタ相対レジスタァドレッシング処理を実行するための演算命令を含 むことを特徴とする請求項 1に記載の演算処理装置。
4 . 前記レジスタアレイ及び読出し専用メモリが複数のメモリセルにより構成さ れ、
前記演算部、 命令解読部及び命令実行制御部が複数の算術論理演算素子により 構成され、
前記メモリセル及び算術論理演算素子を同一半導体チップ上に備えたプログラ マプル'ロジック 'デパイスによって構成されることを特徴とする請求項 1に記
5 . 前記命令実行制御部には、
前記一のレジスタを選択するための読出し実行ァドレス又は当該レジスタを再 度選択するための読出しァドレスのいずれか一方を選択する第 1のセレクタと、 前記一のレジスタを選択するための書込み実行ァドレス又は当該レジスタを再 度選択するための書込みァドレスのいずれか一方を選択する第 2のセレクタとを 有することを特徴とする請求項 1に記載の演算処理装置。
6 . 任意の演算プログラムに基づいて演算処理をする装置を構築する方法であつ て、
予め同一半導体チップ上に複数のメモリセル及び算術論理演算素子を形成し、 前記メモリセルを組み合わせてレジスタァレイ及び読出し専用メモリを画定す ると共に、 前記算術論理演算素子を組み合わせて演算部、 命令解読部及び命令実 行制御部を画定し、 その後、 前記レジスタアレイ、 読出し専用メモリ、 演算部、 命令解読部及び命令実行制御部を予め設定された配線情報に基づいて結線すると 共に、 前記読出し専用メモリに任意の演算プログラムを書込むことを特徴とする
7 . 前記演算プログラムには、
前記レジスタ相対レジスタァドレッシング処理を実行するための演算命令を含 むことを特徴とする請求項 6に記載の演算処理装置の構築方法。
8 . 前記配線情報を格納する書き換え可能な不揮発性の記憶装置が設けられ、 電源オンと共に前記記憶装置から配線情報を読み出して設定し、
設定された前記配線情報に基づいて前記レジスタアレイ、 読出し専用メモリ、 演算部、 命令解読部及び命令実行制御部間を結線することを特徴とする請求項 6 に記載の演算処理装置の構築方法。
9 . 前記記憶装置に格納される配線情報は当該演算処理装置の機能に応じて随時 書き換えられることを特徴とする請求項 6に記載の演算処理装置の構築方法。
1 0 . 前記レジスタアレイは、
書込みアドレス及ぴ書込み制御信号に基づいて任意の値を保持し、 及び、 読出 しァドレスに基づいて当該値を出力する複数のレジスタを有することを特徴とす る請求項 6に記載の演算処理装置の構築方法。
1 1 . 前記命令実行制御部は、
前記演算命令に基づいて一の前記レジスタを選択し、
選択された前記レジスタが保持する値によって他のレジスタを選択するレジス タ相対レジスタァドレッシング処理を実行することを特徴とする請求項 6に記載 の演算処理装置の構築方法。
1 2 . 前記命令実行制御部には、
前記一のレジスタを選択するための読出し実行ァドレス又は当該レジスタを再 度選択するための読出しァドレスのいずれか一方を選択する第 1のセレクタと、 前記一のレジスタを選択するための書込み実行ァドレス又は当該レジスタを再 度選択するための書込みァドレスのいずれか一方を選択する第 2のセレクタとが 備えられることを特徴とする請求項 6に記載の演算処理装置の構築方法。
1 3 . 前記演算部では前記レジスタアレイから読み出された値が演算され、 前記命令解読部では前記演算部を動作させるための演算プログラムから演算命 令が解読され、
前記命令実行制御部では前記命令解読部によつて解読された演算命令を実行す るために前記レジスタアレイ及び演算部が制御されることを特 ί敫とする請求項 6 に記載の演算処理装置の構築方法。
1 4 . 任意の演算プログラムに基づいて演算処理をする方法であって、
書込みアドレス及ぴ書込み制御信号に基づいて任意の値を保持し、 及び、 読出 しァドレスに基づいて当該値を出力するレジスタを予め複数準備し、 その後、 前記演算プログラムから演算命令を解読し、
前記演算命令に基づいて一の前記レジスタを選択し、
選択された前記レジスタが保持する値によって他のレジスタを選択するレジス タ相対レジスタァドレッシング処理を実行すると共に、 前記演算命令に基づいて 他の前記レジスタを選択し、
選択された他の前記レジスタが保持する値と前記レジスタ相対レジスタァドレ ッシング処理によって選択されたレジスタの値とを演算することを特徴とする演 算処理方法。
1 5 . 前記レジスタが保持する値によって選択されているレジスタに前記演算の 結果を格納することを特徴とする請求項 1 4に記載の演算処理方法。
1 6 . 前記演算プログラムには、
前記レジスタ相対レジスタアドレツシング処理を実行するための演算命令を含 むことを特徴とする請求項 1 4に記載の演算処理方法。
1 7 . レジスタ相対レジスタアドレッシング処理を実行する演算プログラムに基 づいて演算処理をする装置であって、
複数のレジスタと、
前記レジスタを使用する頻度に基づいて、 当該レジスタを指定する命令ビット 数が予め圧縮されると共に、 前記プログラムの命令構造の中にレジスタ種類が記 述された命令長の異なる圧縮プログラムを記憶する記憶部と、
前記記憶部から圧縮プログラムを読み出してレジスタ種類を解読し、 当該レジ スタ種類に基づいて前記レジスタを指定するための命令ビット数を復元する命令 解読部と、
前記命令解読部によつて復元された所定長さの命令に基づいて前記レジスタを 指定して任意の演算を実行する命令実行演算部とを備えることを特徴とする演算 処理装置。
1 8 . 前記レジスタ種類は、
N個のレジスタを使用する場合であって、
前記 N個のレジスタに第 1番から第 N番のシリアル番号を付与したとき、 前記第 1番から第 K番のグループのレジスタを使用頻度が高い部類に、 前記第 K + 1番から第 N番のグループのレジスタを使用頻度が低い部類に分けられるこ とを特徴とする請求項 1 7に記載の演算処理装置。
1 9 . レジスタ相対レジスタアドレッシング処理を実行する演算プログラムに基 づいて演算処理をする演算方法であって、
前記レジスタを使用する頻度に基づいて、 当該レジスタを指定する命令ビット 数が予め圧縮される共に、 前記プログラムの命令構造の中にレジスタ種類が記述 された命令長の異なる圧縮プログラムを記憶し、
前記圧縮プログラムを読み出してレジスタ種類を解読し、
当該レジスタ種類に基づいて前記レジスタを指定するための命令ビット数を復 兀し、
復元された前記所定長さの命令に基づいて前記レジスタを指定して任意の演算 を実行することを特徴とする演算処理方法。
2 0 . 前記レジスタ種類は、
N個のレジスタを使用する場合であって、
前記 N個のレジスタに第 1番から第 N番のシリアル番号を付与したとき、 前記第 1番から第 K番のグループのレジスタを使用頻度が高 、部類に、 前記第 K+ 1番から第 N番のグループのレジスタを使用頻度が低い部類に分け られることを特徴とする請求項 1 9に記載の演算処理方法。
2 1 . —方で、 所定のプログラム言語に基づいて、 レジスタ相対レジスタァドレ ッシング演算を実行するための命令を編集してプログラムを作成するプログラム 作成装置と、 他方で、 当該プログラムと複数のレジスタとを使用して前記レジス タ相対レジスタアドレッシング演算を実行する演算処理装置とを有する演算処理 システムであって、
前記プログラム作成装置は、
前記レジスタを使用する頻度に基づいて当該レジスタを指定する命令ビット数 を圧縮すると共に、 当該プログラムの命令構造の中にレジスタ種類を記述して命 令長の異なる圧縮プログラムを作成し、
前記演算処理装置は、
前記プロダラム作成装置で作成された圧縮プログラムを取得してレジスタ種類 を解読し、
前記レジスタ種類に基づいて当該レジスタを指定する命令ビット数を復元し、 所定長さの命令に基づいて複数のレジスタを指定して任意の演算を実行すること を特徴とする演算処理システム。
2 2 . 前記演算処理は、
複数のレジスタと、
前記レジスタを指定するための圧縮プログラムを記憶する記憶部と、 前記記憶部から圧縮プログラムを読み出してレジスタ種類を解読し、 当該レジ スタ種類に基づいて前記レジスタを指定するための命令ビット数を復元する命令 解読部と、
前記命令解読部によつて復元された所定の長さの命令に基づいて前記レジスタ を指定して任意の演算を実行する命令実行演算部とを有することを特徴とする請 求項 2 1に記載の演算処理システム。
2 3 . 前記レジスタ種類は、
N個のレジスタを使用する場合であって、
前記 N個のレジスタに第 1番から第 N番のシリアル番号を付与したとき、 前記第 1番から第 K番のグループのレジスタを使用頻度が高い部類に、 前記第 K + 1番から第 N番のグループのレジスタを使用頻度が低い部類に分け ることを特徴とする請求項 2 1に記載の演算処理システム。
2 4 . プログラム作成系で所定のプログラム言語に基づいてレジスタ相対レジス タァドレッシング演算を実行するための命令を編集してプログラムを作成し、 プ 口グラム実行系で当該プロダラムと複数のレジスタとを使用して前記レジスタ相 対レジスタァドレッシング演算を実行する演算処理方法であって、
前記プログラム作成系では、
前記レジスタを使用する頻度に基づいて当該レジスタを指定する命令ビット数 を圧縮すると共に、 当該プログラムの命令構造の中にレジスタ種類を記述して命 令長の異なる圧縮プログラムを作成し、
前記プログラム実行系では、
前記プログラム作成系で作成された圧縮プログラムを取得してレジスタ種類を 解読し、
解読された前記レジスタ種類に基づいて当該レジスタを指定する命令ビット数 を復元し、
復元された所定長さの前記命令に基づいて複数のレジスタを指定して任意の演 算を実行することを特徴とする演算処理方法。
2 5 . 前記レジスタ種類は、
N個のレジスタを使用する場合であって、
前記 N個のレジスタ第 1番から第 N番のシリアル番号を付与したとき、 前記第 1番から第 K番のグループのレジスタを使用頻度が高い部類に、 前記第 K + 1番から第 N番のグループのレジスタを使用頻度が低い部類に分け ることを特徴とする請求項 2 4に記載の演算処理方法。
PCT/JP2003/003716 2002-03-27 2003-03-26 Processeur d'operations, procede de construction, systeme de traitement d'operations et procede de traitement d'operations WO2003081422A1 (fr)

Priority Applications (5)

Application Number Priority Date Filing Date Title
EP03715417A EP1489493A1 (en) 2002-03-27 2003-03-26 Operation processor, building method, operation processing system, and operation processing method
KR10-2004-7015082A KR20040097212A (ko) 2002-03-27 2003-03-26 연산 처리 장치, 그 구축 방법, 연산 처리 시스템 및 연산처리 방법
US10/508,802 US7581083B2 (en) 2002-03-27 2003-03-26 Operation processing device, system and method having register-to-register addressing
US11/821,447 US20080046470A1 (en) 2002-03-27 2007-06-22 Operation-processing device, method for constructing the same, and operation-processing system and method
US11/821,424 US20070250685A1 (en) 2002-03-27 2007-06-22 Operation-processing device, method for constructing the same, and operation-processing system and method

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2002088916A JP2003288204A (ja) 2002-03-27 2002-03-27 演算処理装置、その構築方法及び演算処理方法
JP2002-88916 2002-03-27
JP2002195123A JP3698125B2 (ja) 2002-07-03 2002-07-03 データ処理システム、データ処理装置及びデータ処理方法
JP2002-195123 2002-07-03

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US11/821,424 Division US20070250685A1 (en) 2002-03-27 2007-06-22 Operation-processing device, method for constructing the same, and operation-processing system and method

Publications (1)

Publication Number Publication Date
WO2003081422A1 true WO2003081422A1 (fr) 2003-10-02

Family

ID=28456288

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2003/003716 WO2003081422A1 (fr) 2002-03-27 2003-03-26 Processeur d'operations, procede de construction, systeme de traitement d'operations et procede de traitement d'operations

Country Status (4)

Country Link
US (3) US7581083B2 (ja)
EP (1) EP1489493A1 (ja)
KR (1) KR20040097212A (ja)
WO (1) WO2003081422A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8364934B2 (en) 2006-07-11 2013-01-29 Freescale Semiconductor, Inc. Microprocessor and method for register addressing therein

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006285402A (ja) * 2005-03-31 2006-10-19 Pioneer Electronic Corp 画像処理装置
US8407715B2 (en) * 2007-04-30 2013-03-26 National Tsing Hua University Live range sensitive context switch procedure comprising a plurality of register sets associated with usage frequencies and live set information of tasks
WO2009137108A1 (en) * 2008-05-08 2009-11-12 Mips Technologies, Inc. Microprocessor with compact instruction set architecture
US20100312991A1 (en) * 2008-05-08 2010-12-09 Mips Technologies, Inc. Microprocessor with Compact Instruction Set Architecture
US9900280B2 (en) * 2009-03-30 2018-02-20 Avaya Inc. System and method for managing incoming requests for a communication session using a graphical connection metaphor
CN104571949B (zh) * 2014-12-22 2017-07-07 华中科技大学 基于忆阻器实现计算与存储融合的处理器及其操作方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0491519A (ja) * 1990-08-06 1992-03-25 Hitachi Ltd プライオリティーエンコーダ及びこれを用いた半導体集積回路
JPH0555907A (ja) * 1991-08-23 1993-03-05 Kawasaki Steel Corp プログラマブル論理回路装置
JPH10320172A (ja) * 1997-05-15 1998-12-04 Seiko Epson Corp プログラム圧縮方法およびプログラム復号方法ならびにプログラム格納装置
WO2000019329A1 (fr) * 1998-09-28 2000-04-06 Roran Co. Circuit integre et son support d'enregistrement

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62251930A (ja) 1986-04-25 1987-11-02 Nec Corp 情報処理装置
JPH0399321A (ja) 1989-09-13 1991-04-24 Fujitsu Ltd 命令制御方式
US5890222A (en) * 1995-01-04 1999-03-30 International Business Machines Corporation Method and system for addressing registers in a data processing unit in an indirect addressing mode
US5493239A (en) * 1995-01-31 1996-02-20 Motorola, Inc. Circuit and method of configuring a field programmable gate array
US6651160B1 (en) * 2000-09-01 2003-11-18 Mips Technologies, Inc. Register set extension for compressed instruction set
US7023744B1 (en) * 2003-11-18 2006-04-04 Xilinx, Inc. Reconfigurable SRAM-ROM cell

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0491519A (ja) * 1990-08-06 1992-03-25 Hitachi Ltd プライオリティーエンコーダ及びこれを用いた半導体集積回路
JPH0555907A (ja) * 1991-08-23 1993-03-05 Kawasaki Steel Corp プログラマブル論理回路装置
JPH10320172A (ja) * 1997-05-15 1998-12-04 Seiko Epson Corp プログラム圧縮方法およびプログラム復号方法ならびにプログラム格納装置
WO2000019329A1 (fr) * 1998-09-28 2000-04-06 Roran Co. Circuit integre et son support d'enregistrement

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8364934B2 (en) 2006-07-11 2013-01-29 Freescale Semiconductor, Inc. Microprocessor and method for register addressing therein

Also Published As

Publication number Publication date
US7581083B2 (en) 2009-08-25
KR20040097212A (ko) 2004-11-17
EP1489493A1 (en) 2004-12-22
US20050149556A1 (en) 2005-07-07
US20070250685A1 (en) 2007-10-25
US20080046470A1 (en) 2008-02-21

Similar Documents

Publication Publication Date Title
US6671797B1 (en) Microprocessor with expand instruction for forming a mask from one bit
US6061783A (en) Method and apparatus for manipulation of bit fields directly in a memory source
JP2992223B2 (ja) コンピュータシステム、命令ビット長圧縮方法、命令発生方法、及びコンピュータシステム動作方法
US7194605B2 (en) Cache for instruction set architecture using indexes to achieve compression
US6128614A (en) Method of sorting numbers to obtain maxima/minima values with ordering
EP1058185A1 (en) A multiply and accumulate apparatus and a method thereof
US20050198471A1 (en) Micro-controller for reading out compressed instruction code and program memory for compressing instruction code and storing therein
CN104375972A (zh) 用于可配置数学硬件加速器的微处理器集成配置控制器
EP1126368A2 (en) Microprocessor with non-aligned circular addressing
JPH11154114A (ja) 複数データ・フェッチのアーキテクチャを使ってテーブル・ルックアップを実行するためのシステムおよび方法
JP2002539519A (ja) Vliwプロセッサにおけるレジスタ・アドレッシングの間接制御を提供するためのレジスタファイル索引付け方法及び装置
KR20000076310A (ko) 리스크 구조를 갖는 8 비트 마이크로콘트롤러
KR100465388B1 (ko) Risc 구조의 8비트 마이크로 제어기
JPH06332695A (ja) データ処理装置及びその制御回路
US20080046470A1 (en) Operation-processing device, method for constructing the same, and operation-processing system and method
US6036350A (en) Method of sorting signed numbers and solving absolute differences using packed instructions
JPH01119828A (ja) マイクロプロセッサ
JPH03216776A (ja) 集積回路装置及びそれにより構成されたマイクロプロセッサ
JP4078243B2 (ja) 繰返しブロック命令を入れ子ループに沿ってゼロ・サイクル・オーバヘッドで実行する方法及び装置
US6542989B2 (en) Single instruction having op code and stack control field
JP2004086837A (ja) データ処理装置
JPH08509826A (ja) 圧縮されたbiosシステム
US7509478B1 (en) Program memory space expansion for particular processor instructions
JPH09231071A (ja) コンピュータ装置
US6757819B1 (en) Microprocessor with instructions for shifting data responsive to a signed count value

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): KR US

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT SE SI SK TR

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2003715417

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 10508802

Country of ref document: US

Ref document number: 1020047015082

Country of ref document: KR

WWP Wipo information: published in national office

Ref document number: 1020047015082

Country of ref document: KR

WWP Wipo information: published in national office

Ref document number: 2003715417

Country of ref document: EP