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.
Merge pull request hdl#253 from antmicro/52551-adder_mapping_pass
Synthesis: Add fa/ha extract and techmap pass
- Loading branch information
Showing
19 changed files
with
262 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 |
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
56 changes: 56 additions & 0 deletions
56
dependency_support/org_theopenroadproject_asap7_pdk_r1p7/cell_adders_L.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,56 @@ | ||
// File copy form | ||
// OpenRAOD-flow-scripts@dd552435616bcc18fb2dba0b221f682d9e873fb1 | ||
// Only works with asap7 L cell library | ||
(* 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; | ||
|
||
wire [WIDTH-1 : 0] NX, NY; | ||
|
||
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 | ||
HAxp5_ASAP7_75t_L halfadder_Cconst ( | ||
.A(A[i]), | ||
.B(B[i]), | ||
.CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
else begin | ||
if (_TECHMAP_CONSTVAL_B_[i] === 1'b0) begin | ||
HAxp5_ASAP7_75t_L halfadder_Bconst ( | ||
.A(A[i]), | ||
.B(C[i]), | ||
.CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
else begin | ||
HAxp5_ASAP7_75t_L halfadder_Aconst ( | ||
.A(B[i]), | ||
.B(C[i]), | ||
.CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
end | ||
end | ||
else begin | ||
FAx1_ASAP7_75t_L fulladder ( | ||
.A(A[i]), .B(B[i]), .CI(C[i]), .CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
|
||
assign X[i] = ~NX[i]; | ||
assign Y[i] = ~NY[i]; | ||
|
||
end endgenerate | ||
|
||
endmodule |
56 changes: 56 additions & 0 deletions
56
dependency_support/org_theopenroadproject_asap7_pdk_r1p7/cell_adders_R.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,56 @@ | ||
// File copy form | ||
// OpenRAOD-flow-scripts@dd552435616bcc18fb2dba0b221f682d9e873fb1 | ||
// Only works with asap7 R cell library | ||
(* 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; | ||
|
||
wire [WIDTH-1 : 0] NX, NY; | ||
|
||
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 | ||
HAxp5_ASAP7_75t_R halfadder_Cconst ( | ||
.A(A[i]), | ||
.B(B[i]), | ||
.CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
else begin | ||
if (_TECHMAP_CONSTVAL_B_[i] === 1'b0) begin | ||
HAxp5_ASAP7_75t_R halfadder_Bconst ( | ||
.A(A[i]), | ||
.B(C[i]), | ||
.CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
else begin | ||
HAxp5_ASAP7_75t_R halfadder_Aconst ( | ||
.A(B[i]), | ||
.B(C[i]), | ||
.CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
end | ||
end | ||
else begin | ||
FAx1_ASAP7_75t_R fulladder ( | ||
.A(A[i]), .B(B[i]), .CI(C[i]), .CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
|
||
assign X[i] = ~NX[i]; | ||
assign Y[i] = ~NY[i]; | ||
|
||
end endgenerate | ||
|
||
endmodule |
56 changes: 56 additions & 0 deletions
56
dependency_support/org_theopenroadproject_asap7_pdk_r1p7/cell_adders_SL.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,56 @@ | ||
// File copy form | ||
// OpenRAOD-flow-scripts@dd552435616bcc18fb2dba0b221f682d9e873fb1 | ||
// Only works with asap7 R cell library | ||
(* 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; | ||
|
||
wire [WIDTH-1 : 0] NX, NY; | ||
|
||
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 | ||
HAxp5_ASAP7_75t_SL halfadder_Cconst ( | ||
.A(A[i]), | ||
.B(B[i]), | ||
.CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
else begin | ||
if (_TECHMAP_CONSTVAL_B_[i] === 1'b0) begin | ||
HAxp5_ASAP7_75t_SL halfadder_Bconst ( | ||
.A(A[i]), | ||
.B(C[i]), | ||
.CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
else begin | ||
HAxp5_ASAP7_75t_SL halfadder_Aconst ( | ||
.A(B[i]), | ||
.B(C[i]), | ||
.CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
end | ||
end | ||
else begin | ||
FAx1_ASAP7_75t_SL fulladder ( | ||
.A(A[i]), .B(B[i]), .CI(C[i]), .CON(NX[i]), .SN(NY[i]) | ||
); | ||
end | ||
|
||
assign X[i] = ~NX[i]; | ||
assign Y[i] = ~NY[i]; | ||
|
||
end endgenerate | ||
|
||
endmodule |
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.