0

I am compiling an SNN simulator named "ODIN" in Xilinx. for Generate block I get this error but I think there is nothing wrong with this block. Can you help me with this?

'''
genvar i;
generate
    for (i=0; i<8; i=i+1) begin
    
        sdsp_update #(
            .WIDTH(3)
        ) sdsp_update_gen (
            // Inputs
                // General
            .SYN_PRE(CTRL_PRE_EN[i] & (SPI_UPDATE_UNMAPPED_SYN | SYNARRAY_RDATA[(i<<2)+3])),
            .SYN_BIST_REF(CTRL_BIST_REF),
                // From neuron
            .V_UP(NEUR_V_UP_int[i]),
            .V_DOWN(NEUR_V_DOWN_int[i]),    
                // From SRAM
            .WSYN_CURR(SYNARRAY_RDATA[(i<<2)+3:(i<<2)]),
            
            // Output
            .WSYN_NEW(SYNARRAY_WDATA_int[(i<<2)+3:(i<<2)])
        );
    end
endgenerate

I get these errors:

Generated begin-end blocks must be named

Illegal redeclaration of ''

Community
  • 1
  • 1
dreamer1375
  • 53
  • 1
  • 10
  • Does this answer your question? [Instantiate Modules in Generate For Loop in Verilog](https://stackoverflow.com/questions/33899691/instantiate-modules-in-generate-for-loop-in-verilog) – Qiu Feb 21 '20 at 07:33

1 Answers1

0

Some compilers wants to have a name when generating logic. This name is taken from the name of the begin-end block. Try this:

'''
genvar i;
generate
    for (i=0; i<8; i=i+1) 
    begin : sdsp_gen // <<< Name for begin/end block 

        sdsp_update #(
            .WIDTH(3)
        ) sdsp_update_gen (
            // Inputs
                // General
            .SYN_PRE(CTRL_PRE_EN[i] & (SPI_UPDATE_UNMAPPED_SYN | SYNARRAY_RDATA[(i<<2)+3])),
            .SYN_BIST_REF(CTRL_BIST_REF),
                // From neuron
            .V_UP(NEUR_V_UP_int[i]),
            .V_DOWN(NEUR_V_DOWN_int[i]),    
                // From SRAM
            .WSYN_CURR(SYNARRAY_RDATA[(i<<2)+3:(i<<2)]),

            // Output
            .WSYN_NEW(SYNARRAY_WDATA_int[(i<<2)+3:(i<<2)])
        );
    end
endgenerate
Oldfart
  • 6,104
  • 2
  • 13
  • 15