HDL workflow adviser error, oversampling error!?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ben Fayçal
le 15 Mai 2021
Modifié(e) : Kiran Kintali
le 16 Mai 2021
I tried to generate a VHDL code using workflow adviser of simulink, for a triggered subsystem that contains a matlab function , but when i do so , it shows me the following errors: 

0 commentaires
Réponse acceptée
Kiran Kintali
le 16 Mai 2021
Modifié(e) : Kiran Kintali
le 16 Mai 2021
Your MATLAB code is using floating-point double precision. You need to have budget for pipelining for math in the logic.
Consider using ratio of data and clock rate as oversampling to create such budget.
I am able to generate code for the MATLAB function in a stand-alone model (attached).
>> makehdl('test_mlfb/Subsystem', 'oversampling', 500)
### Generating HDL for 'test_mlfb/Subsystem'.
### Using the config set for model test_mlfb for HDL code generation parameters.
### Running HDL checks on the model 'test_mlfb'.
### Begin compilation of the model 'test_mlfb'...
### Applying HDL optimizations on the model 'test_mlfb'...
### The code generation and optimization options you have chosen have introduced additional pipeline delays.
### The delay balancing feature has automatically inserted matching delays for compensation.
### The DUT requires an initial pipeline setup latency. Each output port experiences these additional delays.
### Output port 1: 1 cycles.
### Begin model generation.
### Model generation complete.
### Begin VHDL Code Generation for 'test_mlfb'.
### MESSAGE: The design requires 500 times faster clock with respect to the base rate = 1.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_convert_double_to_fixed_8_En0 as hdlsrc\test_mlfb\nfp_convert_double_to_fixed_8_En0.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_sub_double as hdlsrc\test_mlfb\nfp_sub_double.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_relop_double as hdlsrc\test_mlfb\nfp_relop_double.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_add_double as hdlsrc\test_mlfb\nfp_add_double.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_relop_double as hdlsrc\test_mlfb\nfp_relop_double_block.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_div_double as hdlsrc\test_mlfb\nfp_div_double.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_relop_double as hdlsrc\test_mlfb\nfp_relop_double_block1.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_relop_double as hdlsrc\test_mlfb\nfp_relop_double_block2.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_mul_double as hdlsrc\test_mlfb\nfp_mul_double.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1/nfp_abs_double as hdlsrc\test_mlfb\nfp_abs_double.vhd.
### Working on test_mlfb/Subsystem/MATLAB Function1 as hdlsrc\test_mlfb\MATLAB_Function1.vhd.
### Working on Subsystem_tc as hdlsrc\test_mlfb\Subsystem_tc.vhd.
### Working on test_mlfb/Subsystem as hdlsrc\test_mlfb\Subsystem.vhd.
### Generating package file hdlsrc\test_mlfb\Subsystem_pkg.vhd.
### Code Generation for 'test_mlfb' completed.
### Creating HDL Code Generation Check Report Subsystem_report.html
### HDL check for 'test_mlfb' complete with 0 errors, 2 warnings, and 1 messages.
### HDL code generation complete.
>>
0 commentaires
Plus de réponses (1)
Kiran Kintali
le 15 Mai 2021
Modifié(e) : Kiran Kintali
le 15 Mai 2021
What release are you using? Can you share a sample model that can reproduce the issue?

>> makehdl(gcb)
### Generating HDL for 'test_mlfb_feedback/MLFB_FB1'.
### Using the config set for model test_mlfb_feedback for HDL code generation parameters.
### Running HDL checks on the model 'test_mlfb_feedback'.
### Begin compilation of the model 'test_mlfb_feedback'...
### Applying HDL optimizations on the model 'test_mlfb_feedback'...
### Creating HDL Code Generation Check Report MLFB_FB1_report.html
### HDL check for 'test_mlfb_feedback' complete with 2 errors, 1 warnings, and 0 messages.
### HDL check for 'test_mlfb_feedback' complete with 2 errors, 1 warnings, and 0 messages.
Error using slhdlcoder.HDLCoder/targetCodeGenStatusCheck (line 41)
Native floating-point code generation cannot complete for the following reason(s): 'Unable to allocate delays to compensate
for the 9 delays introduced by test_mlfb_feedback/MLFB_FB1/Product in native floating-point mode. Consider either increasing
the oversampling factor, setting the 'Latency Strategy' to 'Zero', or adding the necessary output pipelines via HDL block
properties for other blocks in the model to accommodate for the latency introduced by this block. More information'.
Error in slhdlcoder.HDLCoder/runPIRTransformAndCodegen (line 535)
targetCodeGenStatusCheck(this, p);
Error in slhdlcoder.HDLCoder/makehdl (line 29)
runPIRTransformAndCodegen(this, gp, codegenParams, params);
Error in privmakehdl (line 21)
hc.makehdl(params);
Error in makehdl (line 66)
privmakehdl(varargin{:})
>>
here is a sample example where MATLAB function block is in feedback loop; it has a simple add operation. However it uses floating point operation and hence would need latency balancing. Without latency balancing you get the above error.
Use appropriate amount of delays next to the block to accomadate the latency or alternatively use OverSampling factor to compensate for the delays.
>> makehdl('test_mlfb_feedback/MLFB_FB1', 'OverSampling', 10)
### Generating HDL for 'test_mlfb_feedback/MLFB_FB1'.
### Using the config set for model test_mlfb_feedback for HDL code generation parameters.
### Running HDL checks on the model 'test_mlfb_feedback'.
### Begin compilation of the model 'test_mlfb_feedback'...
### Applying HDL optimizations on the model 'test_mlfb_feedback'...
### Begin model generation.
### Model generation complete.
### Begin VHDL Code Generation for 'test_mlfb_feedback'.
### MESSAGE: The design requires 10 times faster clock with respect to the base rate = 1.
### Working on test_mlfb_feedback/MLFB_FB1/MATLAB Function/nfp_add_double as hdlsrc\test_mlfb_feedback\nfp_add_double.vhd.
### Working on test_mlfb_feedback/MLFB_FB1/MATLAB Function as hdlsrc\test_mlfb_feedback\MATLAB_Function.vhd.
### Working on test_mlfb_feedback/MLFB_FB1/nfp_mul_double as hdlsrc\test_mlfb_feedback\nfp_mul_double.vhd.
### Working on MLFB_FB1_tc as hdlsrc\test_mlfb_feedback\MLFB_FB1_tc.vhd.
### Working on test_mlfb_feedback/MLFB_FB1 as hdlsrc\test_mlfb_feedback\MLFB_FB1.vhd.
### Generating package file hdlsrc\test_mlfb_feedback\MLFB_FB1_pkg.vhd.
### Code Generation for 'test_mlfb_feedback' completed.
### Creating HDL Code Generation Check Report MLFB_FB1_report.html
### HDL check for 'test_mlfb_feedback' complete with 0 errors, 1 warnings, and 1 messages.
### HDL code generation complete.
>>
See this article Allocate Sufficient Delays for Floating-Point Operations
web(fullfile(docroot, 'hdlcoder/ug/unable-to-allocate-delays-in-native-floating-point-mode.html?s_tid=doc_srchtitle'))
1 commentaire
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!