How and where do I perform parameter override to this question?
While I try to override it using #, I am receiving a warning stating that the port size does not match to the inputs and outputs or the parameter BIT_N_TB not found.
``include "para_over.v"
module tb;
parameter BIT_N=6;
parameter BIT_N_TB;
reg [BIT_N-1:0]a,b;
reg cin;
wire [BIT_N-1:0]s;
wire cout;
fa_bit4_par #(.BIT_N_TB(8)) fa0(a,b,cin,s,cout);
initial begin
repeat (20) begin
{a,b,cin}=$random;
#1;
$display("%t: a=%b, b=%b,cin=%b,s=%b,cout=%b", $time, a, b,cin,s,cout);
end
end
endmodule'''`
module fa_bit4_par(a,b,cin,s,cout);
parameter BIT_N=6;
input [BIT_N-1:0]a,b;
input cin;
output [BIT_N-1:0]s;
output cout;
wire [BIT_N:0] c;
assign c[0]=cin;
assign cout=c[BIT_N];
genvar i;
for(i=0;i<BIT_N;i=i+1)begin
fa fa0(a[i],b[i],c[i],s[i],c[i+1]);
end
endmodule`
New contributor
Cecelia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.