0

I am wondering if it is possible to use Yosys in simplifying logic equations.

For example:

module top
(
    output [31:0] cipher,
    input  [31:0] plain,
    input  [63:0] key
);

    wire tmp = key[31:0];
    wire tmp2 = key[63:32] & 0;

    assign cipher = (tmp & plain) | tmp2;

endmodule

When I use the command "show" it plots the circuit: enter image description here

I tried using "opt" and "freduce" commands but it did not reduce the equation.

1 Answer 1

1

You probably want to use opt -fine which does finer-grain optimisations rather than optimising whole words at a time. This gives a single 1-bit $and gate as expected.

Alternatively techmap; abc will produce an optimised gate-level circuit.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.