Skip to content

Conversation

@matthew-james-brewer
Copy link

I made a script that takes the linear list of logic gates and combines them when necessary.

For example:

    ...
    cell g = in_6 & in_1;
    ...
    cell h = in_7 & in_1;
    ...
    cell y = g | h;
    ...
    cell cu = cc | h;
    ...

becomes:

    ...
    cell h = in_7 & in_1;
    ...
    cell y = (in_6 & in_1) | h;
    ...

In other words, it consolidates the gates.


Unfortunately, the script is fragile and would break if anything major got restructured in gate.c's generated portion.

However, it offers some insight. For example, it was easy to find ~(~(...)) in the code using this. Also: ... | (0), which also does nothing. Of course, the compiler should remove those, but it's interesting to see.

Note - this is my first pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant