How mmkathurima/rims works
Project Type and Purpose
• This is a desktop simulation suite for microcontrollers (the “Riverside-Irvine Microcontroller Simulator”), built on .NET 6.0 using C# and WinForms.
• It consists of three distinct executables under one Visual Studio solution (RIMS.sln):
– RIMS.exe: the core microcontroller simulator (AVR/ARM emulation, I/O peripherals, debugger)
– RIBS.exe: a State-Machine (SM) builder/editor (generates .sm files)
– RITS.exe: a timestamp/trace tool (auxiliary utility)
File Structure
• Top-level solution (RIMS.sln), three project folders (RIMS, RIBS, RITS) plus a shared “CSUST.Data” library under RIMS.
• Each project contains:
– Properties (AssemblyInfo, Resources, Settings)
– .resx files (localization, built-in samples)
– Program.cs + UI Forms (.cs and .Designer.cs)
– Domain code (RIMS_V2/*, RIBS_V3/*, RITS/*)
• Shared library (CSUST.Data) provides custom controls (TSmartProgressBar).
• Configuration files (app.config) and multimedia resources (song*.wav, COM dependencies).
README for Architectural Clues
• Clearly separates “Building” vs. “Running” dependencies.
• Mentions:
– Core simulation engine (CPU decode, peripheral models)
– GUI (WinForms)
– COM interop with Windows Media Player for audio playback
– File-based project format: .sm, .c, .asm sample files
• No external web services or databases.
Main Components & Their Interactions
a. Executable Boundary (three .exe’s)
– RIMS.exe (Simulator UI + Engine)
– RIBS.exe (State-Machine Editor UI + Generator)
– RITS.exe (Timestamp/Trace Utility)
b. Shared Library (CSUST.Data)
– Custom WinForms controls (progress bars, designers)
c. Simulation Core (inside RIMS_V2 namespace)
– CPU emulator (VM.cs, VMInterface.cs)
– Peripheral models (TimerInterface, UARTInterface, Speaker, LEDs, 7-seg display)
– Debug engine (breakpoints, step-through)
d. State-Machine Generator/Core (RIBS_V3 namespace)
– Graph, Node, Edge models
– SMSerializer for reading/writing .sm files
– UI forms for transitions (TransitionIfElseForm, ForLoopForm)
e. File I/O Layer
– Project.cs and Samples.cs for loading/saving projects & sample code
– Resources (.sm, .c, .asm) embedded in .resx
f. External Services
– COM Interop: Windows Media Player Legacy for audio playback in RIMS
– File system for reading/writing projects & samples
Architectural Patterns and Design Principles
• Layered Approach:
– Presentation (WinForms UI)
– Application Logic (controllers, event handlers)
– Domain Model (simulation core, SM core)
– Infrastructure (file I/O, COM interop)
• MVC-style separation (UI forms call into engine classes, not vice versa).
• Plugin-ish structure: each tool (RIMS/RIBS/RITS) is a standalone module.