█████╗ ██████╗ ███╗ ███╗ ██╗ ███████╗ ██████╗ ██╔══██╗██╔══██╗████╗ ████║ ██║ ██╔════╝██╔════╝ ███████║██████╔╝██╔████╔██║█████╗██║ █████╗ ██║ ███╗ ██╔══██║██╔══██╗██║╚██╔╝██║╚════╝██║ ██╔══╝ ██║ ██║ ██║ ██║██║ ██║██║ ╚═╝ ██║ ███████╗███████╗╚██████╔╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚══════╝ ╚═════╝
python pseudo-ARM program simulator
.
├── arm_leg/
│ ├── components/
│ │ ├── cpu.py
│ │ ├── data_memory.py
│ │ └── register_file.py
│ ├── instructions/
│ │ ├── b_format.py
│ │ ├── cb_format.py
│ │ ├── d_format.py
│ │ ├── i_format.py
│ │ ├── instruction.py
│ │ ├── nop.py
│ │ ├── opcodes.py
│ │ └── r_format.py
│ ├── __init__.py
│ ├── main.py
│ └── utils.py
├── tests/
│ ├── test_arithmetic_operations.py
│ ├── test_branching.py
│ ├── test_load_store.py
│ └── test_parsing_instructions.py
├── .gitignore
├── conftest.py
├── instruction_documentation.md
├── LICENSE
├── readme.md
└── requirements.txt
⚠️ This program requirespython >=3.10
.
Clone the repository
git clone https://github.com/DarkHawk727/ARM-LEG-Simulator/
then install the dependencies
pip install -r requirements.txt
ℹ️ For information about how to write your pseudo-ARM programs, see the Instruction Documentation.
ARM-LEG -f "some/folder/example.txt" -p ["BOTH" | "MEM" | "REG"] -m 1000
(you can use --help
to display this in the command line)
The print option will either display the contents of the memory, the registers, or both for each iteration of the pseudo-ARM program; this means that the outputs can get quite long.
The -m
option will set a max-iterations count so that in the case of an infinite loop, the program does terminate.
(you can redirect the outputs to a textfile using standard output redirection)
Doesn't support X31 immutability.- Doesn't support X31 aliasing with XZR.
- Doesn't support comments?
Need to add tests for all instructions- Programs must be at most 31 instructions long (Just 31 stores or smth) since they are stored in the registers (need to move them to memory)
Cannot parseXOR
due to howtokenize()
works.
- Pipelining? This model of computation isn’t strictly required but could be useful for simulation purposes
- Stalls
- Flushes
- Branch Prediction
- Code rearrangement?
- Control unit with its signals
- Having a diagram like in Markdeep to show the value of various components in the datapath.
- Set-Associative and Direct-Mapped Caches?
- Adding the binary number (highlighted by field) for each instruction
- Fork it
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request.