GAL equation solver
Project description
GINGER
Ginger Is Not a GAL EmulatoR
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 to0 1 0 1 11or010111)
Requirements
- Python 3.x
- Lark parser
Features
Supported:
- Combinatorial logic
- Registered logic
- Tri-states
- Automated test-case assertions
- Arbitrary inversion of signals in inputs/outputs/assertions (e. g.
? /RAM=1is 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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ginger-emulator-0.2.7.tar.gz.
File metadata
- Download URL: ginger-emulator-0.2.7.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b0b0120d75cab4c4d3d4e6189336be09adcfaa905d968c19a686b75774341fa
|
|
| MD5 |
9192b51f9ca4c42a2cfa6511476a1d85
|
|
| BLAKE2b-256 |
0efc877791746de8f6bbce029c004f8e9fbbfd4c35815c8df2f5ad1b4767eb36
|
File details
Details for the file ginger_emulator-0.2.7-py3-none-any.whl.
File metadata
- Download URL: ginger_emulator-0.2.7-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c8eeb1840053a496e51df390780c2e79d8e65a9babbeadf0231f07d102a48be
|
|
| MD5 |
44a472720f7f3b37845a6e4faeee14c6
|
|
| BLAKE2b-256 |
70a4f2d2e08482ddfc69263804805ae0a0a2e45060cd555055119d28abb75080
|