{"id":15060542,"url":"https://github.com/aanastasiou/dgtools","last_synced_at":"2025-04-10T06:11:28.491Z","repository":{"id":45615821,"uuid":"245889394","full_name":"aanastasiou/dgtools","owner":"aanastasiou","description":"A toolchain for constrained CPUs","archived":false,"fork":false,"pushed_at":"2023-03-26T09:18:42.000Z","size":9197,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T16:50:33.642Z","etag":null,"topics":["assembler","compiler-principles","compilers","hardware","python","simulation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aanastasiou.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-08T21:16:49.000Z","updated_at":"2022-02-01T21:25:14.000Z","dependencies_parsed_at":"2024-10-12T21:00:59.075Z","dependency_job_id":"02f857ae-c371-436a-a3c4-25ae6207fca4","html_url":"https://github.com/aanastasiou/dgtools","commit_stats":{"total_commits":243,"total_committers":2,"mean_commits":121.5,"dds":0.004115226337448541,"last_synced_commit":"20866008edfac35e11018662e9c99c35ba22014c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aanastasiou%2Fdgtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aanastasiou%2Fdgtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aanastasiou%2Fdgtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aanastasiou%2Fdgtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aanastasiou","download_url":"https://codeload.github.com/aanastasiou/dgtools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assembler","compiler-principles","compilers","hardware","python","simulation"],"created_at":"2024-09-24T23:00:12.766Z","updated_at":"2025-04-10T06:11:28.468Z","avatar_url":"https://github.com/aanastasiou.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://dgtools.readthedocs.io/en/latest/_images/full_banner_dg.png)\n\n# dgtools\n\ndgtools is a complete toolkit for developing software for the [Digirule](https://bradsprojects.com/digirule2/) \nseries (`2A/2U`) of hardware by [bradsprojects](https://bradsprojects.com).\n\n## Overview\n\n1. `dgasm`\n\n   * The assembler, accepts a human readable `.asm` text file with Digirule ASM and \n     produces:\n       1. A `.dgb` binary file with compiled code ready for simulation by `dgsim.py` .\n       2. A `.hex` file (in the case of 2U) to be downloaded to the board.\n   \n2. `dginspect`\n\n   * The binary file \"inspector\", accepts a `.dgb` binary file and produces a human readable \n     \"dump\" of the full 256 byte memory range to stdout. It also allows a user to apply certain \n     modifications to the memory space without re-compiling.\n   \n3. `dgsim`\n\n   * The Digirule Virtual Machine, accepts a `.dgb` binary file and produces:\n       1. A human readable HTML (themeable) trace of every state change the CPU goes through at each \n          timestep of execution.\n       2. An additional `.dgb` file that contains the final state of the memory space at the end of \n          program execution.\n               \nThese tools work together to write, debug and simulate code for the Digirule 2 prior to transfering it to the \nactual hardware. \n\n`dgtools` also includes some \"extras\", such as:\n\n1. A Sublime text `.dsf` ASM plugin, \n2. A console gui (`dgui.py`) that can handle compilation/simulation in one step \n3. A code formatter (`dgform.py`), to pretty print source code.\n4. [Brainfuck](https://esolangs.org/wiki/Brainfuck) and [Super Stack!](https://esolangs.org/wiki/Super_Stack!) compilers for the Digirule 2U.\n\nThe most common workflow is to:\n\n1. Use a text editor to write human readable assembly code.\n2. Call `dgasm.py` to compile the binary\n3. Call `dgsim.py` to run and debug the binary\n4. *(Alternatively, call `dgui` to perform both of the above in sequence)*\n5. Use `dginspect.py` to check a binary file, get/set values from the virtual machine or key the code in.\n\n\n## Installation\n\n### Pre-requisites\n\n1. Linux\n2. Python \u003e=3.6\n3. [`virtualenv`](https://pypi.org/project/virtualenv/)\n\n\n### Install from PyPi with pip\n\n* `pip install dgtools`\n\n\n### Install latest development version  \n\n1. Checkout the dgtools repository\n2. `\u003e virtualenv -p python3.8 pyenv`\n3. `\u003e source pyenv/bin/activate`\n4. To start using `dgtools`:\n     * `pip install -e ./` (From within the `dgtools/` directory that contains the `setup.py` file)\n     * This will make the `dgtools` scripts callable from any position in the filesystem, as long as the \n       `pyenv` virtual environment is activated.\n5. If you are interested in developing `dgtools` further: \n     * `pip install -r requirements.txt`\n\n\n## Where to from here?\n\n``dgtools`` documentation is up on [ReadTheDocs](https://dgtools.readthedocs.io/en/latest/) and of course\nin ``doc/``.\n\nPractical examples of how to use `dgtools` are available in \n[this introductory walkthrough](https://dgtools.readthedocs.io/en/latest/introductory_topics.html).\n\nOnce you familiarise yourself with the tools and Digirule's ASM, you might want to move to \n[the advanced walkthrough](https://dgtools.readthedocs.io/en/latest/advanced_topics.html) or \ncheck out other [programming examples](https://dgtools.readthedocs.io/en/latest/code_projects.html) \nin `dg_asm_eamples/`.\n\n## dgrdo.org\n\nThe ASM toolchain along with the brainfuck and Super Stack! compilers is available online at https://www.dgrdo.org. \nFor more information see [this introduction on its functionality](https://www.dgrdo.org/static/info/about/index.html)\n\nEnjoy!\n\nAthanasios Anastasiou\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faanastasiou%2Fdgtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faanastasiou%2Fdgtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faanastasiou%2Fdgtools/lists"}