This project provides an automated testing framework to evaluate the correctness of student-written Assembler and Simulator implementations. The tests are categorized into simple and hard levels and are conducted independently for the assembler and simulator modules.
Assembler\_Simulator/
โโโ SimpleAssembler/
โ โโโ Assembler.py # Your assembler implementation
โโโ SimpleSimulator/
โ โโโ Simulator.py # Your simulator implementation
โโโ tests/
โ โโโ assembly/
โ โ โโโ simpleBin/ # Input assembly codes (simple)
โ โ โโโ hardBin/ # Input assembly codes (hard)
โ โ โโโ errorGen/ # Malformed input codes
โ โ โโโ bin\_s/ # Reference machine code (for simpleBin)
โ โ โโโ bin\_h/ # Reference machine code (for hardBin)
โ โ โโโ user\_bin\_s/ # Student-generated machine code (simple)
โ โ โโโ user\_bin\_h/ # Student-generated machine code (hard)
โ โโโ bin/ # Student-generated simulator trace output
โ โโโ traces/ # Reference simulator traces
โโโ automatedTesting/
โโโ readme.txt
โโโ src/
โโโ main.py # Testing driver script
Type | Count | Weight per Test |
---|---|---|
Simple | 10 | 0.1 |
Hard | 5 | 0.2 |
Type | Count | Weight per Test |
---|---|---|
Simple | 5 | 0.4 |
Hard | 5 | 0.8 |
Your assembler should take an input assembly code file and produce the corresponding machine code file.
Command Format:
$ python3 Assembler.py <input_assembly_path> <output_machine_code_path>
Steps:
- Rename your assembler file to
Assembler.py
. - Place it inside the
SimpleAssembler/
folder.
Run Tests:
-
Linux:
$ python3 src/main.py --no-sim --linux
-
Windows:
> python3 src\main.py --no-sim --windows
Your simulator should take an input machine code file and produce an execution trace file.
Command Format:
$ python3 Simulator.py <input_machine_code_path> <output_trace_path>
Steps:
- Rename your simulator file to
Simulator.py
. - Place it inside the
SimpleSimulator/
folder.
Run Tests:
-
Linux:
$ python3 src/main.py --no-asm --linux
-
Windows:
> python3 src\main.py --no-asm --windows
- All input/output files must use
.txt
extensions. - This framework is intended for Python 3.x users only.
- Ensure that your program strictly follows I/O formatting rules.
This framework is for educational testing purposes only. Test cases are structured to encourage modularity and robustness in assembler and simulator implementations.