Importing hdl code changes signal type, and it's super annoying to convert it back for sim
이전 댓글 표시
Hi,
I have a very simple VHDL module that I have imported into Simulink using the DSP Builder/HDL coder toolbox. Here's the port definition:
entity trigen is
port (
clock : in std_logic; -- Assuming 50mhz operation
triout : out unsigned(12 DOWNTO 0)
);
end entity;
triout just produces a simple triangle wave that I want to see on a Scope. However, HDL Import forces the output of this block to an INT13 instead of an unsigned value. The scope then tries to convert this value into a double, and thinks its looking at a 2's compliment number.
Using a simple type conversion does not work since it will change the data assuming you want to convert over from 2's comp.
How do I 'cast' the type, or fix the import?
Thank you :)
답변 (1개)
Kiran Kintali
2020년 3월 19일
0 개 추천
can you share the vhdl file and the version of MATLAB and HDLCoder used for hdlimport?
thanks
댓글 수: 1
TheGreatNed
2020년 3월 19일
편집: TheGreatNed
2020년 3월 19일
카테고리
도움말 센터 및 File Exchange에서 HDL Coder에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!