Shadow Functional Unit Interrupt Handling in Microcontrollers
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Microcontrollers face delays or halts in program execution due to interruptions for handling exceptions and interrupts, as existing methods require restarting instructions from the beginning after interruptions, wasting processing cycles.
Innovation Solution
A shadow functional unit completes the execution of interrupted instructions and updates the main register file with the result, allowing for early termination of re-execution and reducing cycle waste by comparing program counters and operands with a shadow register file.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the microcontroller core services interrupts by interrupting instruction execution, then interrupt handling capability is improved, but program execution time increases and processing efficiency decreases
Solution Approach 1:
The patent divides the instruction execution function into two separate units: a main microcontroller core that handles interrupts and a shadow functional unit that completes interrupted instructions. This segmentation allows the main core to service interrupts without waiting for instruction completion, while the shadow unit ensures instruction execution continues, thereby resolving the contradiction between interrupt handling capability and program execution time.
Solution Approach 2:
The shadow functional unit acts as an intermediary that takes over the execution of interrupted instructions from the main microcontroller core. When an interrupt occurs, the shadow unit completes the instruction using saved program counter and operand values, serving as a mediator that allows the main core to handle interrupts while ensuring instruction execution is not lost, thus reducing execution time loss.
2Reliability
If instructions are restarted from the beginning after interruption, then correct execution is ensured, but processing cycles are wasted and productivity decreases
Solution Approach 1:
The patent implements preliminary action by saving the program counter and operand values before interruption occurs. These saved values are then used by the shadow functional unit to resume instruction execution from the correct position without needing to restart from the beginning, ensuring both execution correctness and improved processing efficiency by avoiding wasted cycles.
Solution Approach 2:
The shadow functional unit creates a copy of the instruction execution state by using saved program counter and operand values. This copy allows the instruction to be re-executed from the correct position without affecting the main core's interrupt handling, thereby ensuring execution correctness while avoiding the waste of processing cycles that would occur with a complete restart.
3Loss of time
If a shadow functional unit is introduced to complete interrupted instructions, then execution time loss is reduced, but device complexity increases
Solution Approach 1:
The shadow functional unit is designed with multi-functionality, serving multiple purposes: it completes interrupted instructions, stores program counter and operand values, and provides the main core with resumption information. This universal design reduces execution time loss while minimizing the increase in device complexity by consolidating multiple functions into a single unit.
Solution Approach 2:
The shadow functional unit is nested within the existing microcontroller architecture, utilizing available resources such as register files and memory structures. The unit is integrated with the main core's interrupt handling mechanism, allowing it to function as a nested component that reduces execution time loss without proportionally increasing overall device complexity.
Data Source
AI summary
In an embodiment, a method for processing instructions in a microcontroller is disclosed. In the embodiment, the method involves, upon receipt of an interrupt while an instruction is being executed, completing execution of the instruction by a shadow functional unit and, upon servicing the interrupt, terminating re-execution of the instruction and updating a main register file with the result of the execution of the instruction by the shadow functional unit.


