Skip to content

kellertk/galette

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

220 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Galette: A GAL assembler for the 21st Century

Galette is a GALasm-compatible GAL assembler that takes a set of equations, and generates a JEDEC file suitable for feeding to a GAL programmer.

This is an updated fork of simon-frankau/galette, published as galette-tk.

Usage

The input file format is a slightly relaxed modified of the GALasm format. Differences include:

  • The "DESCRIPTION" section at the end of the .pld file is now optional.
  • You don't actually need to include any equations at all! All outputs are undriven.
  • You can use long pins names, and the only downside is it makes the output files lose alignment.
  • Tristate enables etc. no longer need to be defined after the main output definition (as long as that definition is present somewhere).
  • Equations must start after a newline, but continuation lines are now supported.
  • The list of pins must be split equally across two lines, not just listed in freeform.

galette --help gives you a summary of the (GALasm-compatible) command-line options.

Example

The files in testcases/success provide examples of appropriately-formatted input. For example, you can copy of of the files into the current directory and assemble it:

cp testcases/success/GAL16V8_combinatorial.pld ./example.pld
cargo run ./example.pld

The resulting example.jed file should be usable by your favourite PAL programmer (I have had success with a MiniPro TL866).

More docs

For more docs, refer to galasm's documentation. They are not included here due to licensing issues.

Background

Hobbists sill use programmable logic devices, but most of the tools are old, abandoned, or questionably licensed. This project is a fork of simon-frankau/galette, which is/was an attempt to produce a GALasm-compatible assembler in Rust. This fork is a continuation of that project with a some features added.

GALasm was a turn-of-the-century update of GALer, an early '90s open source GAL assembler for the Amiga. It's written in C and the style is from another era.

Source organisation

Running from the lowest layer of dependency to the highest, we have:

  • errors.rs Error codes used by everything else.
  • chips.rs An abstraction layer over the different GAL types.
  • gal.rs Contains the GAL structure with is programmed with fuse data.
  • parser.rs Parse the input file format.
  • blueprint.rs Convert input to a normalised form to build fuses from.
  • gal_builder.rs Fills in a GAL structure based on a blueprint.
  • writer.rs Writes out the generated GAL structure.
  • lib.rs Top-level glue.
  • main.rs Thin command-line wrapper.

Tests

The integration tests can be run with the usual cargo test. Coverage can be measured with cargo llvm-cov.

There are no formal unit tests. Instead, the package is tested end-to-end against a set of input files with known-good output.

Licensing

Like the upstream project, this is released under the MIT license.

The authors are indebted to Alessandro Zummo and Christian Habermann for the starting point of galasm, and to Simon Frankau for galette.

About

A GAL assembler, largely galasm-compatible and written in Rust.

Resources

License

Stars

Watchers

Forks

Contributors

Languages

  • Rust 100.0%