This project simulates a basic computer architecture, implementing key hardware and logic components. It is designed to execute assembly code provided in program.txt and coordinate the execution through a clock cycle loop.
/Project_Root
│
├── /src
│ ├── main.ext # Entry point & Clock Cycle Loop
│ ├── /hardware
│ │ ├── RegisterFile.ext # R0-R63 & SREG
│ │ ├── Memory.ext # Instruction (1024x16) & Data (2048x8)
│ │ └── ProgramCounter.ext # 16-bit PC
│ │
│ ├── /logic
│ │ ├── ALU.ext # Arithmetic/Logic & Flag calculations
│ │ ├── Decoder.ext # R-Format vs I-Format splitting
│ │ └── Pipeline.ext # IF/ID/EX Stage coordination
│ │
│ └── /utils
│ └── Parser.ext # File reader & bit-concatenator
│
├── program.txt # Your assembly code input
└── README.md # Documentation
- RegisterFile.ext: Implements 64 general-purpose registers (R0-R63) and a status register (SREG).
- Memory.ext: Contains instruction memory (1024x16) and data memory (2048x8).
- ProgramCounter.ext: Manages the 16-bit program counter.
- ALU.ext: Performs arithmetic and logic operations, including flag calculations.
- Decoder.ext: Splits instructions into R-Format and I-Format.
- Pipeline.ext: Coordinates the instruction fetch (IF), decode (ID), and execute (EX) stages.
- Parser.ext: Reads the assembly code from
program.txtand concatenates bits for instruction processing.
- Write your assembly code in
program.txt. - Run the project using the entry point
main.ext. - The program will simulate the execution of the assembly code through the hardware and logic components.
- Ensure the assembly code in
program.txtadheres to the expected format. - Modify the components in
/srcas needed to extend functionality.
This project is open-source and available under the MIT License.