SysML v2 and Software - Part 1

I’m working to get up to speed with the official release of SysML 2.0 (in March, 2025?). It is believed to be a game changer with respect to adoption. From a software developer perspective, the incorporation of both text and visual standards could be interesting. I’ve been working to wrap my head around some embedded system examples.

(This is a work in progress)

Physical Structures

Example 1 - Arduino Nano ESP32

I asked ChatGPT to create a simple embedded system example with the following prompt.

Let's say we have an Arduino nano esp32 hooked to a custom board with a small LCD, 3 LEDs (power, activity, error) and 6 push buttons (up, down, left, right, enter, cancel). This would have a single software binary programmed via JTAG. How might you model the hardware and software csci in this example?

package ArduinoNanoControlBoardSystem {

  // Abstract part definition for Software
  abstract part def Software {
    attribute name : String;
    attribute description : String;
  }

  // Define the software binary as a specialization of Software
  part def NanoSoftware specializes Software {
    attribute name : String = "Arduino Nano ESP32 Software Binary";
    attribute description : String = "Controls the LCD, LEDs, and push buttons.";
    attribute fileName : String = "nano_firmware.bin";
    attribute programmingInterface : String = "JTAG";
  }

  // Define the Arduino Nano ESP32 hardware
  part def ArduinoNanoESP32 {
    attribute name : String = "Arduino Nano ESP32";
    attribute processor : String = "ESP32";
    attribute memory : String = "4MB Flash, 520KB SRAM";
  }

  // Define the custom control board with Arduino Nano as a part
  part def CustomControlBoard {
    attribute name : String = "Custom Control Board";

    // Arduino Nano ESP32
    part arduino : ArduinoNanoESP32 {
      attribute usage : String = "Microcontroller";
    }

    // LCD component
    part lcd : LCD {
      attribute resolution : String = "128x64";
      attribute type : String = "Monochrome";
    }

    // LEDs
    part powerLED : LED {
      attribute color : String = "Green";
    }
    part activityLED : LED {
      attribute color : String = "Blue";
    }
    part errorLED : LED {
      attribute color : String = "Red";
    }

    // Push buttons
    part upButton : PushButton {
      attribute label : String = "Up";
    }
    part downButton : PushButton {
      attribute label : String = "Down";
    }
    part leftButton : PushButton {
      attribute label : String = "Left";
    }
    part rightButton : PushButton {
      attribute label : String = "Right";
    }
    part enterButton : PushButton {
      attribute label : String = "Enter";
    }
    part cancelButton : PushButton {
      attribute label : String = "Cancel";
    }
  }

  // Define the overall system
  part def ArduinoControlSystem {
    part controlBoard : CustomControlBoard {
      attribute instanceID : String = "ControlBoard1";
    }

    part software : NanoSoftware {
      allocate to controlBoard::arduino;
    }
  }
}

Example 2 - GfSE Vehicle Model

https://github.com/GfSE/SysML-v2-Models/blob/main/models/SE_Models/VehicleModel.sysml

# Excerpt from the above link.

package VehicleModel {
    import Definitions::*;
    package Definitions {
        // These imports eliminate the need to import into each nested package
        import PartDefinitions::*;
        import PortDefinitions::*;
        import ItemDefinitions::*;
        import SignalDefinitions::*;
        import InterfaceDefinitions::*;
        import ActionDefinitions::*;
        import StateDefinitions::*;
        import RequirementDefinitions::*;
        import AttributeDefinitions::*;
        import IndividualDefinitions::*;
        package PartDefinitions {

        ...

        part def Wheel {
                attribute diameter: LengthValue;
            }
            abstract part def Software;
            part def VehicleSoftware :> Software;
            part def VehicleController :> Software {
                exhibit state controllerStates: ControllerStates;
            }
            part def FuelTank {
                attribute mass :> ISQ::mass;
                ref item fuel: Fuel {
                    attribute redefines fuelMass;
                }
                attribute fuelMassMax :> ISQ::mass;
                assert constraint {
                    fuel::fuelMass <= fuelMassMax
                }
            }
        }
    }
}

Example 3 - Microzed Development Board

Next, I asked ChatGPT to generate an example COTS development board that uses embedded Linux since I wanted to see a multi CSCI example of a simple system.

Please generate an example of a single Microzed board which connects over ethernet to a kiosk touch screen web client. The Microzed board hosts an embedded web server. Provide a representative structure of embedded linux files for core 0, baremetal executable for core 1 and FPGA.

package MicroZedKioskSystem {

  // Define the shared MicroZed board structure
  part def MicroZedBoard {
    attribute name : String = "MicroZed Board";
    attribute description : String = "MicroZed board hosting embedded web server and FPGA logic.";

    part processor : Zynq7000 {
      part core0 : Core {
        attribute usage : String = "Embedded Linux for Web Server";
      }
      part core1 : Core {
        attribute usage : String = "Bare-Metal Operations";
      }
      part fpga : FPGA {
        attribute usage : String = "Custom FPGA Logic";
      }
    }

    part ethernet : Interface {
      attribute type : String = "Ethernet";
      attribute speed : String = "100 Mbps";
    }
  }

  // Define the Kiosk Client
  part def KioskClient {
    attribute name : String = "Touch Screen Kiosk Client";
    attribute description : String = "Web client for user interaction.";

    part display : Display {
      attribute type : String = "Touch Screen";
      attribute resolution : String = "1920x1080";
    }

    part ethernet : Interface {
      attribute type : String = "Ethernet";
    }
  }

  // Define the Embedded Linux structure for Core 0
  part def Core0Software {
    attribute name : String = "Embedded Linux Web Server";
    attribute description : String = "Files and services for the embedded web server.";

    part fsbl : File {
      attribute fileName : String = "fsbl.elf";
      attribute description : String = "First Stage Boot Loader.";
    }

    part uboot : File {
      attribute fileName : String = "u-boot.elf";
      attribute description : String = "Bootloader.";
    }

    part kernel : File {
      attribute fileName : String = "zImage";
      attribute description : String = "Linux kernel.";
    }

    part dtb : File {
      attribute fileName : String = "system.dtb";
      attribute description : String = "Device Tree Blob.";
    }

    part rootfs : File {
      attribute fileName : String = "rootfs.ext4";
      attribute description : String = "Base root filesystem.";
    }

    part webApp : File {
      attribute fileName : String = "web_server_app.tar.gz";
      attribute description : String = "Web server application deployed on rootfs.";
    }
  }

  // Define the Bare-Metal Executable for Core 1
  part def Core1Executable {
    attribute name : String = "Bare-Metal Application";
    attribute fileName : String = "core1_app.elf";
    attribute description : String = "Bare-metal executable for hardware operations.";
  }

  // Define the FPGA configuration
  part def FpgaConfiguration {
    attribute name : String = "FPGA Bitstream";
    attribute fileName : String = "fpga.bit";
    attribute description : String = "Bitstream for custom FPGA logic.";
  }

  // Define the overall system
  part def MicroZedKioskSystem {
    part board : MicroZedBoard {
      allocate part core0Software : Core0Software;
      allocate part core1Executable : Core1Executable;
      allocate part fpgaConfig : FpgaConfiguration;
    }

    part kiosk : KioskClient;

    // Define the Ethernet connection
    connection ethernetConnection {
      end board.ethernet;
      end kiosk.ethernet;
    }
  }
}