Altera_Forum
Honored Contributor
8 years agoInstantiation Errors
Hello,
I'm trying to reference my full adder module inside another module but seem to be getting lost somehow in the referencing. I keep getting the error Checker 'Full_Adder' not found. Instantiation 's' must be of a visible checker. the code I have is: always @(posedge clk) begin if (reset==1) // reset isn't pressed begin if (enable==1) //enable is active begin case ({ALU_OP}) 2'h0 : D = A & B; 2'h1 : D = A | B; 2'h2 : Full_Adder f(A,B,D,C); 2'h3 : D = A * B; endcase end end end endmodule module Full_adder(a,b,answer,carry_out); //inputs input [2:0] a,b; //outputs output [2:0] answer; output carry_out; //wires wire carry_out; wire [2:0] carry; genvar i; generate for(i=0;i<2;i=i+1) begin: generate_N_bit_Adder if(i==0) half_adder f(a[0],b[0],answer[0],carry[0]); else full_adder f(a,b,carry[i-1],answer,carry); end assign carry_out = carry[2]; endgenerate endmodule