MATLAB HDL-Coder: Expression could not be reduced to a constant.
Mostra commenti meno recenti
I am trying to pass a struct hwconst into a MATLAB function.
function [out] = function_hdl(in, hwconst)
That function I want to translate into Verilog code using HDL-Coder. hwconst contains a field lfsrWidth. I am then using this field in the MATLAB function as follows:
WD_lfsr = coder.const(hwconst.lfsrWidth);
However, that line gives me an error during building: "Expression could not be reduced to a constant." I guess it's because lfsrWidth is not defined as a constant, see below. That's because the option for that is not there. How to use a structure with hardware constants properly with HDL Coder?

Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Code Generation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!