From 7d560698ac1fde66d711431b125a54a11e9e5b1d Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Mon, 7 Apr 2025 13:16:49 +0200 Subject: [PATCH] techmap: map $alu to $fa instead of relying on extract_fa --- techlibs/common/techmap.v | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/techlibs/common/techmap.v b/techlibs/common/techmap.v index fdf11904b..d40f54cd6 100644 --- a/techlibs/common/techmap.v +++ b/techlibs/common/techmap.v @@ -283,9 +283,16 @@ module _90_alu (A, B, CI, BI, X, Y, CO); \$pos #(.A_SIGNED(A_SIGNED), .A_WIDTH(A_WIDTH), .Y_WIDTH(Y_WIDTH)) A_conv (.A(A), .Y(A_buf)); \$pos #(.A_SIGNED(B_SIGNED), .A_WIDTH(B_WIDTH), .Y_WIDTH(Y_WIDTH)) B_conv (.A(B), .Y(B_buf)); - \$lcu #(.WIDTH(Y_WIDTH)) lcu (.P(X), .G(AA & BB), .CI(CI), .CO(CO)); + (* force_downto *) + wire [Y_WIDTH-1:0] P; + wire [Y_WIDTH-1:0] G; + wire [Y_WIDTH-1:0] Cnull; + assign Cnull = 1'b0; - assign X = AA ^ BB; + \$fa #(.WIDTH(Y_WIDTH)) fa (.A(AA), .B(BB), .C(Cnull), .X(G), .Y(P)); + \$lcu #(.WIDTH(Y_WIDTH)) lcu (.P(P), .G(G), .CI(CI), .CO(CO)); + + assign X = P; assign Y = X ^ {CO, CI}; endmodule