HDL Workflow advisor on Intel SoC... Error in Quartus while synthesis: Error (272006): In lpm_divide megafunction, LPM_WIDTHN must be less than or equals to 64

11 views (last 30 days)
I need to implement a PI based cascaded controller for inverter on SoC-FPGA (De1-SoC) therefore I am using the HDL workflow advisor codesign method. In the last steps i.e. Build FPGA Bitstream, the quartus returns the following error:
Error (272006): In lpm_divide megafunction, LPM_WIDTHN must be less than or equals to 64
Error (12154): Can't elaborate inferred hierarchy "system_soc:u0|Controller_for_SiemensMR_ip:controller_for_siemensmr_ip_0|Controller_for_SiemensMR_ip_dut:u_Controller_for_SiemensMR_ip_dut_inst|Controller_for_SiemensMR_ip_src_Voltage_Controller:u_Controller_for_SiemensMR_ip_src_Voltage_Controller|Controller_for_SiemensMR_ip_src_MATLAB_Function3:u_MATLAB_Function3|lpm_divide:Div4"
LINE IN VHDL that causes ERROR--> div_temp_8 := cast_23 / Tp1;
[ VARIABLE cast_23 : unsigned(89 DOWNTO 0);
VARIABLE Tp1 : unsigned(20 DOWNTO 0); ]
I am attaching the VHDL file to which the error is pointing plus the matlab function which corresponds to the VHDL file. I have tried several different settings for the fixed point integer inputs to the function but I could not solve this issue. I know that its because of the division, the divisor or dividend should be less than 64bits. In my whole code I dont exceed the limit of max 40 bits but in the VHDL elaboration process this cast _23 variable is created that causes the error.
I am not so good in VHDL. Could you please help me in finding the fix for it. Should I not use the divide function for fixed point integer instead use some other function..... any suggestions???

Answers (1)

Kiran Kintali
Kiran Kintali on 30 Apr 2021
Please attach "dut.m" and "testbench.m" file and the HDL Coder project file (.prj) for further analysis and guidance.
  3 Comments
Kiran Kintali
Kiran Kintali on 30 Apr 2021
Thanks for the followup.
It would help us if you could give us input types or a test bench that were used to compile the code that resulted in the error. It will help address the usability issue.
adeeljsid
adeeljsid on 30 Apr 2021
I have modfiied the main files so it will not help you in reproducing the errors. Unfortunately, I was not keeping track of the version using git. Sorry!

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!