HDL Coder Not Support Strings (smoothdata)
2 views (last 30 days)
Show older comments
>> testing
Unrecognized function or variable 'eml_max'.
Error in smoothdata_mod>inputTextLength (line 501)
len = eml_max(ONE,lenTmp);
Error in smoothdata_mod>parseMethods (line 464)
len = inputTextLength(inputArg);
Error in smoothdata_mod>parseInputs (line 220)
[methodTmp, inputIsMethod] = parseMethods(varargin{nextArg});
Error in smoothdata_mod (line 43)
dataVars, sp] = parseInputs(A, varargin{:});
Error in WaveletFilteredSection (line 8)
w = smoothdata_mod(abs((w)), 'movmean' ,15);
Error in testing (line 6)
w = WaveletFilteredSection(coeffs,sig);
I am trying to use HDL coder to convert a matlab function I have into some VHDL code. When trying to run HDL Coder, it threw an error before I was using the function smoothdata which apparently has strings in it which are not supported in HDL coder. It took my to the code for smooth data and I saw the string portion was only being used in a single portion that didn't appear to really need a string, I tried saying my own version of smoothdata without the string and it threw a bunch of errors.
I tested it and even the unmodified version of smoothdata just stored as my own version throws these errors. What could I used to make this code able to be converted to HDL?
Sidenote: Previously I had used the smooth function but that was unsupported for C coder so I removed it. I doubt if it wasn't supported for C coder it would work for HDL coder.
0 Comments
Accepted Answer
Jack
on 25 Mar 2023
Hi,
The error message you are seeing indicates that the function 'eml_max' is not recognized. This is because 'eml_max' is an internal function used by MATLAB's code generation process, and is not available for use in your MATLAB code.
Regarding your question about converting your MATLAB function into VHDL code using HDL Coder, it is important to note that not all MATLAB functions can be directly converted into hardware. Some functions may require modifications or simplifications to make them compatible with the HDL synthesis process.
In the case of the 'smoothdata' function, as you mentioned, it uses strings which are not supported in HDL Coder. One way to work around this limitation is to replace the 'smoothdata' function with an equivalent function that does not use strings. This may involve writing your own custom function or modifying an existing function to achieve the desired smoothing behavior.
Another option is to use a different smoothing technique that is supported by HDL Coder. For example, you could use a moving average filter or a Savitzky-Golay filter instead of the 'smoothdata' function.
It is also worth noting that even if you are able to modify your MATLAB function to make it compatible with HDL Coder, the resulting VHDL code may still require further optimization or modification to achieve the desired performance or functionality.
More Answers (0)
See Also
Categories
Find more on HDL Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!