Skip to main content

GAL equation solver

Project description

GINGER

Ginger Is Not a GAL EmulatoR

Image

So what is this then?

This is a tool that reads GAL .pld files and uses .vec files to solve equation. Some may call this an emulator, but it is not: it's just an equation solver that feels like it's "emulating" a real GAL.

Quick start

pip install ginger-emulator
ginger ./sample/addr.pld ./sample/addr.vec

Please see sample GAL code and corresponding vector file.

Rules on writing .vec files:

  • Lines that start with @ are test case names.

    E.g. @ Test various stuff

  • Lines that start with < list signals that you want to input (each following line needs to set those signals high or low).

    E.g. < A15 A14 A13 A12 /RD /WR

  • Lines that start with > list signals that you want to display after every step.

    E.g. > /ROM /RAM /IO

  • Lines that start with ? are test case assertions, they should contain key-value pairs for your tests. Ginger will exit with non-zero code if any test fails.

    E.g. ? /ROM=1 /RAM=0 /IO=1

  • Comments start with #. If a comment is added after a vector, it will be printed during run.

  • Empty lines are ignored.

  • All other non-empty lines are vectors. Whitespaces are ignored and can be added only for visual clarity.

    E.g. 0101 1 1 (equivalent to 0 1 0 1 11 or 010111)

Requirements

Features

Supported:

  • Combinatorial logic
  • Registered logic
  • Tri-states
  • Automated test-case assertions
  • Arbitrary inversion of signals in inputs/outputs/assertions (e. g. ? /RAM=1 is equivalent to ? RAM=0)

Not supported (yet?):

  • Output enable (ignored)
  • Validation of inputs/outputs

Perks:

  • Vim syntax highlight file can be found here.

Disclaimer & some technical warnings

This tool does not guarantee that the assembled .pld code will behave in the same way on a real GAL. Additionally, it does not guarantee that the .pld file is a valid assembly (e. g. it does not validate if user is trying to use input pins as outputs, term limit, etc, and and will allow the user to do all sorts of silly stuff).

Ginger is using Lark for parsing .pld grammar and only validates the syntax, not the semantics.

So please use, say, galasm to assembled the .pld file first in order to see if it can be used to program a GAL in the first place, and then feel free to use Ginger!

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

ginger-emulator-0.2.4.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

ginger_emulator-0.2.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file ginger-emulator-0.2.4.tar.gz.

File metadata

  • Download URL: ginger-emulator-0.2.4.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for ginger-emulator-0.2.4.tar.gz
Algorithm Hash digest
SHA256 89e454dc8170ee6bdb40af2f4bfc0f1d2683ced07a7caef65895e6e24050d715
MD5 d868b602516784388d3fc06d38a8b95d
BLAKE2b-256 4c9f2e6556e820c1fb9f230beb17d16a731518098d2f2bd2479747a4c3020d72

See more details on using hashes here.

File details

Details for the file ginger_emulator-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for ginger_emulator-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c70035b7baef1cc26a87e338264333b32daefc7b2fd20a3b7b249fe1a2c86918
MD5 b97518be787a956493a53bc179786657
BLAKE2b-256 0588fa3a8fee2075e56b83b3ed656a168e465af5ac165487f730a9dbef0d4d37

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