- Design illustrates the us of binary operands, such as bitxor
- Shows how to properly segment persistent variables for register an BRAM access
- Illustrates the use of fi math
- Shows how to properly format and store ROM data, e.g., padData
- Loading external data in the test bench
Define global constant for HDL Coder
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi, I use the HDL Coder Toolbox to generate Verilog code from my Matlab code.
I would like to use a global constant variable in my Matlab code in order to hardcode some values some specific global parameters. I know Verilog has a `define directive for global constant definition but the HDL Coder Toolbox does not allow the use of global statement in Matlab code.
Let's say my Matlab source code is :
global NROW_MATLAB_CODE ;
NROW_MATLAB_CODE = 31 ;
for kRow=1:NROW_MATLAB_CODE
% Process
end
Any idea of how to tell HDL Coder to insert a specific code line like `define NROW 5'd31 and make it use the string NROW wherever the variable NROW_MATLAB_CODE is used ?
댓글 수: 0
답변 (1개)
Kiran Kintali
2020년 11월 1일
Globals are not currently supported in HDL Coder. Use persistent variables instead.
Also see this example on how to
>> mlhdlc_demo_setup('comms_data_packet')
% Key design pattern covered in this example:
댓글 수: 0
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!