Represent std_logic_vector in Simulink

조회 수: 2 (최근 30일)
Brad
Brad 2023년 9월 6일
댓글: Kiran Kintali 2024년 3월 10일
Does SIMULINK support creation of typical HDL data types or only MATLAB types (e.g. UINT32, FI, etc.)? Some of the inputs to my system do not fall neatly into power-of-2 variable sizing and I would like to be able to create something equivalent to std_logic_vector (10 downto 0) in SIMULINK. Even if I have to somehow create the datatype from scratch, is this possible?
I want to be able to use this datatype and assign it to my ports as their datatype.

채택된 답변

Kiran Kintali
Kiran Kintali 2023년 9월 7일
편집: Kiran Kintali 2023년 9월 8일
HDL Coder supports fixed point data types with integer lengths ranging from 1 to 128 bits.
During the HDL code generation process, these map to the std_logic_vector type (typically used for arrays of std_logic variables and signals in VHDL).
Try HDL Code generation from some of example MATLAB Code and Simulink models foudn here..
You can browse through the code samples in the HDL Coder documentation to get an idea of the std_logic and std_logic_vector types generated.
y : OUT std_logic_vector(32 DOWNTO 0) -- sfix33_En20
  댓글 수: 2
Brad
Brad 2024년 3월 7일
If I need a std_logic_vector that exceeds 128 bits (127 downto 0) what data type should I use that allows me to select an arbitrary number of bits? I'm trying to populate a data dictionary and have some data that is more than 128 bits in size. I was thinking about using a boolean datatype and setting dimensions to my desired value. Will that also yield a std_logic_vector when hdl coder generates code?
Kiran Kintali
Kiran Kintali 2024년 3월 10일
>128 or 129+ bit support is currently under development. Please stay tuned for an update on this topic in the next couple of weeks.
The only option currently available is to use the large data type say 1024bits into chunks of 128bits and use a vector format to propagate the data.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by