GAL22V10.c is a first draft of a simulator for GAL22V10 chips as used in the 6809 Max board I'm assembling. I'm also experimenting with code (maketable.c) to take a set of logic equations and convert them first to sum-of-products form (i.e. suitable for use in a Pla) and also to minimised logic equations, but eventually to a suitable configuration for a GAL22V10 chip that can be written to real hardware.

The GAL22V10 is not a simple Pla - the logic it supports is a bit convoluted. But it is more like a Pla than say a programmable gate array - each output term is basically the 'And' sum of multiple input terms. The output can be optionally inverted and also optionally latched on rising 'Clk'. It's not clear yet if all the input pins can also be optionally inverted - you would hope that was the case but I haven't found it in the documentation yet.