Skip to content

saksham23467/Assember-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Assembler and Simulator Testing Framework

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.


๐Ÿงพ Directory Structure


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


๐Ÿงช Test Cases Breakdown

Assembler

Type Count Weight per Test
Simple 10 0.1
Hard 5 0.2

Simulator

Type Count Weight per Test
Simple 5 0.4
Hard 5 0.8

โš™๏ธ How to Use

๐Ÿ”ง Assembler

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:

  1. Rename your assembler file to Assembler.py.
  2. Place it inside the SimpleAssembler/ folder.

Run Tests:

  • Linux:

    $ python3 src/main.py --no-sim --linux
  • Windows:

    > python3 src\main.py --no-sim --windows

๐Ÿงฎ Simulator

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:

  1. Rename your simulator file to Simulator.py.
  2. Place it inside the SimpleSimulator/ folder.

Run Tests:

  • Linux:

    $ python3 src/main.py --no-asm --linux
  • Windows:

    > python3 src\main.py --no-asm --windows

๐Ÿ’ก Notes

  • 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.

๐Ÿ“Œ Disclaimer

This framework is for educational testing purposes only. Test cases are structured to encourage modularity and robustness in assembler and simulator implementations.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages