# siubikyt/srisc32 architecture

> Architecture diagram of the GitHub repository siubikyt/srisc32, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siubikyt/srisc32
- Repository: https://github.com/siubikyt/srisc32

## Overview

SRISC32 is a small custom 32-bit instruction-set project: assembly examples and libraries target the ISA, while a C emulator loads a binary and executes it. A separate HTTP server exposes chunks from a binary file to a programmer client. The README contains only the project name, and no assembler or wiring between the assembly files and runtime tools is present in the tree, so those links are left unspecified.

Main entry points: [`SRISC32_Emulator/main.c`](https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c) (Instruction Engine), [`programmer_server/server.py`](https://github.com/siubikyt/srisc32/blob/main/programmer_server/server.py) (Chunk Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_isa["ISA and Software"]
  node_assembly["Assembly Programs<br/>[hello_world.asm]"]
  node_libraries["Assembly Libraries<br/>[display.asm]"]
  node_mathlib["Math Library<br/>[stdmath.asm]"]
  node_isa_doc["ISA Description"]
  node_calling_convention["Calling Convention"]
end

subgraph group_emulator["CPU Emulator"]
  node_emulator_entry["Emulator Entry<br/>[main.c]"]
  node_instruction_engine["Instruction Engine<br/>[main.c]"]
  node_cpu_state["CPU State<br/>[main.c]"]
  node_program_memory[("Program Memory<br/>[main.c]")]
  node_data_memory[("Data Memory<br/>[main.c]")]
  node_screen_output["Screen Output<br/>[main.c]"]
end

subgraph group_programmer["Programmer Service"]
  node_programmer_server["Chunk Server<br/>[server.py]"]
  node_binary_source["Binary File"]
end

node_operator(("Operator"))
node_programmer_client(("Programmer Client"))

node_operator -->|"starts with binary"| node_emulator_entry
node_emulator_entry -->|"loads binary"| node_program_memory
node_emulator_entry -->|"allocates memory"| node_data_memory
node_emulator_entry -->|"clocks CPU"| node_instruction_engine
node_instruction_engine -->|"fetches instruction"| node_program_memory
node_instruction_engine -->|"decodes and updates"| node_cpu_state
node_instruction_engine -->|"loads and stores"| node_data_memory
node_instruction_engine -->|"prints output"| node_screen_output
node_operator -->|"starts with binary"| node_programmer_server
node_programmer_server -->|"reads binary"| node_binary_source
node_programmer_client -->|"requests byte chunk"| node_programmer_server
node_programmer_server -->|"returns chunk"| node_programmer_client

click node_assembly "https://github.com/siubikyt/srisc32/blob/main/programs/hello_world.asm"
click node_libraries "https://github.com/siubikyt/srisc32/blob/main/libraries/display.asm"
click node_mathlib "https://github.com/siubikyt/srisc32/blob/main/libraries/stdmath.asm"
click node_isa_doc "https://github.com/siubikyt/srisc32/blob/main/SRISC32_ISA_Description.txt"
click node_calling_convention "https://github.com/siubikyt/srisc32/blob/main/SRISC32_Calling_Convention.txt"
click node_emulator_entry "https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c"
click node_instruction_engine "https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c"
click node_cpu_state "https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c"
click node_program_memory "https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c"
click node_data_memory "https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c"
click node_screen_output "https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c"
click node_programmer_server "https://github.com/siubikyt/srisc32/blob/main/programmer_server/server.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_assembly,node_libraries,node_mathlib,node_isa_doc,node_calling_convention,node_programmer_client toneBlue
class node_emulator_entry,node_instruction_engine,node_cpu_state,node_program_memory,node_data_memory,node_screen_output toneAmber
class node_programmer_server,node_binary_source toneMint
class node_operator toneIndigo
```

## Components

### ISA and Software

- [Assembly Programs](https://github.com/siubikyt/srisc32/blob/main/programs/hello_world.asm): `programs/hello_world.asm`
- [Assembly Libraries](https://github.com/siubikyt/srisc32/blob/main/libraries/display.asm): `libraries/display.asm`
- [Math Library](https://github.com/siubikyt/srisc32/blob/main/libraries/stdmath.asm): `libraries/stdmath.asm`
- [ISA Description](https://github.com/siubikyt/srisc32/blob/main/SRISC32_ISA_Description.txt): `SRISC32_ISA_Description.txt`
- [Calling Convention](https://github.com/siubikyt/srisc32/blob/main/SRISC32_Calling_Convention.txt): `SRISC32_Calling_Convention.txt`

### CPU Emulator

- [Emulator Entry](https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c): `SRISC32_Emulator/main.c`
- [Instruction Engine](https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c): `SRISC32_Emulator/main.c`
- [CPU State](https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c): `SRISC32_Emulator/main.c`
- [Program Memory](https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c): `SRISC32_Emulator/main.c`
- [Data Memory](https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c): `SRISC32_Emulator/main.c`
- [Screen Output](https://github.com/siubikyt/srisc32/blob/main/SRISC32_Emulator/main.c): `SRISC32_Emulator/main.c`

### Programmer Service

- [Chunk Server](https://github.com/siubikyt/srisc32/blob/main/programmer_server/server.py): `programmer_server/server.py`
- **Binary File**

### Other components

- **Operator**
- **Programmer Client**

## Connections

- Operator → Emulator Entry: starts with binary
- Emulator Entry → Program Memory: loads binary
- Emulator Entry → Data Memory: allocates memory
- Emulator Entry → Instruction Engine: clocks CPU
- Instruction Engine → Program Memory: fetches instruction
- Instruction Engine → CPU State: decodes and updates
- Instruction Engine → Data Memory: loads and stores
- Instruction Engine → Screen Output: prints output
- Operator → Chunk Server: starts with binary
- Chunk Server → Binary File: reads binary
- Programmer Client → Chunk Server: requests byte chunk
- Chunk Server → Programmer Client: returns chunk
