YosysHQ / yosys

Yosys Open SYnthesis Suite
https://yosyshq.net/yosys/
ISC License
3.3k stars 860 forks source link

techmap: Support mapping to dynamic cell types #4327

Closed povik closed 2 months ago

povik commented 2 months ago

Sample of use:

(* techmap_celltype="$lcu" *)
module _80_lcu_primitive(P, G, CI, CO);
    parameter WIDTH = 2;

    (* force_downto *)
    input wire [WIDTH-1:0] P;
    (* force_downto *)
    input wire [WIDTH-1:0] G;
    input wire CI;
    (* force_downto *)
    output wire [WIDTH-1:0] CO;

    (* techmap_chtype=$sformatf("LCU_%0d", WIDTH) *)
    _TECHMAP_PLACEHOLDER_ #(.WIDTH(WIDTH)) _TECHMAP_REPLACE_(.P(P), .G(G), .CI(CI), .CO(CO));
endmodule

to map $lcu cells to cells LCU_x where x is the width.

widlarizer commented 2 months ago

I assume you forgot to add this commit into the PR, it was only on the or-patches branch

povik commented 2 months ago

Yes, thanks