module gf_mult_pipe
[CODE HERE]
//--------------------------------------------------------------------------------------------------------------------
// Generate description
//--------------------------------------------------------------------------------------------------------------------
genvar pipe;
generate
[SOME CODE HERE]
// Main Karatsuba multiplier instantiations
// ** THIS IS WHAT I AM STUCK ON...***
// HOW DO I MAKE THE PIPELINE VALUE CHANGE FOR THE NEXT
// INSTANCE DEPENDING ON WHAT THE CURRENT PIPELINE
// VALUE IS???
if (PIPE_STAGES > 2)
begin
pipe = PIPE_STAGES - 2;
// in this section, as long as the number of PIPE_STAGES > 2, subtract two from the
// result because both the splitter and alignment circuits will get registers
end
else if (PIPE_STAGES == 2)
begin
pipe = 1;
// Making the number of stages = 1 because when the number of stages = 2, only
// the alignment circuit will get a register.. that is, until the WIDTH == CUTOFF
end
else
begin
pipe = PIPE_STAGES;
end
gf_mult_pipe
#(.WIDTH(WIDTH/2), .CUTOFF(CUTOFF), .PIPE_STAGES(pipe))
I1
(
.in1(a1),
.in2(b1),
.clk(clk),
.out(mult1)
);
[more instances here]
endgenerate
endmodule