cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
yakir_mishli
Observer
Observer
479 Views
Registered: ‎11-10-2020

synthesis fail [Synth 8-120] call depth limit (1000) exceeded

Jump to solution

Hi,

I get this error in vivado:

ERROR: [Synth 8-120] call depth limit (1000) exceeded [/home/wlan/wlan_g7/v_ymishli.priv.ip.wlan_g7.delete_me/ipg_wlan_mac/mac_core/source/verilog/rtl/mac_bfm_rtl_pkg.sv:344]

line 344 takes to a function in a package:

function automatic [8:0] calc_ns_func;
input bf_phy_mode_t f_inpt_phy_mode;
input [3:0] f_inpt_bw;
input [1:0] f_inpt_ng;

begin
casez ({f_inpt_phy_mode,f_inpt_bw,f_inpt_ng})
{MBFM_MODE_HT, BW_20MHZ, MBFM_GROUP1}: calc_ns_func = 10'd56;
{MBFM_MODE_HT, BW_20MHZ, MBFM_GROUP2}: calc_ns_func = 10'd30;
{MBFM_MODE_HT, BW_20MHZ, MBFM_GROUP4}: calc_ns_func = 10'd16;
{MBFM_MODE_HT, BW_40MHZ, MBFM_GROUP1}: calc_ns_func = 10'd114;
{MBFM_MODE_HT, BW_40MHZ, MBFM_GROUP2}: calc_ns_func = 10'd58;
{MBFM_MODE_HT, BW_40MHZ, MBFM_GROUP4}: calc_ns_func = 10'd30;
{MBFM_MODE_VHT, BW_20MHZ, MBFM_GROUP1}: calc_ns_func = 10'd52;
{MBFM_MODE_VHT, BW_20MHZ, MBFM_GROUP2}: calc_ns_func = 10'd30;
{MBFM_MODE_VHT, BW_20MHZ, MBFM_GROUP4}: calc_ns_func = 10'd16;
{MBFM_MODE_VHT, BW_40MHZ, MBFM_GROUP1}: calc_ns_func = 10'd108;
{MBFM_MODE_VHT, BW_40MHZ, MBFM_GROUP2}: calc_ns_func = 10'd58;
{MBFM_MODE_VHT, BW_40MHZ, MBFM_GROUP4}: calc_ns_func = 10'd30;
{MBFM_MODE_VHT, BW_80MHZ, MBFM_GROUP1}: calc_ns_func = 10'd234;
{MBFM_MODE_VHT, BW_80MHZ, MBFM_GROUP2}: calc_ns_func = 10'd122;
{MBFM_MODE_VHT, BW_80MHZ, MBFM_GROUP4}: calc_ns_func = 10'd62;
{MBFM_MODE_VHT, BW_160MHZ, MBFM_GROUP1}: calc_ns_func = 10'd468;
{MBFM_MODE_VHT, BW_160MHZ, MBFM_GROUP2}: calc_ns_func = 10'd244;
{MBFM_MODE_VHT, BW_160MHZ, MBFM_GROUP4}: calc_ns_func = 10'd124;
{MBFM_MODE_HE, BW_20MHZ, MBFM_GROUP_HE4}: calc_ns_func = 10'd64;
{MBFM_MODE_HE, BW_20MHZ, MBFM_GROUP_HE16}: calc_ns_func = 10'd20;
{MBFM_MODE_HE, BW_40MHZ, MBFM_GROUP_HE4}: calc_ns_func = 10'd122;
{MBFM_MODE_HE, BW_40MHZ, MBFM_GROUP_HE16}: calc_ns_func = 10'd32;
{MBFM_MODE_HE, BW_80MHZ, MBFM_GROUP_HE4}: calc_ns_func = 10'd250;
{MBFM_MODE_HE, BW_80MHZ, MBFM_GROUP_HE16}: calc_ns_func = 10'd64;
{MBFM_MODE_HE, BW_160MHZ, MBFM_GROUP_HE4}: calc_ns_func = 10'd500;
{MBFM_MODE_HE, BW_160MHZ, MBFM_GROUP_HE16}: calc_ns_func = 10'd128;
{MBFM_MODE_EHT, BW_20MHZ, MBFM_GROUP_HE4}: calc_ns_func = 10'd64;
{MBFM_MODE_EHT, BW_20MHZ, MBFM_GROUP_HE16}: calc_ns_func = 10'd20;
{MBFM_MODE_EHT, BW_40MHZ, MBFM_GROUP_HE4}: calc_ns_func = 10'd122;
{MBFM_MODE_EHT, BW_40MHZ, MBFM_GROUP_HE16}: calc_ns_func = 10'd32;
{MBFM_MODE_EHT, BW_80MHZ, MBFM_GROUP_HE4}: calc_ns_func = 10'd250;
{MBFM_MODE_EHT, BW_80MHZ, MBFM_GROUP_HE16}: calc_ns_func = 10'd64;
{MBFM_MODE_EHT, BW_160MHZ, MBFM_GROUP_HE4}: calc_ns_func = 10'd500;
{MBFM_MODE_EHT, BW_160MHZ, MBFM_GROUP_HE16}: calc_ns_func = 10'd128;
{MBFM_MODE_EHT, BW_320MHZ, MBFM_GROUP_HE4}: calc_ns_func = 10'd1000;
{MBFM_MODE_EHT, BW_320MHZ, MBFM_GROUP_HE16}: calc_ns_func = 10'd256;
{MBFM_MODE_EHT, BW_40p20MHZ, MBFM_GROUP_HE4}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_20MHZ,MBFM_GROUP_HE4) ; // line 344
{MBFM_MODE_EHT, BW_40p20MHZ, MBFM_GROUP_HE16}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_20MHZ,MBFM_GROUP_HE16) ;
{MBFM_MODE_EHT, BW_80p40MHZ, MBFM_GROUP_HE4}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE4) ;
{MBFM_MODE_EHT, BW_80p40MHZ, MBFM_GROUP_HE16}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE16) ;
{MBFM_MODE_EHT, BW_80p40p20MHZ, MBFM_GROUP_HE4}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_20MHZ,MBFM_GROUP_HE4) ;
{MBFM_MODE_EHT, BW_80p40p20MHZ, MBFM_GROUP_HE16}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_20MHZ,MBFM_GROUP_HE16) ;
{MBFM_MODE_EHT, BW_80p80p40MHZ, MBFM_GROUP_HE4}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE4) ;
{MBFM_MODE_EHT, BW_80p80p40MHZ, MBFM_GROUP_HE16}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE16) ;
{MBFM_MODE_EHT, BW_80p80p80MHZ, MBFM_GROUP_HE4}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) ;
{MBFM_MODE_EHT, BW_80p80p80MHZ, MBFM_GROUP_HE16}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) ;
{MBFM_MODE_EHT, BW_80p80p80p40MHZ, MBFM_GROUP_HE4}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE4) +
calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE4) ;
{MBFM_MODE_EHT, BW_80p80p80p40MHZ, MBFM_GROUP_HE16}: calc_ns_func = calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_80MHZ,MBFM_GROUP_HE16) +
calc_ns_func(MBFM_MODE_EHT,BW_40MHZ,MBFM_GROUP_HE16) ;
default: calc_ns_func = 10'd30;
endcase
end
endfunction

 

