Problems using "generate" and "genvar" w

Status
Not open for further replies.

Chanquete

Newbie level 2
Joined
Dec 7, 2005
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,307
Hi,

I have generated the verilog code copied at the end of this message. When compiling with ncverilog I get the following eror:

.ref(ref[col_gen*8 +: 8]),
|
ncelab: *E,RNOTCX (..\full\full_me_reg2.v,264|2: illegal use of a real number
as part of an expression.
.ref(ref[col_gen*8 +: 8]),


It seems that ncverilog has problems with generate statements. Anyone can help me? Thanks a lot in advance!!!

Best!
--------------------------------------------------------------------

genvar row_gen, col_gen;

generate

for(row_gen=0; row_gen<8; row_gen=row_gen+1)
begine_row
for(col_gen=0; col_gen<8; col_gen=col_gen+1)
begine_col_l
pe_full u_pe_full (
.rst_n(rst_n),.clk(clk),
.ref(ref[col_gen*8 +: 8]),
.enable_ref(enable_ref[row_gen]),
.enable_search(enable_search[row_gen]),
.sel(sel[row_gen]),
.search(search[col_gen*8 +: 8]),
.previous_pe(next_pe[128*(row_gen+1)+col_gen*8 +: 8]),
.next_pe(next_pe[128*row_gen+col_gen*8 +: 8]),
.sum_in(adder_l[144*row_gen+col_gen*16 +: 16]),
.sum_out(adder_l[144*row_gen+(col_gen+1)*16 +: 16]));
end
for(col_gen=8; col_gen<16; col_gen=col_gen+1)
begine_col_r
pe_full u_pe_full (
.rst_n(rst_n),.clk(clk),
.ref(ref[col_gen*8 +: 8]),
.enable_ref(enable_ref[row_gen]),
.enable_search(enable_search[row_gen]),
.sel(sel[row_gen]),
.search(search[col_gen*8 +: 8]),
.previous_pe(next_pe[128*(row_gen+1)+col_gen*8 +: 8]),
.next_pe(next_pe[128*row_gen+col_gen*8 +: 8]),
.sum_in(adder_m[144*row_gen+(col_gen-*16 +: 16]),
.sum_out(adder_m[144*row_gen+(col_gen-8+1)*16 +: 16]));
end
end
endgenerate
 

Re: Problems using "generate" and "genvar&amp

Checkout this some bracket was missing....


Code:
genvar row_gen, col_gen;

generate
   for(row_gen=0; row_gen<8; row_gen=row_gen+1) begin:pe_row
      for(col_gen=0; col_gen<8; col_gen=col_gen+1) begin:pe_col_l
         pe_full u_pe_full (
                            .rst_n         (rst_n),
                            .clk           (clk),
                            .ref           (ref[col_gen*8 : 8]),
                            .enable_ref    (enable_ref[row_gen]),
                            .enable_search (enable_search[row_gen]),
                            .sel           (sel[row_gen]),
                            .search        (search[col_gen*8 : 8]),
                            .previous_pe   (next_pe[128*(row_gen+1)+col_gen*8 : 8]),
                            .next_pe       (next_pe[128*row_gen+col_gen*8 : 8]),
                            .sum_in        (adder_l[144*row_gen+col_gen*16 : 16]),
                            .sum_out       (adder_l[144*row_gen+(col_gen+1)*16 : 16]));
      end
      for(col_gen=8; col_gen<16; col_gen=col_gen+1) begin:pe_col_r
         pe_full u_pe_full (
                            .rst_n          (rst_n),
                            .clk            (clk),
                            .ref            (ref[col_gen*8 : 8]),
                            .enable_ref     (enable_ref[row_gen]),
                            .enable_search  (enable_search[row_gen]),
                            .sel            (sel[row_gen]),
                            .search         (search[col_gen*8 : 8]),
                            .previous_pe    (next_pe[128*(row_gen+1)+col_gen*8 : 8]),
                            .next_pe        (next_pe[128*row_gen+col_gen*8 : 8]),
                            .sum_in         (adder_m[144*row_gen+col_gen*16 : 16]),
                            .sum_out        (adder_m[144*row_gen+(col_gen-8+1)*16 : 16]));
      end
   end
 

Re: Problems using "generate" and "genvar&amp

Many thanks, but this code also does not seem to work
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…