![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/384898/image.jpeg)
matlab function block for HDL generate
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, i'm trying to use HDL coder tool.
I used Matlab function block and make a simple as belowed:
function y = fcn(en,in,clk)
z= int16(zeros(9,9));
y = int16(zeros(0));
if clk ==1
if en ==1
for i=0:9
for j=0:9
z(i,j) =in;
end
end
end
y=z(1,1);
end
and when i generate to RTL code (verilog), the always loop is used en and clk singnal for the trigger
always @(clk && en) begin
.......
I expected as belowed
alsways @(posedge clk) begin
if (en) begin
......
If any have experience please help me.
Thank you and best regards.
댓글 수: 0
답변 (1개)
Kiran Kintali
2020년 10월 19일
HDL Coder automatically infers clock, clocken, reset from the model. The inputs to MATLAB function block are pure data inputs.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/384898/image.jpeg)
댓글 수: 0
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!