I have a decoder defined in verilog as:
module my_decoder(
input [3:0] in,
output reg[19:0] out
);
always@(*) begin
case (in)
4'd0: out= 20'd114912;
4'd1: out= 20'd114912;
4'd2: out= 20'd180324;
4'd3: out= 20'd409644;
4'd4: out= 20'd917535;
4'd5: out= 20'd395532;
4'd6: out= 20'd137988;
4'd7: out= 20'd16128;
4'd8: out= 20'd16128;
4'd9: out= 20'd16128;
4'd10: out= 20'd137988;
4'd11: out= 20'd395532;
4'd12: out= 20'd917535;
4'd13: out= 20'd409644;
4'd14: out= 20'd180324;
4'd15: out= 20'd114912;
endcase
end
endmodule
Now, I want this to be implemented using only logical, standard cells (namely AND, OR, NAND, XOR and NOT). So far I have tried three unsuccessful approaches:
POS/SOP form functions from sympy module (unsuccessful because only AND, OR and NOT is used)
Vivado synthesis (unsuccessful because the design is synthesized using only look up tables).
yosys open source synthesizer (unsuccessful because, apparently, I should write a "toy" .lib file with the physical descriptions of the cells I want to use, which I find to be too much work for what I want to achieve).
Is there a better approach to this problem (or some hack on one of the previous)?
Edit to clarify things, as @Fra93 comment suggests that I have not explain myself well. Some of the results from sympy's SOP are these:
out[0] = in[2] AND (NOT in[3])
out[1] = (in[1] OR in[2]) AND (in[2] OR in[3]) AND (NOT in[1] OR NOT in[2] OR NOT in[3])
... and this just gets more and more complicated. What I want is to tell the tool (or find a tool I can tell it to) to also use NAND and XOR gates, as this will probably simplify the expressions.