I would like to know more information about Generate statements I know that you can replicate modules, and always blocks (like in the other post) but, Would it be possible to create a parametrized case like this?
always @ (negedge clk)
begin
if (state==1)
begin
case(CS_sel)
begin
generate
genvar i;
for (i=0; i<N_DACS; i=i+1)
begin: for1
i:begin
num <= mod_in[(i+1)*BITS-1:i*BITS];
div <= mod_out[(i+1)*BITS-1:i*BITS];
end // i:
end // for1
endgenerate
default: begin
num <= mod_in[BITS-1:0];
div <= mod_out[BITS-1:0];
end // default
end // case (CS_sel)
endcase // case (CS_sel)
end // if (state==1)
end // always
First of all, I would like to know if this is possible and how could I do it,
After this, if you know another option to create a synchronous multiplexer in verilog, it would be great!
Thank you!