simon-frankau / galette

A GAL assembler, largely galasm-compatible and written in Rust.
MIT License
111 stars 23 forks source link

Unexpected inversion when using inverted registered outputs #12

Open and3rson opened 10 months ago

and3rson commented 10 months ago

I've originally posted this issue in GALasm repo (https://github.com/daveho/GALasm/issues/16#issuecomment-1826430269), but I can also reproduce this behavior in galette.

TL;DR: Consider the following equations:

/Q1.R = A * B
Q2.R = Q1

When assembled with galasm (or galette) and then disassembled with jed2eqn, I get the following equations:

/Q1 := A * B
Q2 := /Q1

This seems completely wrong, since Q2 clearly should be equal to Q1. Any thoughts?

and3rson commented 10 months ago

FYI - GALasm maintainers confirmed that this is indeed a bug (see link in the previous post.)

simon-frankau commented 7 months ago

Hi. Sorry for not getting back to you earlier - I was off github for a while.

I'm slightly nervous about changing the behaviour if anyone's relying on it, even if it's wrong, but given that galasm has applied a fix, I reckon I can change this behaviour without worrying about breaking bug compatibility.

I will fix this when I have a moment.

Thanks!

simon-frankau commented 7 months ago

I believe this should now be fixed in https://github.com/simon-frankau/galette/commit/b1be5aed90112418ae1af69267c888bcdc2d2d38 . If you have a moment to take a look, I'd appreciate it. If you see any issues, please do let me know. Cheers.