US20170161217A1 - Processor and controlling method thereof - Google Patents

Processor and controlling method thereof Download PDF

Info

Publication number
US20170161217A1
US20170161217A1 US15/136,183 US201615136183A US2017161217A1 US 20170161217 A1 US20170161217 A1 US 20170161217A1 US 201615136183 A US201615136183 A US 201615136183A US 2017161217 A1 US2017161217 A1 US 2017161217A1
Authority
US
United States
Prior art keywords
register
instruction
processor
isr
data
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
US15/136,183
Other versions
US10318452B2 (en
Inventor
Chae-seok Im
Dong-kwan Suh
Suk-Jin Kim
Seung-Won Lee
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Samsung Electronics Co Ltd
Original Assignee
Samsung Electronics Co Ltd
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
Application filed by Samsung Electronics Co Ltd filed Critical Samsung Electronics Co Ltd
Assigned to SAMSUNG ELECTRONICS CO., LTD. reassignment SAMSUNG ELECTRONICS CO., LTD. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: IM, CHAE-SEOK, KIM, SUK-JIN, LEE, SEUNG-WON, SUH, DONG-KWAN
Publication of US20170161217A1 publication Critical patent/US20170161217A1/en
Application granted granted Critical
Publication of US10318452B2 publication Critical patent/US10318452B2/en
Expired - Fee Related legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt
    • 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/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • G06F9/30043LOAD or STORE instructions; Clear instruction
    • 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
    • G06F9/3012Organisation of register space, e.g. banked or distributed register file
    • G06F9/30123Organisation of register space, e.g. banked or distributed register file according to context, e.g. thread buffers
    • 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/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/30181Instruction operation extension or modification
    • G06F9/30189Instruction operation extension or modification according to execution mode, e.g. mode flag
    • 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/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3802Instruction prefetching
    • 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/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3818Decoding for concurrent execution
    • G06F9/382Pipelined decoding, e.g. using predecoding
    • 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/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3861Recovery, e.g. branch miss-prediction, exception handling
    • 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/46Multiprogramming arrangements
    • G06F9/461Saving or restoring of program or task context
    • G06F9/462Saving or restoring of program or task context with multiple register sets
    • 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Definitions

  • Apparatuses and methods consistent with the present invention relate to a processor and a control method thereof, and more particularly, to a processor and a control method thereof, for processing an interrupt service.
  • An electronic apparatus executes an application program to perform a specific function.
  • the application program is a service routine containing consecutive instructions, and a processor of an electronic apparatus processes consecutive instructions.
  • the processor sequentially processes consecutive instructions.
  • the application program may include an interrupt service routine as necessary.
  • the interrupt service routine may be executed according to generation of an event that is set during processing of a main service routine.
  • the processor stops processing of the main service routine and processes the interrupt service routine.
  • the processor needs to use a register in the processor in order to process the interrupt service routine.
  • the processor may now know a register to be used at a time point when the interrupt service routine is started. Accordingly, the processor stores data stored in all registers in a memory and then processes the interrupt service routine.
  • the processor restores data stored in the memory back to all registers. Accordingly, a long period of time is taken to process the interrupt service routine.
  • Exemplary embodiments of the present invention overcome the above disadvantages and other disadvantages not described above. Also, the present invention is not required to overcome the disadvantages described above, and an exemplary embodiment of the present invention may not overcome any of the problems described above.
  • the present invention provides a processor and control method for reducing processing time of an interrupt service routine.
  • a processor includes an instruction fetch module configured to receive a first instruction of an interrupt service routine without backup of data stored in a register in response to processing of the interrupt service routine being requested, a detecting module configured to analyze the received first instruction to determine whether the data stored in the register needs to be changed, an instruction generating module configured to generate a second instruction for storing data in a temporary memory when the stored data is initially changed, an instruction selecting module configured to sequentially select the generated second instruction and first instruction, and a control module configured to perform the second instruction and the first instruction.
  • the control module may store the data in the temporary memory and then performs the first instruction.
  • the control module may restore the data stored in the temporary memory to the register in response to the interrupt service routine being terminated.
  • the detecting module may change a value of a register flag when the value of the register flag is initialized and the stored data is initially changed in response to processing of the interrupt service routine containing the register flag being requested.
  • the detecting module may determine that the stored data is changed when the value of the register flag is changed.
  • a plurality of registers may be present.
  • the control module may restore only data corresponding to a register, a value of a register flag of which is changed, among the plurality of registers from the temporary memory.
  • the instruction generating module may not generate the second instruction when the data stored in the register is not changed or is not initially changed.
  • a controlling method of a processor includes receiving a first instruction of an interrupt service routine without backup of data stored in a register in response to processing of the interrupt service routine being requested, analyzing the received first instruction to determine whether the data stored in the register needs to be changed, generating a second instruction for storing data in a temporary memory when the stored data is initially changed, sequentially selecting the generated second instruction and first instruction, and performing the second instruction and the first instruction.
  • the performing may include storing the data in the temporary memory and then performing the first instruction.
  • the method may further include restoring the data stored in the temporary memory to the register in response to the interrupt service routine being terminated.
  • the determining may include changing a value of a register flag when the value of the register flag is initialized and the stored data is initially changed in response to processing of the interrupt service routine containing the register flag being requested.
  • the determining may include determining that the stored data is changed when the value of the register flag is changed.
  • a plurality of registers may be present, and the restoring may include restoring the control module restores only data corresponding to a register, a value of a register flag of which is changed, among the plurality of registers from the temporary memory.
  • the generating may include not generating the second instruction when the data stored in the register is not changed or is not initially changed.
  • a processor and a control method thereof may reduce processing time of an interrupt service routine so as to enhance performance of the processor.
  • FIG. 1 is a block diagram of a processor according to an exemplary embodiment of the present invention
  • FIG. 2 is a diagram for explanation of a procedure for processing an interrupt service routine (ISR) according to an exemplary embodiment of the present invention
  • FIG. 3 is a diagram for velocity comparison between different processor cores for processing the same ISR
  • FIG. 4 is a flowchart for explanation of a procedure for analyzing an instruction according to an exemplary embodiment of the present invention
  • FIG. 5 is a diagram for explanation of a method for displaying a register that backs up data according to an exemplary embodiment of the present invention.
  • FIG. 6 is a flowchart of a control method of a processor according to an exemplary embodiment of the present invention.
  • first”, “second”, etc. may be used to describe various elements, but the elements are not limited by the terms. The terms, if any, are used for distinguishing between one element and other elements.
  • module or “unit” of a component used in the disclosure performs at least one function or operation.
  • the “module” or the “unit” should be understood as performing a function or an operation in a hardware manner, a software manner, or a combination of the hardware manner and the software manner.
  • a plurality of “modules” or a plurality of “units” except for a “module” or “unit” that is embodied in specific hardware or embodied in at least one processor may be integrated into at least one module.
  • FIG. 1 is a block diagram of a processor 100 according to an exemplary embodiment of the present invention.
  • the processor 100 may include an instruction fetch module 110 , a detecting module 120 , an instruction generating module 130 , an instruction selecting module 140 , and a control module 150 .
  • the instruction fetch module 110 may receive a first instruction of the ISR without backup of data stored in a register.
  • the ISR may be executed when an interrupt event occurs.
  • the processor 100 executes an application program.
  • the application program may include a main service routine.
  • the processor 100 may sequentially process the instruction included in the main service routine. While the processor 100 executes the main service routine, an interrupt event may occur in an external apparatus (not shown).
  • the external apparatus may include a disk, a keyboard, a printer, a display apparatus, and so on.
  • the processor 100 may temporally stop the main service routine that is being processed and may execute an ISR corresponding to the generated interrupt.
  • a processor prior to execution of an ISR, a processor backs up data of a register in a temporary memory.
  • the temporary memory may be a stack.
  • the processor needs to write data in a register while processing an instruction included in the ISR. Accordingly, in order to retain data written in a register while executing a main service routine, the processor backs up the data of the register to the temporary memory prior to execution of the ISR.
  • the processor does not know a register to be used during execution of the ISR, and thus backs up data stored in all registers to the temporary memory. Accordingly, in the case of the prior art, a long period of time is taken before the processor processes the ISR.
  • the processor 100 may not back up data stored in a register to a temporary memory prior to execution of an ISR. Accordingly, the processor 100 according to the embodiments of the present invention may save time to back up data of the register.
  • the processor 100 may receive an instruction of the ISR. That is, in response to a request to process the ISR, the instruction fetch module 110 inside the processor 100 may receive an instruction of the ISR without back up of the data registered in the register.
  • the detecting module 120 may analyze an input first instruction to determine whether data stored in a register needs to be changed. As described above, the processor 100 according to the embodiments of the present invention may not back up the data stored in the register prior to execution of the ISR. However, the processor 100 needs to write data in the register while processing the ISR. Accordingly, the detecting module 120 may determine whether a register needs to be used to process a first instruction input to the instruction fetch module 110 . When the register needs to be used, the processor 100 may back up the data stored in the register to be used to the temporary memory and process the input first instruction. In addition, when the register is not necessarily use the register, the processor 100 may process the input first instruction without back up of data. A detailed process of analyzing an instruction input to the detecting module 120 will be described in detail.
  • the instruction generating module 130 may generate a second instruction for storing data stored in the register, in the temporary memory.
  • the second instruction may be a storing instruction.
  • the processor 100 may perform a function of processing an input instruction.
  • the processor 100 may perform a data backup function only in response to a data backup instruction being received.
  • the data backup instruction is not included in the ISR, and thus the instruction generating module 130 may generate the data backup instruction. That is, the data backup instruction may be a storing instruction for storing data in the temporary memory.
  • the processor 100 may first execute the storing instruction generated by the instruction generating module 130 in the processor 100 so as to store the data of the resister in the temporary memory.
  • the processor 100 may process the first instruction input to the instruction fetch module 110 .
  • the data of the register which needs to be backed up before the processor 100 processes the first instruction of the ISR, may be data that is stored in the register during execution of the main service routine. Accordingly, it is sufficient that the processor 100 backs up the data stored in the register while executing the main service routine.
  • Instructions included in the ISR may be formed so as to execute the ISR. For example, when first data that is stored in a register during processing of a first instruction of the ISR needs to be used in a subsequently processed instruction, the ISR may be formed so as to store second data that is stored in a register during processing of a second instruction in another register.
  • the instruction generating module 130 may backs up data only when data stored in a register is initially changed.
  • the instruction generating module 130 may not generate a second instruction.
  • the processor 100 may process only the input first instruction.
  • the instruction selecting module 140 may sequentially select the generated second instruction and the input first instruction.
  • the generated second instruction may be a storing instruction for restoring data stored in a register in a temporary memory.
  • the first instruction may be an arithmetic and logical instruction such as the four fundamental arithmetic operations or comparison.
  • the instruction selecting module 140 may first select the second instruction and output the second instruction to the control module 150 so as to first process the second instruction, and then, may output the first instruction.
  • the instruction selecting module 140 may output the input first instruction to the control module 150 .
  • the control module 150 may process the second instruction and first instruction input from the instruction selecting module 140 .
  • the instruction selecting module 140 first outputs the second instruction, and thus the control module 150 may also first process the second instruction. That is, the processor 100 may first backup data registered in the register to the temporary memory. Then, the instruction selecting module 140 outputs the first instruction, and thus the control module 150 may also process the first instruction after the second instruction. That is, the processor 100 may backup data of a register and then process an arithmetic or logical instruction. Accordingly, the processor 100 may process an instruction of the ISR while backing up data required in the main service routine. In addition, the processor 100 does not collectively backup data of the register prior to execution of the ISR, and thus processing time of the ISR may be reduced.
  • the control module 150 may process only the input first instruction.
  • FIG. 2 is a diagram for explanation of a procedure for processing an ISR according to an exemplary embodiment of the present invention.
  • FIG. 2(A) illustrates a temporary memory and a register at a time point when an ISR is started.
  • the temporary memory may be a stack.
  • a plurality of registers may be present.
  • a processor may include several tens of registers or include several hundreds of registers.
  • the processor may include various numbers of registers according to uses, performances, sizes, or the like.
  • the register may store data that is stored during execution of the main service routine.
  • a 0 th register 10 may store r 0 data and a first register 11 may store r 1 data.
  • the stack may include a frame pointer fp.
  • the processor may determine an address of a stack for storing data by summing the fp and an offset of the register.
  • the processor may execute the ISR. During execution of the ISR, the processor may not store the data of the register in the stack. In addition, the processor may receive an instruction of the ISR.
  • FIG. 2(B) illustrates a procedure for processing an instruction of an ISR.
  • the processor may receive the instruction of the ISR.
  • the instruction of the ISR may be a sum instruction.
  • the processor may analyze an input instruction.
  • the sum instruction may be an instruction written in the 0 th register 10 by summing of data of the first register 11 and data of a second register (not shown).
  • the processor needs to use the 0 th register 10 , and thus r 0 data stored in the 0 th register 10 needs to be backed up.
  • the processor may generate an instruction for storing the data of the 0 th register 10 in the stack.
  • the processor may previously process the storing instruction compared with the sum instruction of the ISR.
  • the r 0 data of the 0 th register 10 may be stored in a designated region 21 of the stack.
  • the processor may process the sum instruction after backing up the r 0 data.
  • the processor may process the instruction of the ISR in the same way.
  • FIG. 2(C) illustrates a procedure for restoring data of the stack to the register.
  • the processor may re-process an instruction of a main service routine.
  • the processor may restore the data stored in the stack to the register prior to processing the instruction of the main service routine.
  • the restoring instruction restored to the register may be arbitrarily set. A designer may use an existing load instruction or may newly generate and set an instruction (e.g., ctx_load) to be restored to the register.
  • the processor may process the restoring instruction.
  • the processor may memorize an address of the stack to which data is backed up, and in response to the ISR being terminated, the processor may restore the data of the memorized address of the stack to an original register. According to an exemplary embodiment of the present invention, the processor may restore the r 0 data stored in the designated region 21 of the stack to the first register 11 . In response to the data backup to the stack being restored to the register, the processor may terminate the ISR and execute the ISR at a time point when the main service routine is stopped.
  • FIG. 3 is a diagram for velocity comparison between different processor cores for processing the same ISR.
  • FIG. 3 is a diagram for comparison of performance of various processors for processing an ISR related to a DTV service.
  • the number of ISRs related to the DTV service may be 36 .
  • the ARM7 processor may backup data stored in the register to the stack. It takes time of 367 cycles to backup data by the ARM7 processor. In addition, it takes time of 100 cycles to execute the ISR by the ARM7 processor. Lastly, it takes time of 268 cycles to terminate the ISR and to restore data to the register by the ARM7 processor. That is, the ARM7 processor requires time of 735 cycles in order to execute one ISR.
  • a cortex-M processor executes one ISR.
  • the cortex-M processor may also backup data stored in the register to the stack. It takes time of 96 cycles to backup data by the cortex-M processor. In addition, it takes time of 100 cycles to execute the ISR by the cortex-M processor. It takes time of 96 cycles to restore backed up data to the resister by the cortex-M processor. That is, time of 292 cycles is required to execute one ISR by the cortex-M processor.
  • the processor may no back up data stored in a register to a stack even if the processor receives an interrupt request. Accordingly, time to backup data by the processor is not required. Instead, the processor may backup data of the required register to the stack during execution of the ISR. Accordingly, it takes time of 112 cycles to execute the ISR by the processor. It takes time of 12 cycles to terminate the ISR and restore backed up data to the register by the processor. That is, time of 123 cycles is required to execute one ISR by the processor according to the present invention.
  • the number of ISRs related to a DTV service may be 36. Accordingly, it takes time of 735 cycles to execute one ISR by the ARM7 processor, and thus it takes time of 26460 cycles to execute all ISRs related to the DTV service. It takes time of 292 cycles to execute one ISR by the cortex-M processor, and thus it takes time of 10512 cycles to execute all ISRs related to the DTV service. It takes time of 124 cycles to execute one ISR by the processor according to the present invention, and thus it takes of 4464 cycles to execute all ISRs related to the DTV service. Accordingly, the processor according to the present invention may perform 5.9 times more rapid processing than the ARM7 processor and perform 2.4 times more rapid processing than the cortex-M processor.
  • FIG. 4 is a flowchart for explanation of a procedure for analyzing an instruction according to an exemplary embodiment of the present invention.
  • a processor may initialize a register flag (S 410 ).
  • the register flag may be a flag indicating whether data is stored during execution of an ISR. For example, the processor may initialize all values of the register flag to 0.
  • the register flag will be described below.
  • the processor may receive and analyze an instruction (S 420 ). As described above, an instruction fetch module of the processor may receive an instruction. In addition, an instruction detecting module of the processor may analyze an instruction.
  • the processor may detect a target register rt (S 430 ).
  • the detecting module of the processor may detect the target register rt.
  • the processor may analyze an input instruction. In addition, the processor may determine whether the register needs to be used. When the register needs to be used, the processor may detect a targeted register. The targeted register may be the target register.
  • the processor may check whether a flag value of the target register is 0 (S 440 ). As described above, the processor may back up only stored data to the stack during execution of a main service routine. In response to data of the target register being changed, the processor may set a flag value of the target register to 1. Accordingly, when the flag value of the target register is 0, this may indicate that data of the target register is not changed.
  • the processor may request generation of a storing instruction (S 450 ).
  • An instruction generating module of the processor may generate a storing (backup) instruction.
  • the processor may determine whether the ISR is terminated (S 470 ). When the ISR is not terminated, the processor may receive and analyze a subsequent instruction (S 420 ). In response to the ISR being terminated, the processor may terminate an instruction analyzing procedure.
  • the processor may set a value of a register flag of the target register to 1 (S 460 ). As described above, when use of the target register is predicated and a flag value of the target register is 0, the processor may backup data of the target register to the stack. In addition, the processor may set the flag value of the target register to 1. The processor may determine whether the ISR is terminated (S 470 ). When the ISR is terminated, the processor may terminate the instruction analyzing procedure.
  • the processor may determine a register with a register flag value set to 1 and restore data of the determined register.
  • FIG. 5 is a diagram for explanation of a method for displaying a register that backs up data according to an exemplary embodiment of the present invention.
  • FIG. 5(A) illustrates an initialized register flag.
  • a processor may include a register flag that displays a flag value for each register. In response to the ISR being started, the processor may initialize the register flag value to 0. According to an exemplary embodiment of the present invention, as described with reference to FIG. 4 , a flag 31 that is determined by analyzing an instruction may also be initialized and set to a value of 0.
  • FIG. 5(B) illustrates an example in which a flag value of a target register is set to 1.
  • the processor may determine a target register to be used by analyzing an instruction.
  • the processor may generate a storing (backup) instruction and set a value of the flag 31 of the target register to 1. Even if the value of the flag 31 of the target register is set to 1 and then a subsequent instruction re-accesses the target register, the processor may not store data of the target register to the stack. That is, the processor may change a value of a register flag and store data of the register in the stack only when data stored in the register is initially changed. In addition, when the value of the register flag is changed, the processor may determine that the data stored in the register is changed.
  • the processor may determine that data of a corresponding register is not changed. That is, when the data stored in the register is not changed or is not initially changed, the processor may not generate a backup instruction.
  • the processor may determine whether the register flag is changed and restore only data corresponding to the register, a value of the register flag of which is changed, to the register from the stack.
  • processors according to various exemplary embodiments of the present invention have been described.
  • a control method of a processor will be described below.
  • FIG. 6 is a flowchart of a control method of a processor according to an exemplary embodiment of the present invention.
  • the processor may receive a first instruction of an ISR without backup of data stored in a register (S 610 ). As described above, the processor may not backup data of the register during execution of the ISR. Accordingly, the processor may rapidly process the ISR.
  • the processor may analyze the input first instruction to determine whether the data stored in the register needs to be changed (S 620 ).
  • the processor may include a register flag.
  • the processor may initialize a value of the register flag. For example, the processor may set the value of the register flag to 0.
  • the processor may change a value of the register flag. For example, the processor may set the value of the register to 1 during backup of the data of the register.
  • the processor may determine that the data stored in the register is changed. Accordingly, when the value of the register flag to be used to process the input instruction is 1, the processor may not back up the data of the register.
  • the processor may not generate the second instruction.
  • the processor may generate the second instruction stored in a temporary memory (S 630 ).
  • the second instruction may be an instruction stored in the temporary memory.
  • the temporary memory may be a stack.
  • the processor may sequentially select the generated second instruction and first instruction (S 640 ). In addition, the processor may perform the second instruction and the first instruction (S 650 ). When backup of data is required, the processor may first process the second instruction for backing up data. Then, the processor may process the first instruction of the ISR. That is, the processor may store data in the temporary memory and then perform the first instruction.
  • the processor may restore data stored in the temporary memory to the register.
  • the processor may include a plurality of registers.
  • the processor may restore only data corresponding to a register, a value of register flag of which is changed, among a plurality of registers from the temporary memory.
  • control methods of a processor may be embodied and provided in the form of a program.
  • a non-transitory computer readable medium having restored thereon a program for performing receiving a first instruction of an ISR without backup of data stored in a register in response to processing of the ISR being requested, analyzing the received first instruction to determine whether the data stored in the register needs to be changed, generating a second instruction for storing data in a temporary memory when the stored data is initially changed, sequentially selecting the generated second instruction and first instruction, and performing the second instruction and the first instruction.
  • the non-transitory computer readable medium is a medium which does not store data temporarily such as a register, cash, and memory but stores data semi-permanently and is readable by devices. More specifically, the aforementioned applications or programs may be stored in the non-transitory computer readable media such as compact disks (CDs), digital video disks (DVDs), hard disks, Blu-ray disks, universal serial buses (USBs), memory cards, and read-only memory (ROM).
  • CDs compact disks
  • DVDs digital video disks
  • hard disks hard disks
  • Blu-ray disks Blu-ray disks
  • USBs universal serial buses
  • memory cards and read-only memory (ROM).

Landscapes

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

Abstract

A processor and a control method thereof are processed. The processor includes an instruction fetch module configured to receive a first instruction of an interrupt service routine without backup of data stored in a register in response to processing of the interrupt service routine being requested, a detecting module configured to analyze the received first instruction to determine whether the data stored in the register needs to be changed, an instruction generating module configured to generate a second instruction for storing data in a temporary memory when the stored data is initially changed, an instruction selecting module configured to sequentially select the generated second instruction and first instruction; and a control module configured to perform the second instruction and the first instruction.

Description

    CROSS-REFERENCE TO RELATED APPLICATIONS
  • This application claims priority from Korean Patent Application No. 10-2015-0172093, filed on Dec. 4, 2015, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein by reference in its entirety.
  • BACKGROUND OF THE INVENTION
  • Field of the Invention
  • Apparatuses and methods consistent with the present invention relate to a processor and a control method thereof, and more particularly, to a processor and a control method thereof, for processing an interrupt service.
  • Description of the Related Art
  • An electronic apparatus executes an application program to perform a specific function. The application program is a service routine containing consecutive instructions, and a processor of an electronic apparatus processes consecutive instructions. The processor sequentially processes consecutive instructions. However, the application program may include an interrupt service routine as necessary. The interrupt service routine may be executed according to generation of an event that is set during processing of a main service routine. When interrupt occurs, the processor stops processing of the main service routine and processes the interrupt service routine. The processor needs to use a register in the processor in order to process the interrupt service routine. However, the processor may now know a register to be used at a time point when the interrupt service routine is started. Accordingly, the processor stores data stored in all registers in a memory and then processes the interrupt service routine. In addition, when the interrupt service routine is terminated, the processor restores data stored in the memory back to all registers. Accordingly, a long period of time is taken to process the interrupt service routine.
  • SUMMARY OF THE INVENTION
  • Exemplary embodiments of the present invention overcome the above disadvantages and other disadvantages not described above. Also, the present invention is not required to overcome the disadvantages described above, and an exemplary embodiment of the present invention may not overcome any of the problems described above.
  • The present invention provides a processor and control method for reducing processing time of an interrupt service routine.
  • According to an aspect of the present invention, a processor includes an instruction fetch module configured to receive a first instruction of an interrupt service routine without backup of data stored in a register in response to processing of the interrupt service routine being requested, a detecting module configured to analyze the received first instruction to determine whether the data stored in the register needs to be changed, an instruction generating module configured to generate a second instruction for storing data in a temporary memory when the stored data is initially changed, an instruction selecting module configured to sequentially select the generated second instruction and first instruction, and a control module configured to perform the second instruction and the first instruction.
  • The control module may store the data in the temporary memory and then performs the first instruction.
  • The control module may restore the data stored in the temporary memory to the register in response to the interrupt service routine being terminated.
  • The detecting module may change a value of a register flag when the value of the register flag is initialized and the stored data is initially changed in response to processing of the interrupt service routine containing the register flag being requested.
  • The detecting module may determine that the stored data is changed when the value of the register flag is changed.
  • A plurality of registers may be present.
  • The control module may restore only data corresponding to a register, a value of a register flag of which is changed, among the plurality of registers from the temporary memory.
  • The instruction generating module may not generate the second instruction when the data stored in the register is not changed or is not initially changed.
  • According to another aspect of the present invention, a controlling method of a processor includes receiving a first instruction of an interrupt service routine without backup of data stored in a register in response to processing of the interrupt service routine being requested, analyzing the received first instruction to determine whether the data stored in the register needs to be changed, generating a second instruction for storing data in a temporary memory when the stored data is initially changed, sequentially selecting the generated second instruction and first instruction, and performing the second instruction and the first instruction.
  • The performing may include storing the data in the temporary memory and then performing the first instruction.
  • The method may further include restoring the data stored in the temporary memory to the register in response to the interrupt service routine being terminated.
  • The determining may include changing a value of a register flag when the value of the register flag is initialized and the stored data is initially changed in response to processing of the interrupt service routine containing the register flag being requested.
  • The determining may include determining that the stored data is changed when the value of the register flag is changed.
  • A plurality of registers may be present, and the restoring may include restoring the control module restores only data corresponding to a register, a value of a register flag of which is changed, among the plurality of registers from the temporary memory.
  • The generating may include not generating the second instruction when the data stored in the register is not changed or is not initially changed.
  • According to the diverse exemplary embodiments of the present invention, a processor and a control method thereof may reduce processing time of an interrupt service routine so as to enhance performance of the processor.
  • Additional and/or other aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
  • BRIEF DESCRIPTION OF THE DRAWING FIGURES
  • The above and/or other aspects of the present invention will be more apparent by describing certain exemplary embodiments of the present invention with reference to the accompanying drawings, in which:
  • FIG. 1 is a block diagram of a processor according to an exemplary embodiment of the present invention;
  • FIG. 2 is a diagram for explanation of a procedure for processing an interrupt service routine (ISR) according to an exemplary embodiment of the present invention;
  • FIG. 3 is a diagram for velocity comparison between different processor cores for processing the same ISR;
  • FIG. 4 is a flowchart for explanation of a procedure for analyzing an instruction according to an exemplary embodiment of the present invention;
  • FIG. 5 is a diagram for explanation of a method for displaying a register that backs up data according to an exemplary embodiment of the present invention; and
  • FIG. 6 is a flowchart of a control method of a processor according to an exemplary embodiment of the present invention.
  • DETAILED DESCRIPTION OF THE EXEMPLARY EMBODIMENTS
  • Certain exemplary embodiments of the present invention will now be described in greater detail with reference to the accompanying drawings. Embodiments stated in the disclosure may be changed in various ways. A specific embodiment may be shown in the drawings and described in detail in the detailed description. However, the accompanying drawings have been made only for a better understanding of various embodiments disclosed herein and are not intended to limit technical ideas disclosed herein, and it should be understood that the accompanying drawings are intended to encompass all modifications, equivalents and substitutions included in the spirit and scope of the present invention. In the following description of the present invention, a detailed description of known functions and configurations incorporated herein will be omitted or simplified when it may make the subject matter of the present invention unclear.
  • The terms including “first”, “second”, etc. may be used to describe various elements, but the elements are not limited by the terms. The terms, if any, are used for distinguishing between one element and other elements.
  • In this disclosure, it will be further understood that the terms “comprises” or “comprising” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or groups thereof. It will be understood that when an element is referred to as being “connected to” or “coupled to” another element, it may be directly on, connected or coupled to the other element or intervening elements may be present. In contrast, when an element is referred to as being “directly on,” “directly connected to” or “directly coupled to” another element or layer, there are no intervening elements or layers present.
  • The term “module” or “unit” of a component used in the disclosure performs at least one function or operation. In addition, the “module” or the “unit” should be understood as performing a function or an operation in a hardware manner, a software manner, or a combination of the hardware manner and the software manner. Moreover, a plurality of “modules” or a plurality of “units” except for a “module” or “unit” that is embodied in specific hardware or embodied in at least one processor may be integrated into at least one module.
  • The singular forms are intended to include the plural forms as well, unless the context clearly indicates otherwise.
  • FIG. 1 is a block diagram of a processor 100 according to an exemplary embodiment of the present invention.
  • Referring to FIG. 1, the processor 100 may include an instruction fetch module 110, a detecting module 120, an instruction generating module 130, an instruction selecting module 140, and a control module 150. In response to an interrupt service routine (ISR) being requested to be processed, the instruction fetch module 110 may receive a first instruction of the ISR without backup of data stored in a register. The ISR may be executed when an interrupt event occurs. In general, the processor 100 executes an application program. The application program may include a main service routine. The processor 100 may sequentially process the instruction included in the main service routine. While the processor 100 executes the main service routine, an interrupt event may occur in an external apparatus (not shown). For example, the external apparatus may include a disk, a keyboard, a printer, a display apparatus, and so on. When the interrupt event occurs, the processor 100 may temporally stop the main service routine that is being processed and may execute an ISR corresponding to the generated interrupt.
  • In the case of a prior art, prior to execution of an ISR, a processor backs up data of a register in a temporary memory. For example, the temporary memory may be a stack. During execution of the ISR, the processor needs to write data in a register while processing an instruction included in the ISR. Accordingly, in order to retain data written in a register while executing a main service routine, the processor backs up the data of the register to the temporary memory prior to execution of the ISR. The processor does not know a register to be used during execution of the ISR, and thus backs up data stored in all registers to the temporary memory. Accordingly, in the case of the prior art, a long period of time is taken before the processor processes the ISR.
  • However, the processor 100 according to embodiments of the present invention may not back up data stored in a register to a temporary memory prior to execution of an ISR. Accordingly, the processor 100 according to the embodiments of the present invention may save time to back up data of the register. When the ISR is executed, the processor 100 may receive an instruction of the ISR. That is, in response to a request to process the ISR, the instruction fetch module 110 inside the processor 100 may receive an instruction of the ISR without back up of the data registered in the register.
  • The detecting module 120 may analyze an input first instruction to determine whether data stored in a register needs to be changed. As described above, the processor 100 according to the embodiments of the present invention may not back up the data stored in the register prior to execution of the ISR. However, the processor 100 needs to write data in the register while processing the ISR. Accordingly, the detecting module 120 may determine whether a register needs to be used to process a first instruction input to the instruction fetch module 110. When the register needs to be used, the processor 100 may back up the data stored in the register to be used to the temporary memory and process the input first instruction. In addition, when the register is not necessarily use the register, the processor 100 may process the input first instruction without back up of data. A detailed process of analyzing an instruction input to the detecting module 120 will be described in detail.
  • When the stored data is initially changed, the instruction generating module 130 may generate a second instruction for storing data stored in the register, in the temporary memory. The second instruction may be a storing instruction. When the processor 100 needs to use a register in order to process an instruction, the processor 100 needs to back up the data stored in the register. The processor 100 may perform a function of processing an input instruction. The processor 100 may perform a data backup function only in response to a data backup instruction being received. However, the data backup instruction is not included in the ISR, and thus the instruction generating module 130 may generate the data backup instruction. That is, the data backup instruction may be a storing instruction for storing data in the temporary memory. The processor 100 may first execute the storing instruction generated by the instruction generating module 130 in the processor 100 so as to store the data of the resister in the temporary memory. In addition, the processor 100 may process the first instruction input to the instruction fetch module 110.
  • The data of the register, which needs to be backed up before the processor 100 processes the first instruction of the ISR, may be data that is stored in the register during execution of the main service routine. Accordingly, it is sufficient that the processor 100 backs up the data stored in the register while executing the main service routine. Instructions included in the ISR may be formed so as to execute the ISR. For example, when first data that is stored in a register during processing of a first instruction of the ISR needs to be used in a subsequently processed instruction, the ISR may be formed so as to store second data that is stored in a register during processing of a second instruction in another register. This means that, when the ISR is formed to overwrite the first data with the second data (that is, when the second data is stored in the same register as that of the first data), the first data is not required any longer. Accordingly, the instruction generating module 130 may backs up data only when data stored in a register is initially changed.
  • When the register is not necessarily used, the instruction generating module 130 may not generate a second instruction. In addition, the processor 100 may process only the input first instruction.
  • The instruction selecting module 140 may sequentially select the generated second instruction and the input first instruction. For example, the generated second instruction may be a storing instruction for restoring data stored in a register in a temporary memory. In addition, the first instruction may be an arithmetic and logical instruction such as the four fundamental arithmetic operations or comparison. When a register is used, the processor 100 needs to first backup data stored in the register in the temporary memory. Accordingly, the instruction selecting module 140 may first select the second instruction and output the second instruction to the control module 150 so as to first process the second instruction, and then, may output the first instruction.
  • When a register is not necessarily used, the instruction selecting module 140 may output the input first instruction to the control module 150.
  • The control module 150 may process the second instruction and first instruction input from the instruction selecting module 140. The instruction selecting module 140 first outputs the second instruction, and thus the control module 150 may also first process the second instruction. That is, the processor 100 may first backup data registered in the register to the temporary memory. Then, the instruction selecting module 140 outputs the first instruction, and thus the control module 150 may also process the first instruction after the second instruction. That is, the processor 100 may backup data of a register and then process an arithmetic or logical instruction. Accordingly, the processor 100 may process an instruction of the ISR while backing up data required in the main service routine. In addition, the processor 100 does not collectively backup data of the register prior to execution of the ISR, and thus processing time of the ISR may be reduced.
  • When a register is not necessarily used, the second instruction is not generated, and thus the control module 150 may process only the input first instruction.
  • FIG. 2 is a diagram for explanation of a procedure for processing an ISR according to an exemplary embodiment of the present invention.
  • FIG. 2(A) illustrates a temporary memory and a register at a time point when an ISR is started. As described above, the temporary memory may be a stack. In addition, a plurality of registers may be present. According to an exemplary embodiment of the present invention, a processor may include several tens of registers or include several hundreds of registers. The processor may include various numbers of registers according to uses, performances, sizes, or the like. Referring to FIG. 2(A), the register may store data that is stored during execution of the main service routine. For example, a 0th register 10 may store r0 data and a first register 11 may store r1 data. The stack may include a frame pointer fp. During storing of data of a register in the stack, the processor may determine an address of a stack for storing data by summing the fp and an offset of the register.
  • When an interrupt event occurs, in response to interrupt service execution being requested, the processor may execute the ISR. During execution of the ISR, the processor may not store the data of the register in the stack. In addition, the processor may receive an instruction of the ISR.
  • FIG. 2(B) illustrates a procedure for processing an instruction of an ISR. The processor may receive the instruction of the ISR. For example, the instruction of the ISR may be a sum instruction. The processor may analyze an input instruction. According to an exemplary embodiment of the present invention, the sum instruction may be an instruction written in the 0th register 10 by summing of data of the first register 11 and data of a second register (not shown). The processor needs to use the 0th register 10, and thus r0 data stored in the 0th register 10 needs to be backed up. The processor may generate an instruction for storing the data of the 0th register 10 in the stack. The processor may previously process the storing instruction compared with the sum instruction of the ISR. When the storing instruction is processed, the r0 data of the 0th register 10 may be stored in a designated region 21 of the stack. The processor may process the sum instruction after backing up the r0 data. The processor may process the instruction of the ISR in the same way.
  • FIG. 2(C) illustrates a procedure for restoring data of the stack to the register. In response to all instructions of ISRs being processed, the processor may re-process an instruction of a main service routine. The processor may restore the data stored in the stack to the register prior to processing the instruction of the main service routine. According to an exemplary embodiment of the present invention, the restoring instruction restored to the register may be arbitrarily set. A designer may use an existing load instruction or may newly generate and set an instruction (e.g., ctx_load) to be restored to the register. In response to the ISR being terminated, the processor may process the restoring instruction. The processor may memorize an address of the stack to which data is backed up, and in response to the ISR being terminated, the processor may restore the data of the memorized address of the stack to an original register. According to an exemplary embodiment of the present invention, the processor may restore the r0 data stored in the designated region 21 of the stack to the first register 11. In response to the data backup to the stack being restored to the register, the processor may terminate the ISR and execute the ISR at a time point when the main service routine is stopped.
  • FIG. 3 is a diagram for velocity comparison between different processor cores for processing the same ISR.
  • FIG. 3 is a diagram for comparison of performance of various processors for processing an ISR related to a DTV service. According to an exemplary embodiment of the present invention, the number of ISRs related to the DTV service may be 36.
  • First, an example in which an ARM7 processor executes one ISR will be described. In response to an interrupt request being received, the ARM7 processor may backup data stored in the register to the stack. It takes time of 367 cycles to backup data by the ARM7 processor. In addition, it takes time of 100 cycles to execute the ISR by the ARM7 processor. Lastly, it takes time of 268 cycles to terminate the ISR and to restore data to the register by the ARM7 processor. That is, the ARM7 processor requires time of 735 cycles in order to execute one ISR.
  • Next, an example in which a cortex-M processor executes one ISR. In response to an interrupt request being received, the cortex-M processor may also backup data stored in the register to the stack. It takes time of 96 cycles to backup data by the cortex-M processor. In addition, it takes time of 100 cycles to execute the ISR by the cortex-M processor. It takes time of 96 cycles to restore backed up data to the resister by the cortex-M processor. That is, time of 292 cycles is required to execute one ISR by the cortex-M processor.
  • Lastly, an example in which a processor according to the present invention executes one ISR will be described. The processor may no back up data stored in a register to a stack even if the processor receives an interrupt request. Accordingly, time to backup data by the processor is not required. Instead, the processor may backup data of the required register to the stack during execution of the ISR. Accordingly, it takes time of 112 cycles to execute the ISR by the processor. It takes time of 12 cycles to terminate the ISR and restore backed up data to the register by the processor. That is, time of 123 cycles is required to execute one ISR by the processor according to the present invention.
  • As described above, the number of ISRs related to a DTV service may be 36. Accordingly, it takes time of 735 cycles to execute one ISR by the ARM7 processor, and thus it takes time of 26460 cycles to execute all ISRs related to the DTV service. It takes time of 292 cycles to execute one ISR by the cortex-M processor, and thus it takes time of 10512 cycles to execute all ISRs related to the DTV service. It takes time of 124 cycles to execute one ISR by the processor according to the present invention, and thus it takes of 4464 cycles to execute all ISRs related to the DTV service. Accordingly, the processor according to the present invention may perform 5.9 times more rapid processing than the ARM7 processor and perform 2.4 times more rapid processing than the cortex-M processor.
  • FIG. 4 is a flowchart for explanation of a procedure for analyzing an instruction according to an exemplary embodiment of the present invention.
  • Referring to FIG. 4, in response to an interrupt request being received, a processor may initialize a register flag (S410). The register flag may be a flag indicating whether data is stored during execution of an ISR. For example, the processor may initialize all values of the register flag to 0. The register flag will be described below. The processor may receive and analyze an instruction (S420). As described above, an instruction fetch module of the processor may receive an instruction. In addition, an instruction detecting module of the processor may analyze an instruction.
  • The processor may detect a target register rt (S430). The detecting module of the processor may detect the target register rt. The processor may analyze an input instruction. In addition, the processor may determine whether the register needs to be used. When the register needs to be used, the processor may detect a targeted register. The targeted register may be the target register. The processor may check whether a flag value of the target register is 0 (S440). As described above, the processor may back up only stored data to the stack during execution of a main service routine. In response to data of the target register being changed, the processor may set a flag value of the target register to 1. Accordingly, when the flag value of the target register is 0, this may indicate that data of the target register is not changed. When a value of the target register is 0, the processor may request generation of a storing instruction (S450). An instruction generating module of the processor may generate a storing (backup) instruction.
  • When a value of the target register is not 0, the processor may determine whether the ISR is terminated (S470). When the ISR is not terminated, the processor may receive and analyze a subsequent instruction (S420). In response to the ISR being terminated, the processor may terminate an instruction analyzing procedure.
  • The processor may set a value of a register flag of the target register to 1 (S460). As described above, when use of the target register is predicated and a flag value of the target register is 0, the processor may backup data of the target register to the stack. In addition, the processor may set the flag value of the target register to 1. The processor may determine whether the ISR is terminated (S470). When the ISR is terminated, the processor may terminate the instruction analyzing procedure.
  • In response to instruction processing of the ISR being completed, the processor may determine a register with a register flag value set to 1 and restore data of the determined register.
  • FIG. 5 is a diagram for explanation of a method for displaying a register that backs up data according to an exemplary embodiment of the present invention.
  • FIG. 5(A) illustrates an initialized register flag. A processor may include a register flag that displays a flag value for each register. In response to the ISR being started, the processor may initialize the register flag value to 0. According to an exemplary embodiment of the present invention, as described with reference to FIG. 4, a flag 31 that is determined by analyzing an instruction may also be initialized and set to a value of 0.
  • FIG. 5(B) illustrates an example in which a flag value of a target register is set to 1. The processor may determine a target register to be used by analyzing an instruction. The processor may generate a storing (backup) instruction and set a value of the flag 31 of the target register to 1. Even if the value of the flag 31 of the target register is set to 1 and then a subsequent instruction re-accesses the target register, the processor may not store data of the target register to the stack. That is, the processor may change a value of a register flag and store data of the register in the stack only when data stored in the register is initially changed. In addition, when the value of the register flag is changed, the processor may determine that the data stored in the register is changed. Accordingly, when the value of the register flag is not changed, the processor may determine that data of a corresponding register is not changed. That is, when the data stored in the register is not changed or is not initially changed, the processor may not generate a backup instruction. When the ISR is terminated, the processor may determine whether the register flag is changed and restore only data corresponding to the register, a value of the register flag of which is changed, to the register from the stack.
  • Thus far, the processors according to various exemplary embodiments of the present invention have been described. A control method of a processor will be described below.
  • FIG. 6 is a flowchart of a control method of a processor according to an exemplary embodiment of the present invention.
  • Referring to FIG. 6, in response to processing of an interrupt routine being received, the processor may receive a first instruction of an ISR without backup of data stored in a register (S610). As described above, the processor may not backup data of the register during execution of the ISR. Accordingly, the processor may rapidly process the ISR.
  • The processor may analyze the input first instruction to determine whether the data stored in the register needs to be changed (S620). The processor may include a register flag. In response to ISR processing being requested, the processor may initialize a value of the register flag. For example, the processor may set the value of the register flag to 0. In addition, when the stored data is initially changed, the processor may change a value of the register flag. For example, the processor may set the value of the register to 1 during backup of the data of the register. In response to the value of the register flag being changed, the processor may determine that the data stored in the register is changed. Accordingly, when the value of the register flag to be used to process the input instruction is 1, the processor may not back up the data of the register. That is, when the data stored in the register is not changed or is not initially changed, the processor may not generate the second instruction. When the stored data is initially changed, the processor may generate the second instruction stored in a temporary memory (S630). The second instruction may be an instruction stored in the temporary memory. For example, the temporary memory may be a stack.
  • The processor may sequentially select the generated second instruction and first instruction (S640). In addition, the processor may perform the second instruction and the first instruction (S650). When backup of data is required, the processor may first process the second instruction for backing up data. Then, the processor may process the first instruction of the ISR. That is, the processor may store data in the temporary memory and then perform the first instruction.
  • When the ISR is terminated, the processor may restore data stored in the temporary memory to the register. The processor may include a plurality of registers. The processor may restore only data corresponding to a register, a value of register flag of which is changed, among a plurality of registers from the temporary memory.
  • The control methods of a processor according to the aforementioned various embodiments of the present invention may be embodied and provided in the form of a program.
  • For example, provided may be a non-transitory computer readable medium having restored thereon a program for performing receiving a first instruction of an ISR without backup of data stored in a register in response to processing of the ISR being requested, analyzing the received first instruction to determine whether the data stored in the register needs to be changed, generating a second instruction for storing data in a temporary memory when the stored data is initially changed, sequentially selecting the generated second instruction and first instruction, and performing the second instruction and the first instruction.
  • The non-transitory computer readable medium is a medium which does not store data temporarily such as a register, cash, and memory but stores data semi-permanently and is readable by devices. More specifically, the aforementioned applications or programs may be stored in the non-transitory computer readable media such as compact disks (CDs), digital video disks (DVDs), hard disks, Blu-ray disks, universal serial buses (USBs), memory cards, and read-only memory (ROM).
  • The foregoing exemplary embodiments and advantages are merely exemplary and are not to be construed as limiting the present invention. The present teaching can be readily applied to other types of apparatuses. Also, the description of the exemplary embodiments of the present invention is intended to be illustrative, and not to limit the scope of the claims, and many alternatives, modifications, and variations will be apparent to those skilled in the art.

Claims (15)

What is claimed is:
1. A processor comprising:
an instruction fetch module configured to receive a first instruction of an interrupt service routine (ISR) without backup of data stored in a register in response to processing of the ISR being requested;
a detecting module configured to analyze the received first instruction of the ISR to perform a determination of whether the data stored in the register needs to be changed initially;
an instruction generating module configured to generate a second instruction for storing the data of the register in a temporary memory, in response to the determination that the data stored in the register is to be changed initially;
an instruction selecting module configured to sequentially select the generated second instruction and the first instruction of the ISR; and
a control module configured to perform the generated second instruction and the first instruction of the ISR.
2. The processor as claimed in claim 1, wherein the control module stores the data stored in the register in the temporary memory and then performs the first instruction of the ISR.
3. The processor as claimed in claim 1, wherein the control module restores the data of the register stored in the temporary memory to the register in response to the ISR being terminated.
4. The processor as claimed in claim 3, wherein the detecting module is further configured to initialize a value of a register flag in response to processing of the ISR being requested, and changes the value of the register flag, in response to the determination that the data stored in the register is changed initially.
5. The processor as claimed in claim 4, wherein the detecting module detects that the data stored in the register is changed, in response to the change of the value of the register flag.
6. The processor as claimed in claim 5, wherein a plurality of registers are present.
7. The processor as claimed in claim 6, wherein the control module restores only the data of a register, from the temporary memory, to a register from among the registers corresponding to a register flag, in response to a change of a value of the corresponding register flag.
8. The processor as claimed in claim 1, wherein the instruction generating module does not generate the second instruction, in response to the determination that the data stored in the register is not changed initially or is not changed.
9. A controlling method of a processor, the method comprising:
by the processor:
receiving a first instruction of an interrupt service routine (ISR) without backup of data stored in a register in response to processing of the ISR being requested;
analyzing the received first instruction of the ISR to perform a determination of whether the data stored in the register needs to be changed initially;
generating a second instruction for storing the data of the register in a temporary memory, in response to the determination the data stored in the register is to be changed initially;
sequentially selecting the generated second instruction and the first instruction of the ISR; and
performing the generated second instruction and the first instruction of the ISR.
10. The method as claimed in claim 9, wherein the performing comprises storing the data stored in the register in the temporary memory and then performing the first instruction of the ISR.
11. The method as claimed in claim 9, further comprising restoring the data of the register stored in the temporary memory to the register in response to the ISR being terminated.
12. The method as claimed in claim 11, wherein the determining comprises initializing a value of a register flag in response to processing of the ISR being requested, and changing the value of the register flag, in response to the determination that the data stored in the register is changed initially.
13. The method as claimed in claim 12, wherein the determining comprises detecting that the data stored in the register is changed, in response to the change of the value of the register flag.
14. The method as claimed in claim 13, wherein:
a plurality of registers are present; and
the restoring comprises restoring only data of a register, from the temporary memory, to a register from among the registers corresponding to a register flag, in response to a change of a value of the corresponding register flag.
15. The method as claimed in claim 9, wherein the generating comprises not generating the second instruction, in response to the determination that the data stored in the register is not changed initially or is not changed.
US15/136,183 2015-12-04 2016-04-22 Processor and controlling method thereof to process an interrupt Expired - Fee Related US10318452B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020150172093A KR20170065845A (en) 2015-12-04 2015-12-04 Processor and controlling method thereof
KR10-2015-0172093 2015-12-04

Publications (2)

Publication Number Publication Date
US20170161217A1 true US20170161217A1 (en) 2017-06-08
US10318452B2 US10318452B2 (en) 2019-06-11

Family

ID=58799074

Family Applications (1)

Application Number Title Priority Date Filing Date
US15/136,183 Expired - Fee Related US10318452B2 (en) 2015-12-04 2016-04-22 Processor and controlling method thereof to process an interrupt

Country Status (2)

Country Link
US (1) US10318452B2 (en)
KR (1) KR20170065845A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857029A (en) * 2019-02-20 2019-06-07 珠海格力电器股份有限公司 Dual processor controlling system working method, magnetic suspension bearing monitoring system and its working method, compressor and air-conditioning

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5642516A (en) * 1994-10-14 1997-06-24 Cirrus Logic, Inc. Selective shadowing of registers for interrupt processing
US6205467B1 (en) * 1995-11-14 2001-03-20 Advanced Micro Devices, Inc. Microprocessor having a context save unit for saving context independent from interrupt requests
US5727227A (en) * 1995-11-20 1998-03-10 Advanced Micro Devices Interrupt coprocessor configured to process interrupts in a computer system
US5640570A (en) * 1996-01-26 1997-06-17 International Business Machines Corporation Information handling system for transmitting contents of line register from asynchronous controller to shadow register in another asynchronous controller determined by shadow register address buffer
US5687381A (en) * 1996-02-09 1997-11-11 Advanced Micro Devices, Inc. Microprocessor including an interrupt polling unit configured to poll external devices for interrupts using interrupt acknowledge bus transactions
US5948093A (en) * 1996-02-09 1999-09-07 Advanced Micro Devices, Inc. Microprocessor including an interrupt polling unit configured to poll external devices for interrupts when said microprocessor is in a task switch state
US6378023B1 (en) * 1996-02-14 2002-04-23 Advanced Micro Devices, Inc. Interrupt descriptor cache for a microprocessor
US5944816A (en) * 1996-05-17 1999-08-31 Advanced Micro Devices, Inc. Microprocessor configured to execute multiple threads including interrupt service routines
US5987601A (en) 1997-02-14 1999-11-16 Xyron Corporation Zero overhead computer interrupts with task switching
US5987258A (en) 1997-06-27 1999-11-16 Lsi Logic Corporation Register reservation method for fast context switching in microprocessors
US6128728A (en) * 1997-08-01 2000-10-03 Micron Technology, Inc. Virtual shadow registers and virtual register windows
US6044430A (en) * 1997-12-17 2000-03-28 Advanced Micro Devices Inc. Real time interrupt handling for superscalar processors
US6205543B1 (en) * 1998-12-03 2001-03-20 Sun Microsystems, Inc. Efficient handling of a large register file for context switching
JP2002055830A (en) * 2000-05-29 2002-02-20 Seiko Epson Corp Interruption signal generation device and its method
JP3813930B2 (en) * 2002-01-09 2006-08-23 松下電器産業株式会社 Processor and program execution method
KR100498469B1 (en) 2002-12-23 2005-07-01 삼성전자주식회사 Interrupt control system providing for the least delay and method thereof
KR100528476B1 (en) 2003-07-22 2005-11-15 삼성전자주식회사 Interupt processing circuit of computer system
GB2409543B (en) * 2003-12-23 2006-11-01 Advanced Risc Mach Ltd Interrupt masking control
KR100679050B1 (en) * 2005-12-12 2007-02-06 삼성전자주식회사 Method and apparatus for storing and restoring register context for fast context switching between tasks
JP2007304926A (en) * 2006-05-12 2007-11-22 Matsushita Electric Ind Co Ltd Information processing method and instruction generation method
US7681022B2 (en) 2006-07-25 2010-03-16 Qualcomm Incorporated Efficient interrupt return address save mechanism
JP6081300B2 (en) * 2013-06-18 2017-02-15 株式会社東芝 Information processing apparatus and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857029A (en) * 2019-02-20 2019-06-07 珠海格力电器股份有限公司 Dual processor controlling system working method, magnetic suspension bearing monitoring system and its working method, compressor and air-conditioning

Also Published As

Publication number Publication date
KR20170065845A (en) 2017-06-14
US10318452B2 (en) 2019-06-11

Similar Documents

Publication Publication Date Title
KR102025556B1 (en) Processing apparatus, trace unit and diagnostic apparatus
US9256428B2 (en) Load latency speculation in an out-of-order computer processor
US7669038B2 (en) Method and apparatus for back to back issue of dependent instructions in an out of order issue queue
US20140317628A1 (en) Memory apparatus for processing support of long routing in processor, and scheduling apparatus and method using the memory apparatus
CN111936972B (en) Data processing apparatus and method of operating the same
CN107918555B (en) Method and apparatus for processing data based on physical host
JP2019502201A (en) Software-defined FIFO buffer for multithreaded access
CA2811617C (en) Commit sensitive tests
CN108369519B (en) Replaying partially executed instruction blocks in a processor-based system using a block-atomic execution model
CN113342671B (en) Method, device, electronic equipment and medium for verifying operation module
US10318452B2 (en) Processor and controlling method thereof to process an interrupt
WO2023093260A1 (en) Instruction processing apparatus and method, and computer device and storage medium
US11106478B2 (en) Simulation device, simulation method, and computer readable medium
CN114902336B (en) Content addressable memory with sub-field minimum and maximum clamping
US20110066880A1 (en) Apparatus and method for compensating for system memory error
US20200004546A1 (en) Shared compare lanes for dependency wake up in a pair-based issue queue
US20210034362A1 (en) Data processing
US20100299682A1 (en) Method and apparatus for executing java application
US11080122B2 (en) Software-invisible interrupt for a microprocessor
JP5921306B2 (en) Information processing apparatus, information processing method, and program
US9740660B2 (en) CPU control method, electronic system control method and electronic system for improved CPU utilization in executing functions
JP2018067057A (en) Verification device and program for control program
CN117555555A (en) Exception processing method, device, electronic equipment and storage medium
CN113312167A (en) Service control method and device, electronic equipment and computer readable medium
US20170153957A1 (en) Method for testing a computer system with a basic input/output system interface program

Legal Events

Date Code Title Description
AS Assignment

Owner name: SAMSUNG ELECTRONICS CO., LTD., KOREA, REPUBLIC OF

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:IM, CHAE-SEOK;SUH, DONG-KWAN;KIM, SUK-JIN;AND OTHERS;REEL/FRAME:038356/0836

Effective date: 20160412

STPP Information on status: patent application and granting procedure in general

Free format text: NOTICE OF ALLOWANCE MAILED -- APPLICATION RECEIVED IN OFFICE OF PUBLICATIONS

STCF Information on status: patent grant

Free format text: PATENTED CASE

FEPP Fee payment procedure

Free format text: MAINTENANCE FEE REMINDER MAILED (ORIGINAL EVENT CODE: REM.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

LAPS Lapse for failure to pay maintenance fees

Free format text: PATENT EXPIRED FOR FAILURE TO PAY MAINTENANCE FEES (ORIGINAL EVENT CODE: EXP.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

STCH Information on status: patent discontinuation

Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362

FP Lapsed due to failure to pay maintenance fee

Effective date: 20230611