armulator


Namearmulator JSON
Version 1.1.3 PyPI version JSON
download
home_pagehttps://github.com/matan1008/armulator
SummaryA pure Python ARM processor emulator
upload_time2023-08-08 04:59:03
maintainer
docs_urlNone
authorMatan Perelman
requires_python
licenseMIT
keywords arm emulator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Description

A pure python ARM emulator

# Installation

Install the last released version using `pip`:

```shell
python3 -m pip install --user -U armulator
```


Or install the latest version from sources:

```shell
git clone git@github.com:matan1008/armulator.git
cd pyiosbackup
python3 -m pip install --user -U -e .
```

# Usage

To create a processor object, you need to import it first:
```python
from armulator.armv6.arm_v6 import ArmV6
```

Then you can just create it:

```python
arm = ArmV6()
```
Getting familiar with the Memory controller concept is crucial for using the processor.  
In short, there is one "hub" to which you can connect several controllers.  
A "Memory Controller" can be a stick of RAM, Memory mapped LCD screen or whatever you wish.  
  
For example, let's create a RAM controller:

```python
from armulator.armv6.memory_types import RAM
from armulator.armv6.memory_controller_hub import MemoryController

mem = RAM(0x100)
mc = MemoryController(mem, 0xF0000000, 0xF0000100)
arm.mem.memories.append(mc)
```

Now, trying to access a memory between 0xF0000000 and 0xF0000100, will access the `mem` object.  
You can also change the memory manually:

```python
mem.write(0, 2, "\xfe\xe7")
```

Another useful feature is playing with the memory protection or management unit,
for example cancelling memory protection will look like:
```python
arm.registers.sctlr.m = 0
arm.take_reset()
```
Please note that after changing internal features it is recommended to reset the processor.  
  
When running the armulator, you will probably want to start from a defined address, so:
```python

arm.registers.branch_to(0x100)
```

The last thing we need to do is to really run the processor, which can be done with:
```python
arm.emulate_cycle()
```


# Running the tests

Running the tests can be done easily with pytest:

```shell
python3 -m pytest tests -vv
```

# Acknowledgments

* At first, I did it to learn the ARM architecture better. I guess I was carried away.
* Feel free to report bugs.
* Feel free to ask for more features.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/matan1008/armulator",
    "name": "armulator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "arm emulator",
    "author": "Matan Perelman",
    "author_email": "matan1008@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/9f/c1/cb4f719288c4969dfabc6cce4af7e94523864e84429ec07ea68599044bd4/armulator-1.1.3.tar.gz",
    "platform": null,
    "description": "# Description\n\nA pure python ARM emulator\n\n# Installation\n\nInstall the last released version using `pip`:\n\n```shell\npython3 -m pip install --user -U armulator\n```\n\n\nOr install the latest version from sources:\n\n```shell\ngit clone git@github.com:matan1008/armulator.git\ncd pyiosbackup\npython3 -m pip install --user -U -e .\n```\n\n# Usage\n\nTo create a processor object, you need to import it first:\n```python\nfrom armulator.armv6.arm_v6 import ArmV6\n```\n\nThen you can just create it:\n\n```python\narm = ArmV6()\n```\nGetting familiar with the Memory controller concept is crucial for using the processor.  \nIn short, there is one \"hub\" to which you can connect several controllers.  \nA \"Memory Controller\" can be a stick of RAM, Memory mapped LCD screen or whatever you wish.  \n  \nFor example, let's create a RAM controller:\n\n```python\nfrom armulator.armv6.memory_types import RAM\nfrom armulator.armv6.memory_controller_hub import MemoryController\n\nmem = RAM(0x100)\nmc = MemoryController(mem, 0xF0000000, 0xF0000100)\narm.mem.memories.append(mc)\n```\n\nNow, trying to access a memory between 0xF0000000 and 0xF0000100, will access the `mem` object.  \nYou can also change the memory manually:\n\n```python\nmem.write(0, 2, \"\\xfe\\xe7\")\n```\n\nAnother useful feature is playing with the memory protection or management unit,\nfor example cancelling memory protection will look like:\n```python\narm.registers.sctlr.m = 0\narm.take_reset()\n```\nPlease note that after changing internal features it is recommended to reset the processor.  \n  \nWhen running the armulator, you will probably want to start from a defined address, so:\n```python\n\narm.registers.branch_to(0x100)\n```\n\nThe last thing we need to do is to really run the processor, which can be done with:\n```python\narm.emulate_cycle()\n```\n\n\n# Running the tests\n\nRunning the tests can be done easily with pytest:\n\n```shell\npython3 -m pytest tests -vv\n```\n\n# Acknowledgments\n\n* At first, I did it to learn the ARM architecture better. I guess I was carried away.\n* Feel free to report bugs.\n* Feel free to ask for more features.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A pure Python ARM processor emulator",
    "version": "1.1.3",
    "project_urls": {
        "Homepage": "https://github.com/matan1008/armulator"
    },
    "split_keywords": [
        "arm",
        "emulator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c35b71920ea55726abaf6224dcb1a8232f70aab7009801478fa1be1450fecbe",
                "md5": "581ae50c05ba055d48890f14ff00acbf",
                "sha256": "20933f20eb525c973c4b44f48f9604446530c43a124a79e98c2dd06ab5a49387"
            },
            "downloads": -1,
            "filename": "armulator-1.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "581ae50c05ba055d48890f14ff00acbf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 537372,
            "upload_time": "2023-08-08T04:59:02",
            "upload_time_iso_8601": "2023-08-08T04:59:02.074761Z",
            "url": "https://files.pythonhosted.org/packages/8c/35/b71920ea55726abaf6224dcb1a8232f70aab7009801478fa1be1450fecbe/armulator-1.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9fc1cb4f719288c4969dfabc6cce4af7e94523864e84429ec07ea68599044bd4",
                "md5": "42fd2479c8e192fe229dc41f21e618b8",
                "sha256": "a193f43fb5863d6b65d5d0d2e3b6753cc2b619df4fd2bd15301aa32362f98325"
            },
            "downloads": -1,
            "filename": "armulator-1.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "42fd2479c8e192fe229dc41f21e618b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 122775,
            "upload_time": "2023-08-08T04:59:03",
            "upload_time_iso_8601": "2023-08-08T04:59:03.905681Z",
            "url": "https://files.pythonhosted.org/packages/9f/c1/cb4f719288c4969dfabc6cce4af7e94523864e84429ec07ea68599044bd4/armulator-1.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-08 04:59:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "matan1008",
    "github_project": "armulator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "armulator"
}
        
Elapsed time: 0.15285s