Information processing apparatus and operation control method of information processing apparatus
By using the instruction set and interrupt control unit with a bit field structure in the information processing device, precise control of the interrupt signal is achieved, and the problems of complexity and cost of interrupt control in the prior art are solved, and the inseparability of the processing is improved. Programming ease.
Patent Information
- Application Number
- CN202380029312.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-31
- Filing Date
- 2023-02-14
- Publication Date
- 2024-11-08
Smart Images

Figure CN118922816A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to an information processing device and an operation control method of the information processing device. Background Art
[0002] In programming processing using a microprocessor, it is sometimes desirable to continuously execute a process consisting of two or more instructions, such as read / write, without interruption. Such a process that cannot be interrupted by another is called an atomic process.
[0003] In a microprocessor that supports interrupts, the microprocessor is usually provided with "disable interrupts", "enable interrupts" states, and "disable interrupt instructions" and "enable interrupt instructions" for controlling these states. However, in the control of the interrupt state by software, the nesting of interrupt disable / recovery processing and the interrupt occurrence timing, etc., are very complex, which increases the testing cost of the software and reduces the maintainability.
[0004] In addition, sometimes it is necessary to process the interrupt state operation and other operations inseparably, and in this case, it is not enough to prepare only "disable interruption instruction" and "enable interruption instruction". As examples of the operation and other operations that are required to process the interrupt state inseparably, the following can be cited: first disabling interruption (disabling multiple interruptions) in the routine (interrupt routine) executed when the interrupt occurs and enabling interruption when resuming from the routine, or enabling interruption to wait for a single interrupt under the sleep instruction (an instruction that puts the microprocessor in a stopped state until the interrupt occurs).
[0005] To address such a technical problem, Patent Document 1 discloses a technology that does not allow interruption when executing instructions within an address range determined by hardware.
[0006] In addition, Patent Document 2 discloses the following technology: it is set to use the decoding result of the instruction decoder of the microprocessor to directly change the content of the interrupt mask register, so that a single instruction has the function of changing the value of the interrupt mask register. Such a single instruction simultaneously implements the call of the processing and the change of the value of the interrupt mask register, and interrupts are prohibited during the execution of the single instruction, thereby achieving indivisibility.
[0007] Prior art literature
[0008] Patent Literature
[0009] Patent Document 1: Japanese Patent Application Laid-Open No. 5-61693
[0010] Patent Document 2: Japanese Patent Application Publication No. 2010-267064 Summary of the invention
[0011] Technical issues to be solved by the invention
[0012] However, in the past, it was expected that a technology for controlling interrupt enable and interrupt disable when executing an instruction was provided. However, according to the above-mentioned Patent Documents 1 and 2, although the same technical problem is to be solved, neither of them is a technology for controlling interrupt enable and interrupt disable in units of instructions when executing an instruction.
[0013] The present disclosure has been made in view of such circumstances, and an object of the present disclosure is to provide an information processing device and an operation control method of the information processing device that can control interrupt enablement and interrupt disablement in units of instructions when executing instructions.
[0014] Technical solutions for solving technical problems
[0015] One aspect of the present disclosure is an information processing device, comprising: a processor module, which operates based on an instruction set with a bit field structure; an interrupt detection unit, which detects an interrupt signal from the outside; and an interrupt control unit, which controls the processor module so that the processor module operates in accordance with the detected interrupt signal, wherein the instruction set has a disable interrupt field for disabling interrupts when instructions are executed by the processor module, and when the interrupt signal is detected, the interrupt control unit controls the execution of interrupt processing by the processor module based on the content of the disable interrupt field set in the executed instruction code.
[0016] Another aspect of the present disclosure is a method for controlling the operation of an information processing device, the information processing device having a processor module that operates based on an instruction set with a bit field structure, the method comprising: when the instruction set has an interrupt disable field that disables interrupts when instructions are executed by the processor module, the information processing device detects an interrupt signal from the outside; and when the interrupt signal is detected, the information processing device controls the execution of interrupt processing by the processor module based on the content of the interrupt disable field set in the executed instruction code. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a block diagram showing the hardware structure of the information processing device according to one embodiment of the present disclosure.
[0018] Figure 2 A diagram showing an instruction pipeline processing process according to an embodiment of the present disclosure.
[0019] Figure 3 1 is a flowchart showing a procedure of an indivisible process performed by a microprocessor as a comparative example.
[0020] Figure 41 is a flowchart showing the procedure of the interrupt inhibit processing performed by the microprocessor as a comparative example.
[0021] Figure 5 1 is a flowchart showing the procedure of interrupt recovery processing performed by a microprocessor as a comparative example.
[0022] Figure 6 FIG. 2 is a diagram showing an example of allowing interruption when resuming from an interruption routine as a comparative example.
[0023] Figure 7 This is a diagram showing an example of setting a field for disabling interrupts in the bit fields of all instruction sets according to one embodiment of the present disclosure.
[0024] Figure 8 The flowchart is a flowchart showing an interrupt processing process of a microprocessor according to one embodiment of the present disclosure.
[0025] Fig. 9 A diagram showing a bit field structure of an instruction set according to a modified example of one embodiment of the present disclosure.
[0026] Reference numerals
[0027] 10: information processing device; 11: microprocessor; 12: memory; 13: interrupt controller; 14: bus; 111: arithmetic unit; 112: control circuit; 113: interrupt control register DETAILED DESCRIPTION
[0028] The embodiments of the present disclosure will be described below with reference to the drawings. In the description of the drawings referred to in the following description, the same or similar parts are denoted by the same or similar reference numerals and repeated descriptions are omitted.
[0029] In addition, the effects recorded in this specification are only illustrative and non-restrictive, and other effects may also be provided. In addition, in this specification, etc., the so-called unit means not only a physical unit, but also includes the case where the function of the unit is implemented by software. In addition, the function of one unit may be implemented by more than two physical units, or the function of more than two units may be implemented by one physical unit. In addition, "system" refers to a structure in which multiple devices (or functional modules that implement specific functions) are logically assembled, and there is no particular restriction on whether each device or functional module is in a single frame.
[0030] <One Implementation Method>
[0031] (Structure of Information Processing Device)
[0032] Figure 1 FIG. 1 is a block diagram showing the hardware structure of an information processing device 10 according to an embodiment of the present disclosure. Figure 1As shown, the information processing device 10 includes a microprocessor 11 , a memory 12 , and an interrupt controller 13 . The microprocessor 11 , the memory 12 , and the interrupt controller 13 are connected to each other via a bus 14 .
[0033] The microprocessor 11 includes a calculation unit 111 as a processor module, a control circuit 112 as an interrupt control unit, and an interrupt control register 113 .
[0034] A general register (not shown) provided in the microprocessor 10 temporarily stores various data generated when the arithmetic unit 111 executes an instruction.
[0035] The interrupt controller 13 detects an interrupt signal from the outside, and notifies the detected interrupt signal to the interrupt control register 113 of the microprocessor 11. Then, the interrupt control register 113 controls whether to notify the interrupt signal to the control circuit 112. When the interrupt signal is notified by the interrupt control register 113, the control circuit 112 controls the arithmetic unit 111 so that the arithmetic unit 111, i.e., the microprocessor 11, operates according to the value stored in the interrupt control register 113 indicating either a state of disabling interrupts or a state of enabling interrupts.
[0036] Furthermore, an input unit for receiving signals and data from an external device or a user and an output unit for outputting signals and data from an external device or a user may be connected to the bus 14 .
[0037] (Operation of information processing device)
[0038] Next, the procedure of instruction pipeline processing performed by the information processing device 10 will be described. Figure 2 1 shows instruction pipeline processing, which is executed by the microprocessor 11.
[0039] The microprocessor 11 extracts the instruction code from the specified address of the memory 12 (step ST2a), decodes the extracted instruction code (step ST2b), and executes the decoded instruction (step ST2c). Then, the microprocessor 11 writes the execution result to the general register or the specified address of the memory 12 (step ST2d). In addition, when an interrupt signal is received during the pipeline processing, the microprocessor 11 executes Figure 8 The interrupt handling is shown.
[0040] <Comparative Example of Embodiment>
[0041] In a microprocessor 11 supporting interrupts, the microprocessor 11 is usually provided with a "disable interrupt" or "enable interrupt" state and a "disable interrupt instruction" or "enable interrupt instruction" for controlling the state. These instructions are used to perform, for example, Figures 3 to 5The processing shown in the flowchart can thereby achieve indivisible processing in most cases.
[0042] Figure 3 1 is a flowchart showing the procedure of the indivisible processing performed by the microprocessor 11.
[0043] The microprocessor 11 stores the value stored in the interrupt control register 113 in the general register or the memory 12, and executes the "disable interrupt instruction" (step ST3a), such as executing processing that does not want to be interrupted, such as rewriting data (step ST3b). After the processing is completed, the value of the interrupt control register 113 is restored to the value stored in the general register or the memory 12 in the above step ST3a according to the state of allowing interrupts (step ST3c).
[0044] Figure 4 1 is a flowchart showing the procedure of the interrupt disable process performed by the microprocessor 11.
[0045] When a value indicating "disable interruption" or "enable interruption" is obtained from the interrupt control register 113 (step ST4a), the microprocessor 11 sets the value stored in the interrupt control register 113 to a value indicating "disable interruption" (step ST4b), and stores the obtained value indicating "disable interruption" or "enable interruption" in the general register or memory 12 (step ST4c).
[0046] Figure 5 1 is a flowchart showing the procedure of the interrupt recovery process performed by the microprocessor 11.
[0047] The microprocessor 11 reads the value stored in the general register or the memory 12 in step ST4c (step ST5a), and determines whether the read value is "interrupt disabled" or "interrupt enabled" (step ST5b). Here, if it is "interrupt enabled" (enabled), the microprocessor 11 sets the value stored in the interrupt control register 113 to a value indicating "interrupt enabled" (step ST5c), and if it is "interrupt disabled" (disabled), the microprocessor 11 sets the value stored in the interrupt control register 113 to a value indicating "interrupt disabled" (step ST5d).
[0048] However, in the control of the interrupt status by software, the possible interrupt patterns such as the nesting of interrupt disable / reset processing and interrupt occurrence timing are huge, resulting in increased software testing costs and reduced maintainability.
[0049] In addition, sometimes it is necessary to process the interrupt state operation and other operations inseparably, and in this case, it is not enough to prepare only "disable interruption instruction" and "enable interruption instruction". As examples of the operation and other operations that are required to process the interrupt state inseparably, the following can be listed: first disabling interruption (disabling multiple interruptions) in the routine (interrupt routine) executed when the interrupt occurs and enabling interruption when resuming from the routine, or enabling interruption to wait for a single interrupt under the sleep instruction (an instruction that puts the microprocessor in a stopped state until the interrupt occurs).
[0050] Figure 6 This is an example of enabling interrupts when resuming from an interrupt routine. In this example, the return destination address from the interrupt routine is saved in a general register, and after the interrupt enable state is set according to the interrupt enable instruction, a jump instruction is used to jump to the return destination address saved in the general register. However, there is a possibility of being interrupted by other interrupts during the period from the interrupt enable instruction to the execution of the jump instruction. If interrupted during this period, the contents of the general register storing the return destination address are overwritten, so it cannot work correctly.
[0051] <Solution of one embodiment>
[0052] So in one embodiment, if Figure 7 As shown, a field for disabling interrupts is set in the bit fields of all instruction sets of the microprocessor 11. When an interrupt is detected in an instruction of the same operation, an instruction for enabling interrupts and an instruction for disabling interrupts are defined before the instruction is executed. Using these instruction sets, interrupts can be controlled when executing instructions.
[0053] Here, the generation of the instruction code including the interrupt disable field can be realized by describing a pragma or the like in the application source code so that the interrupt disable section or the like can be specified to the compiler (not shown).
[0054] Figure 8 The flowchart of the interrupt processing process of the microprocessor 11 of one embodiment is shown. Here, in the microprocessor 11 that can control the prohibition and permission of interrupts by using the interrupt control register 113, the microprocessor 11 performs instruction extraction. When the interrupt signal is detected by the interrupt controller 13 (step ST8a), if the interrupt control register 113 is in the interrupt permission state (step ST8b: yes) and the prohibition interrupt field of the instruction set obtained by extracting the instruction is valid (set state) (step ST8c: yes), it is possible to execute the processing based on the extracted instruction without performing the interrupt processing, so that the interrupt is delayed.
[0055] If the interrupt disable field of the instruction set obtained by fetching the instruction is invalid (not set) (step ST8c: No), the microprocessor 11 executes interrupt processing (step ST8d).
[0056] On the other hand, in step ST8b, if the interrupt control register 113 is in the interrupt disabled state (step ST8b: No), the microprocessor 11 does not perform interrupt processing.
[0057] <Effects of One Embodiment>
[0058] As described above, according to one embodiment, it is possible to implement control of disabling and enabling interrupts with individual instructions in all instructions. Therefore, compared with advanced control programming that requires timing control so far, it is possible to achieve both improved programmability and ease of programming, which can help reduce software development costs.
[0059] In addition, according to one embodiment, before interrupt control is performed based on the contents of the interrupt disable field, it is determined whether to disable or enable interrupts based on the value stored in the interrupt control register 113, and interrupt control based on the contents of the interrupt disable field is performed only when the value stored in the interrupt control register 113 indicates a state in which interrupts are enabled.
[0060] Furthermore, according to one embodiment, a disable interrupt field is set for all instructions respectively, so that when an interrupt signal is detected in instructions of the same operation, instructions that allow interrupts and instructions that disable interrupts can be distinguished before the instructions are executed.
[0061] <Modification>
[0062] Fig. 9 A diagram showing a bit field structure of an instruction set according to a modified example of one embodiment of the present disclosure.
[0063] In a modified example of an embodiment of the present disclosure, a field for disabling interrupts is set only in the bit field of a portion of the instruction cluster group. Here, in the instruction set, each instruction is constructed in any format from instruction format A to instruction format E. In a modified example of an embodiment of the present disclosure, a field for disabling interrupts is set only in instruction format A.
[0064] For example, when the microprocessor 11 Figure 6 As shown, when a jump instruction (jump_r r4) is executed after the interrupt enable instruction (int_enable), the interrupt disable field can be set only in the bit field of the jump instruction.
[0065] <Effects of Modification Example>
[0066] As described above, according to the modification of one embodiment, by providing the disable interrupt field only in the bit field of a part of the instruction cluster groups, the instruction bit field can be optimized (cost saving).
[0067] <Other Implementation Methods>
[0068] As described above, the present technology is described by an embodiment and a variation of an embodiment, but it should not be understood that the discussion and drawings constituting a part of the present disclosure limit the present technology. If the main purpose of the technical content disclosed in the above-mentioned embodiment is understood, it will be obvious to those skilled in the art that various alternative embodiments, examples and application technologies can be included in the present technology. In addition, the structures disclosed in an embodiment and a variation of an embodiment can be combined as appropriate within the scope that no contradiction occurs. For example, the structures disclosed in multiple different embodiments can be combined, and the structures disclosed in multiple different variations of the same embodiment can also be combined.
[0069] In addition, the present disclosure can also adopt the following structures.
[0070] (1) An information processing device comprising:
[0071] A processor module operates based on an instruction set of a bit field structure;
[0072] an interruption detection unit for detecting an interruption signal from outside; and
[0073] an interrupt control unit, controlling the processor module so that the processor module operates according to the detected interrupt signal,
[0074] wherein the instruction set has a disable interrupt field for disabling interrupts when instructions are executed by the processor module,
[0075] When the interrupt signal is detected, the interrupt control unit controls the execution of the interrupt processing by the processor module based on the content of the interrupt disable field set in the executed instruction code.
[0076] (2) The information processing device according to (1) above, wherein:
[0077] A register is provided, the register storing a value indicating any state of a state in which interrupts are disabled and a state in which interrupts are enabled when the processor module executes instructions,
[0078] When the interrupt signal is detected, the interrupt control unit controls the execution of the interrupt processing by the processor module based on the value stored in the register and the content of the interrupt disable field set in the executed instruction code.
[0079] (3) The information processing device according to (2) above, wherein:
[0080] When the value stored in the register indicates a state in which interrupts are enabled, the interrupt control unit controls the execution of interrupt processing by the processor module based on the content of the interrupt disable field set in the executed instruction code.
[0081] (4) The information processing device according to (1) above, wherein:
[0082] The instruction set constitutes an instruction cluster group used by the processor module to execute at least one task, and the disable interrupt field is set in a bit field of each instruction cluster group.
[0083] (5) The information processing device according to (1) above, wherein:
[0084] The instruction set constitutes an instruction cluster group used by the processor module to execute at least one task, and the disable interrupt field is set in a bit field of at least a part of the instruction cluster group.
[0085] (6) An operation control method for an information processing device, the information processing device having a processor module that operates based on an instruction set with a bit field structure, when the instruction set has an interrupt disable field for disabling interrupts when the instruction is executed by the processor module, the operation control method comprising:
[0086] The information processing device detects an interrupt signal from the outside; and
[0087] When the interrupt signal is detected, the information processing device controls the execution of the interrupt processing by the processor module based on the content of the interrupt disable field set in the executed instruction code.
[0088] (7) The operation control method of the information processing device according to (6) above, wherein:
[0089] When the information processing device includes a register storing a value indicating a state in which interrupts are disabled and a state in which interrupts are enabled when the processor module executes instructions,
[0090] The control includes: when the interrupt signal is detected, the information processing device controls the processor module to execute the interrupt processing based on the value stored in the register and the content of the interrupt disable field set in the executed instruction code.
[0091] (8) The operation control method of the information processing device according to (7) above, wherein:
[0092] The control includes: when the value stored in the register indicates a state in which interrupts are allowed, controlling the processor module to execute interrupt processing based on the content of a disable interrupt field set in the executed instruction code.
[0093] (9) The operation control method of the information processing device according to (6) above, wherein:
[0094] The instruction set constitutes an instruction cluster group used by the processor module to execute at least one task, and the disable interrupt field is set in a bit field of each instruction cluster group.
[0095] (10) The operation control method of the information processing device according to (6) above, wherein:
[0096] The instruction set constitutes an instruction cluster group used by the processor module to execute at least one task, and the disable interrupt field is set in a bit field of at least a part of the instruction cluster group.
Claims
1. An information processing device comprising: A processor module operates based on an instruction set of a bit field structure; an interruption detection unit for detecting an interruption signal from outside; and an interrupt control unit, controlling the processor module so that the processor module operates according to the detected interrupt signal, in, The instruction set has a disable interrupt field for disabling interrupts when instructions are executed by the processor module, When the interrupt signal is detected, the interrupt control unit controls the execution of the interrupt processing by the processor module based on the content of the interrupt disable field set in the executed instruction code.
2. The information processing device according to claim 1, wherein: A register is provided, the register storing a value indicating any state of a state in which interrupts are disabled and a state in which interrupts are enabled when the processor module executes instructions, When the interrupt signal is detected, the interrupt control unit controls the execution of the interrupt processing by the processor module based on the value stored in the register and the content of the interrupt disable field set in the executed instruction code.
3. The information processing device according to claim 2, wherein: When the value stored in the register indicates a state in which interrupts are enabled, the interrupt control unit controls the execution of interrupt processing by the processor module based on the content of the interrupt disable field set in the executed instruction code.
4. The information processing device according to claim 1, wherein: The instruction set constitutes an instruction cluster group used by the processor module to execute at least one task, and the disable interrupt field is set in a bit field of each instruction cluster group.
5. The information processing device according to claim 1, wherein: The instruction set constitutes an instruction cluster group used by the processor module to execute at least one task, and the disable interrupt field is set in a bit field of at least a part of the instruction cluster group.
6. A method for controlling operation of an information processing device, the information processing device comprising a processor module that operates based on an instruction set having a bit field structure, wherein when the instruction set has an interrupt disable field for disabling interrupts when the processor module executes the instruction, the method comprises: The information processing device detects an interrupt signal from the outside; and When the interrupt signal is detected, the information processing device controls the execution of the interrupt processing by the processor module based on the content of the interrupt disable field set in the executed instruction code.
7. The operation control method of the information processing device according to claim 6, wherein: When the information processing device includes a register storing a value indicating a state in which interrupts are disabled and a state in which interrupts are enabled when the processor module executes instructions, The control includes: when the interrupt signal is detected, the information processing device controls the processor module to execute the interrupt processing based on the value stored in the register and the content of the interrupt disable field set in the executed instruction code.
8. The operation control method of the information processing device according to claim 7, wherein: The control includes: when the value stored in the register indicates a state in which interrupts are allowed, controlling the processor module to execute interrupt processing based on the content of a disable interrupt field set in the executed instruction code.
9. The operation control method of the information processing device according to claim 6, wherein: The instruction set constitutes an instruction cluster group used by the processor module to execute at least one task, and the disable interrupt field is set in a bit field of each instruction cluster group.
10. The operation control method of the information processing device according to claim 6, wherein: The instruction set constitutes an instruction cluster group used by the processor module to execute at least one task, and the disable interrupt field is set in a bit field of at least a part of the instruction cluster group.
