Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

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)
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
endgenerate
 

nand_gates

Advanced Member level 3
Joined
Jul 19, 2004
Messages
892
Helped
174
Reputation
348
Reaction score
51
Trophy points
1,308
Activity points
6,803
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
 

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
Re: Problems using "generate" and "genvar&amp

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

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top