How lzy107/simuphy2 works
Main Components
• Device Manager (or Device Instance Management) – Handles device type registration (the device “classes” or templates) and device instance creation.
• Memory Manager – Manages creation and operations on memory regions associated with each device.
• Monitor (Watchpoint) Component – Provides the functionality to add watchpoints to memory regions and triggers upon memory access events.
• Action Manager – Defines and manages actions (callbacks, scripts, command executions) that are executed when monitoring events occur.
• Rule Engine – Binds conditions (watchpoints) to specific actions allowing for complex behavior, such as cross-device interactions.
Architectural Layers/Relationships
• Layer 1 – Device Type Layer:
• Represents the device_type_list where available device “templates” are defined.
• That each device type includes a set of operations (create, destroy, reset, etc.).
• Layer 2 – Device Instance Layer:
• How device instances are created (via device_create) based on device types.
• Each instance then holds associations with one or more memory regions.
• Layer 3 – Memory Region Layer:
• Memory_region_list where each memory region is tied to a particular device instance.
• Properties such as base address, size, and access permissions.
• Auxiliary Components:
• Monitors are associated with memory regions; they watch for specific memory operations such as writes or writes of specific values.
• Actions are then attached to monitors. They are designed to execute callbacks, script commands, or cross-device operations when triggers occur.
• The Rule Engine component (or rule_engine module) ties monitoring and action execution together, regulating behavior based on defined rules.