Skip to main content

An assembler and simulation toolchain for the Digirule2 series of hardware.

Project description

dgtools

dgtools is a complete toolkit for developing software for the Digirule series (2A/2U) of hardware by bradsprojects.

Overview

  1. dgasm

    • The assembler, accepts a human readable .asm text file with Digirule ASM and produces:
      1. A .dgb binary file with compiled code ready for simulation by dgsim.py .
      2. A .hex file (in the case of 2U) to be downloaded to the board.
  2. dginspect

    • The binary file "inspector", accepts a .dgb binary file and produces a human readable "dump" of the full 256 byte memory range to stdout. It also allows a user to apply certain modifications to the memory space without re-compiling.
  3. dgsim

    • The Digirule Virtual Machine, accepts a .dgb binary file and produces:
      1. A human readable HTML (themeable) trace of every state change the CPU goes through at each timestep of execution.
      2. An additional .dgb file that contains the final state of the memory space at the end of program execution.

These tools work together to write, debug and simulate code for the Digirule 2 prior to transfering it to the actual hardware.

dgtools also includes some "extras", such as a Sublime text .dsf ASM plugin, a console gui (dgui) that can handle compilation/simulation in one step and a code formatter (dgform).

The most common workflow is to:

  1. Use a text editor to write human readable assembly code.
  2. Call dgasm.py to compile the binary
  3. Call dgsim.py to run and debug the binary
  4. (Alternatively, call dgui to perform both of the above in sequence)
  5. Use dginspect.py to check a binary file, get/set values from the virtual machine or key the code in.

Installation

Pre-requisites

  1. Linux
  2. Python >3.6
  3. virtualenv

Process

  1. Download the code from the repository
  2. > virtualenv -p python3.8 pyenv
  3. > source pyenv/bin/activate
  4. To start using dgtools:
    • pip install -e ./ (From within the dgtools/ directory that contains the setup.py file)
    • This will make the dgtools scripts callable from any position in the filesystem, as long as the virtual environment is activated.
  5. If you are interested in developing dgtools further:
    • pip install -r requirements.txt

Where to from here?

dgtools documentation is up on ReadTheDocs and of course in doc/.

Practical examples of how to use dgtools are available in this introductory walkthrough.

Once you familiarise yourself with the tools and Digirule's ASM, you might want to move to the advanced walkthrough or check out other programming examples in dg_asm_eamples/.

Enjoy!

Athanasios Anastasiou

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dgtools-1.0.0.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

dgtools-1.0.0-py3-none-any.whl (54.8 kB view details)

Uploaded Python 3

File details

Details for the file dgtools-1.0.0.tar.gz.

File metadata

  • Download URL: dgtools-1.0.0.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2

File hashes

Hashes for dgtools-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c9399a7ec3752c58710c021955a20d121a504c147640381effaf1f31075c53f5
MD5 89da59585ecb9f325919785adb626928
BLAKE2b-256 bbc4f3de977ba8f8ff7695e8d4e59724212cbfce803b13f926bebb594bf56e42

See more details on using hashes here.

File details

Details for the file dgtools-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dgtools-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 54.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2

File hashes

Hashes for dgtools-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3eb7244b1cbf6a4ddf3c3ffa2289688d7c44e2635e7324ba7de68349bd837255
MD5 747a86d1cccc91a3e57bd276cb58520e
BLAKE2b-256 b4976364c7c846ef63384c60f8c8575424d3946470cb448e12418cc0e1b87ef4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page