Thanks,

Yakir Mishli

 

0 Kudos
1 Solution

Accepted Solutions
yakir_mishli
Observer
Observer
326 Views
Registered: ‎11-10-2020

solved!

I changed casez to case 

don't understand why with casez it's infinite loop error and with case it works because my case items are unique.

 

View solution in original post

0 Kudos
4 Replies
avrumw
Guide
Guide
453 Views
Registered: ‎01-23-2009

This is a recursive function. From the error message, the tools think there is an infinite recursion here, which cannot be synthesized.

While I haven't studied the code carefully, no obvious infinite recursion exists assuming the constants used in your case declaration are unique. Most likely this isn't the case. From this code sample we can tell neither the size of bf_phy_mode_t, nor do we know the numerical values for any of the constants. If either the sizes in your concatenations don't work out properly or the constants are not unique, then while these case items look unique from their symbol names, they may not be unique when converted to numerical values. It is the numerical values that matter - somewhere you have a loop created by these cases; where either a case resolves to calling itself, or there are a sequence of items that together form a loop.

You will have to inspect the constants and the sizes of the concatenations carefully to find out what combinations are not unique.

Avrum

0 Kudos
yakir_mishli
Observer
Observer
422 Views
Registered: ‎11-10-2020

Hi Avrum,

Thanks for replay.

I added below the constants. I check it very carefully and it looks that all case items are unique. 

so I can't figure out how infinite recursion occurs...

localparam [3:0] BW_2MHZ = 4'd0; // 0 26
localparam [3:0] BW_5MHZ = 4'd1; // 1 52
localparam [3:0] BW_10MHZ = 4'd2; // 2 106
localparam [3:0] BW_20MHZ = 4'd3; // 3 242
localparam [3:0] BW_40MHZ = 4'd4; // 4 484
localparam [3:0] BW_80MHZ = 4'd5; // 5 996
localparam [3:0] BW_160MHZ = 4'd6; // 6 1992
localparam [3:0] BW_320MHZ = 4'd7; // 7 3984
localparam [3:0] BW_5p2MHZ = 4'd8; // 8 78 (52+26)
localparam [3:0] BW_10p2MHZ = 4'd9; // 9 132(106+26)
localparam [3:0] BW_40p20MHZ = 4'd10; // 10 726 (484+242)
localparam [3:0] BW_80p40MHZ = 4'd11; // 11 1480 (996+484)
localparam [3:0] BW_80p40p20MHZ = 4'd12; // 12 1722 (996+484+242)
localparam [3:0] BW_80p80p40MHZ = 4'd13; // 13 2476 (996+996+484)
localparam [3:0] BW_80p80p80MHZ = 4'd14; // 14 2988 (996+996+996)
localparam [3:0] BW_80p80p80p40MHZ = 4'd15; // 15 3472 (996+996+996+484)

localparam [1:0] MBFM_GROUP1 = 2'd0;
localparam [1:0] MBFM_GROUP2 = 2'd1;
localparam [1:0] MBFM_GROUP4 = 2'd2;
localparam [1:0] MBFM_GROUP_HE4 = 2'd0;
localparam [1:0] MBFM_GROUP_HE16 = 2'd1;

typedef enum logic [2:0] {
MBFM_MODE_NOT_BFR = 3'b001,
MBFM_MODE_HT = 3'b000,
MBFM_MODE_VHT = 3'b010,
MBFM_MODE_HE = 3'b011,
MBFM_MODE_EHT = 3'b100
} bf_phy_mode_t;

0 Kudos
yakir_mishli
Observer
Observer
330 Views
Registered: ‎11-10-2020

I still stuck on it can't figure out what is wrong.

1. my recursive function is defined automatic as required.

2. I checked the uniqueness of my case items.

so at worst case the call depth of recursion goes 4 times deep. (and not 1000 as state)

maybe VIVADO can't handle recursive function defined inside package???

help!!!

0 Kudos
yakir_mishli
Observer
Observer
327 Views
Registered: ‎11-10-2020

solved!

I changed casez to case 

don't understand why with casez it's infinite loop error and with case it works because my case items are unique.

 

View solution in original post

0 Kudos