Skip to content

Commit

Permalink
SKY130_FD_SC_HD: Add fa/ha mapping
Browse files Browse the repository at this point in the history
This commit adds fa_ha_mapping file to
the Skywater sky130 fd_sc_hd PDK.

Signed-off-by: Maciej Dudek <[email protected]>
  • Loading branch information
mtdudek committed Dec 20, 2023
1 parent 6f65f14 commit 7c6b657
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ open_road_pdk_configuration(
],
wire_rc_clock_metal_layer = "met5",
wire_rc_signal_metal_layer = "met2",
ha_fa_mapping = "cell_adders.v"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// File copy form OpenRAOD-flow-scripts@dd552435616bcc18fb2dba0b221f682d9e873fb1
// Works only with sky130_fd_sc_hd
(* techmap_celltype = "$fa" *)
module _tech_fa (A, B, C, X, Y);
parameter WIDTH = 1;
(* force_downto *)
input [WIDTH-1 : 0] A, B, C;
(* force_downto *)
output [WIDTH-1 : 0] X, Y;

parameter _TECHMAP_CONSTVAL_A_ = WIDTH'bx;
parameter _TECHMAP_CONSTVAL_B_ = WIDTH'bx;
parameter _TECHMAP_CONSTVAL_C_ = WIDTH'bx;

genvar i;
generate for (i = 0; i < WIDTH; i = i + 1) begin
if (_TECHMAP_CONSTVAL_A_[i] === 1'b0 || _TECHMAP_CONSTVAL_B_[i] === 1'b0 || _TECHMAP_CONSTVAL_C_[i] === 1'b0) begin
if (_TECHMAP_CONSTVAL_C_[i] === 1'b0) begin
sky130_fd_sc_hd__ha_1 halfadder_Cconst (
.A(A[i]),
.B(B[i]),
.COUT(X[i]), .SUM(Y[i])
);
end
else begin
if (_TECHMAP_CONSTVAL_B_[i] === 1'b0) begin
sky130_fd_sc_hd__ha_1 halfadder_Bconst (
.A(A[i]),
.B(C[i]),
.COUT(X[i]), .SUM(Y[i])
);
end
else begin
sky130_fd_sc_hd__ha_1 halfadder_Aconst (
.A(B[i]),
.B(C[i]),
.COUT(X[i]), .SUM(Y[i])
);
end
end
end
else begin
sky130_fd_sc_hd__fa_1 fulladder (
.A(A[i]), .B(B[i]), .CIN(C[i]), .COUT(X[i]), .SUM(Y[i])
);
end
end endgenerate

endmodule

0 comments on commit 7c6b657

Please sign in to comment.