GitXplorerGitXplorer
a

ginger

public
2 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
533b8d168d6f556921980b9719d83321f85d8c95

Version 0.2.7

aand3rson committed a year ago
Unverified
2659ff2a05ab74183767c44ea78c53d3de964aa7

Fix default register state for 22V10 (datasheet page 18, "Power-Up Reset" section)

aand3rson committed a year ago
Verified
eb42ed867c1d57cfeada388c8131997ffd6a86f2

Typo

aand3rson committed a year ago
Verified
a7323f22d990544c28419c42576c8a2e47b8da30

Cleanups

aand3rson committed a year ago
Verified
fec3ea02d75578cd6bbb812bc4781aabc84339a5

Update gfoots pld code

aand3rson committed a year ago
Verified
b3c87c9e140bfb36e4cb1161bd0017aabea4426d

Add inline tests (with syntax similar to comments), set default register values to 1

aand3rson committed a year ago

README

The README file for this repository.

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)
  • Timing diagram generation

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!