RTOS Global Variable Encapsulation via C Typedef

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing Real-Time Operating Systems (RTOS) programs face inefficiencies due to scattered global variables in memory, leading to increased data cache misses, difficulty in detecting corruption, and challenges in gathering current variable values, which impact performance and troubleshooting.

Innovation Solution

Encapsulating global variables into a single C typedef and instantiating them as a singular C global variable, ensuring they are placed in a prescribed order and locked into cache memory, facilitating efficient access and corruption detection.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of manufacture

If global variables are scattered in memory as separate C variables, then the C compiler can generate addresses for each variable, but this increases instruction memory usage and processing cycles

Engineering Contradiction:
Improvecompiler address generationVSAvoidinstruction memory usage
Core Design Contradiction:
Ease of manufactureVSQuantity of substance

Solution Approach 1:

The patent merges multiple scattered global variables into a single structure (e.g., `RTOS_Encapsulated_Globals`), allowing the compiler to generate one base address instead of multiple individual addresses. This consolidation reduces instruction memory usage and processing overhead while maintaining full access to all global variables through the unified structure.

Inventive Principle:
Principle #5Merging (Combining)

2Adaptability or versatility

If global variables are placed anywhere in memory by the linker, then flexibility in memory allocation is achieved, but it becomes impossible to explicitly locate variables in high-speed memory or lock them into data cache

Engineering Contradiction:
Improvememory allocation flexibilityVSAvoiddata cache access speed
Core Design Contradiction:
Adaptability or versatilityVSSpeed

Solution Approach 1:

By combining all global variables into a single structure, the patent enables explicit control over the structure's memory location. This unified approach allows the linker to place the entire structure in high-speed memory or cache regions, ensuring all variables benefit from fast access without sacrificing allocation flexibility.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent performs preliminary organization of global variables into a structured format during the compilation stage, enabling subsequent memory placement optimizations. This pre-structuring allows the linker and compiler to efficiently locate and lock the variables into cache memory, improving access speed before runtime.

Inventive Principle:
Principle #10Preliminary action

3Adaptability or versatility

If global variables are scattered throughout memory, then individual variable placement is flexible, but data cache misses increase translating to slower performance

Engineering Contradiction:
Improvevariable placement flexibilityVSAvoidprocessing performance
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent consolidates scattered global variables into a single contiguous structure, ensuring that all variables reside in adjacent memory locations. This approach maintains placement flexibility while minimizing cache misses, as the processor can load the entire structure into cache with fewer accesses, significantly improving processing performance.

Inventive Principle:
Principle #5Merging (Combining)

4Device complexity

If global variables are scattered in memory, then individual variable management is simple, but corruption detection becomes more difficult

Engineering Contradiction:
Improvevariable management complexityVSAvoidcorruption detection difficulty
Core Design Contradiction:
Device complexityVSDifficulty of detecting and measuring

Solution Approach 1:

By merging all global variables into a single structure, the patent creates a unified memory region that can be monitored and validated as one unit. This simplifies corruption detection mechanisms, such as adding checksums or integrity checks to the entire structure, making it easier to detect and diagnose memory corruption issues compared to scattered variables.

Inventive Principle:
Principle #5Merging (Combining)

5Ease of operation

If global variables are scattered throughout memory, then individual variable access is direct, but gathering current values of all variables for troubleshooting is difficult

Engineering Contradiction:
Improveindividual variable accessVSAvoidtroubleshooting complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent combines all global variables into a single accessible structure, maintaining direct access to individual variables through structure members while enabling easy gathering of all variable values by simply accessing the base structure. This unified approach dramatically simplifies troubleshooting and debugging operations.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS20240118908A1Methods and apparatus for data encapsulation for operating systems
Publication Date: 2024.04.11 LAMIE WILLIAM E
  • US20240118908A1 patent drawing
  • US20240118908A1 patent drawing
  • US20240118908A1 patent drawing

AI summary

Methods and apparatus for enhanced encapsulation of global data or variables of an operation system program (e.g., a real-time operating system (RTOS) program). In one exemplary embodiment, apparatus may encapsulate a plurality of program global data into a single type-definition for subsequent instantiation of the single type-definition as a single global variable for use global data accesses. Unlike traditional techniques where each global variable is distinct and instantiated individually, the various aspects of the present disclosure are directed to improved global variable management, performance and corruption detection by, inter alia, guaranteeing placement of global variables in the same order they are defined. Moreover, various aspects of the present disclosure are directed to enhancements with respect to verification and technical support.