mirror of
https://github.com/YosysHQ/yosys
synced 2026-07-12 02:06:22 +00:00
fabulous: add --cells-map option
Signed-off-by: Leo Moser <leomoser99@gmail.com>
This commit is contained in:
parent
4fac567673
commit
655cb40d0f
3 changed files with 13 additions and 3 deletions
|
|
@ -30,5 +30,4 @@ yosys_pass(synth_fabulous
|
|||
DATA_DIR
|
||||
fabulous
|
||||
DATA_FILES
|
||||
cells_map.v
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
module \$lut (A, Y);
|
||||
parameter WIDTH = 0;
|
||||
parameter LUT = 0;
|
||||
|
||||
input [WIDTH-1:0] A;
|
||||
output Y;
|
||||
|
||||
generate
|
||||
if (WIDTH == 1) begin
|
||||
LUT1 #(.INIT(LUT)) _TECHMAP_REPLACE_ (.O(Y), .I0(A[0]));
|
||||
end else
|
||||
if (WIDTH == 2) begin
|
||||
LUT2 #(.INIT(LUT)) _TECHMAP_REPLACE_ (.O(Y), .I0(A[0]), .I1(A[1]));
|
||||
end else
|
||||
if (WIDTH == 3) begin
|
||||
LUT3 #(.INIT(LUT)) _TECHMAP_REPLACE_ (.O(Y), .I0(A[0]), .I1(A[1]), .I2(A[2]));
|
||||
end else
|
||||
if (WIDTH == 4) begin
|
||||
LUT4 #(.INIT(LUT)) _TECHMAP_REPLACE_ (.O(Y), .I0(A[0]), .I1(A[1]), .I2(A[2]), .I3(A[3]));
|
||||
end else
|
||||
if (WIDTH == 5) begin
|
||||
LUT5 #(.INIT(LUT)) _TECHMAP_REPLACE_ (.O(Y), .I0(A[0]), .I1(A[1]), .I2(A[2]), .I3(A[3]), .I4(A[4]));
|
||||
end else
|
||||
if (WIDTH == 6) begin
|
||||
LUT6 #(.INIT(LUT)) _TECHMAP_REPLACE_ (.O(Y), .I0(A[0]), .I1(A[1]), .I2(A[2]), .I3(A[3]), .I4(A[4]), .I5(A[5]));
|
||||
end else begin
|
||||
wire _TECHMAP_FAIL_ = 1;
|
||||
end
|
||||
endgenerate
|
||||
endmodule
|
||||
|
|
@ -57,6 +57,9 @@ struct SynthPass : public ScriptPass {
|
|||
log(" -ff <cell_type_pattern> <init_values>\n");
|
||||
log(" convert FFs to cell types via dfflegalize (can be specified multiple times).\n");
|
||||
log("\n");
|
||||
log(" -cells-map <cells_map>\n");
|
||||
log(" map luts to corresponding cells.\n");
|
||||
log("\n");
|
||||
log(" -arith-map <arith_map>\n");
|
||||
log(" mapping file for arithmetic operations.\n");
|
||||
log("\n");
|
||||
|
|
@ -117,7 +120,7 @@ struct SynthPass : public ScriptPass {
|
|||
log("\n");
|
||||
}
|
||||
|
||||
string top_module, json_file, blif_file, fsm_opts, memory_opts, carry_mode, arith_map, clkbuf_map, multiplier_map;
|
||||
string top_module, json_file, blif_file, fsm_opts, memory_opts, carry_mode, cells_map, arith_map, clkbuf_map, multiplier_map;
|
||||
std::vector<string> extra_plib, extra_map, extra_mlibmap;
|
||||
std::vector<std::pair<string, string>> extra_ffs;
|
||||
|
||||
|
|
@ -183,6 +186,10 @@ struct SynthPass : public ScriptPass {
|
|||
extra_ffs.push_back({cell, init});
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-cells-map" && argidx + 1 < args.size()) {
|
||||
cells_map = args[++argidx];
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-arith-map" && argidx + 1 < args.size()) {
|
||||
arith_map = args[++argidx];
|
||||
continue;
|
||||
|
|
@ -409,7 +416,11 @@ struct SynthPass : public ScriptPass {
|
|||
}
|
||||
|
||||
if (check_label("map_cells")) {
|
||||
run(stringf("techmap -D LUT_K=%d -map +/fabulous/cells_map.v", lut));
|
||||
if (help_mode) {
|
||||
run("techmap -D LUT_K=<lut> -map <cells_map.v>");
|
||||
} else if (!cells_map.empty()) {
|
||||
run(stringf("techmap -D LUT_K=%d -map %s", lut, cells_map.c_str()));
|
||||
}
|
||||
run("clean");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue