data/full_repos/permissive/441359809/src/yosys/tests/simple/multiplier.v
1: b'%Warning-MULTITOP: data/full_repos/permissive/441359809/src/yosys/tests/simple/multiplier.v:77: Multiple top level modules\n                                                                                              : ... Suggest see manual; fix the duplicates, or use --top-module to select top.\n                   ... Use "/* verilator lint_off MULTITOP */" and lint_on around source to disable this message.\n                                                                                              : ... Top module \'Multiplier_flat\'\nmodule Multiplier_flat #(parameter M = 4, parameter N = 4)(\n       ^~~~~~~~~~~~~~~\n                                                                                              : ... Top module \'Multiplier_2D\'\nmodule Multiplier_2D #(parameter M = 4, parameter N = 4)(\n       ^~~~~~~~~~~~~\n%Warning-WIDTH: data/full_repos/permissive/441359809/src/yosys/tests/simple/multiplier.v:99: Operator ASSIGNW expects 8 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 9 bits.\n                                                                                           : ... In instance Multiplier_2D\n    assign PP[i] = { {(N-i){1\'b0}}, Cout, gS};\n                 ^\n%Error: Exiting due to 2 warning(s)\n'
module Multiplier_2D #(parameter M = 4, parameter N = 4)(
input [M-1:0] A,
input [N-1:0] B,
output [M+N-1:0] P );

wire [M+N-1:0] PP [N-1:0];




assign PP[0] = { {N{1'b0}} , { A & {M{B[0]}} } };
assign P = PP[N-1];

genvar i;
generate
for (i=1; i < N; i=i+1)
begin: addPartialProduct
    wire [M+i-1:0] gA,gB,gS; wire Cout;
    assign gA = { A & {M{B[i]}} , {i{1'b0}} };
    assign gB = PP[i-1][M+i-1:0];


    assign PP[i] = { {(N-i){1'b0}}, Cout, gS};
    RippleCarryAdder#(M+i) adder(
    	.A(gA), .B(gB), .S(gS), .Cin(1'b0), .Cout(Cout) );
end
endgenerate



endmodule
module Multiplier_2D #(parameter M = 4, parameter N = 4)(
input [M-1:0] A,
input [N-1:0] B,
output [M+N-1:0] P );


wire [M+N-1:0] PP [N-1:0];




assign PP[0] = { {N{1'b0}} , { A & {M{B[0]}} } };
assign P = PP[N-1];

genvar i;
generate
for (i=1; i < N; i=i+1)
begin: addPartialProduct
    wire [M+i-1:0] gA,gB,gS; wire Cout;
    assign gA = { A & {M{B[i]}} , {i{1'b0}} };
    assign gB = PP[i-1][M+i-1:0];


    assign PP[i] = { {(N-i){1'b0}}, Cout, gS};
    RippleCarryAdder#(M+i) adder(
    	.A(gA), .B(gB), .S(gS), .Cin(1'b0), .Cout(Cout) );
end
endgenerate



endmodule