forked from hdl/bazel_rules_hdl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
dependency_support/com_google_skywater_pdk/sky130_fd_sc_hd/cell_adders.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |