HDL Coder to / downto order

조회 수: 1 (최근 30일)
Michael Felger
Michael Felger 2019년 11월 13일
편집: Kiran Kintali 2024년 1월 9일
Hi,
I'm using HDL Coder to generade VHDL code for a simulink block.
In the entity, the port order is generated as follow:
  • for fixed-point variables, the output port is std_logic_vector(n downto 0)
  • for boolean vector (Simulink Port dimension: [1 n]), the output port is std_logic_vector(0 to n)
Is it possible to change the order (to / downto), that all output ports have the same direction, and are not mixed for one entity?
My goal is to have downto for all outputs.

채택된 답변

Kiran Kintali
Kiran Kintali 2019년 11월 14일
This is a limitation due to an early decision made to emit vector of boolean to use 'TO' syntax and is not currently customizable.
A potential workaround is to concatenate boolean vector to a single signal of ufixN type using BitConcat block and seperating input scalar signal inside DUT back to vector of boolean using BitSlice blocks.

추가 답변 (1개)

Kiran Kintali
Kiran Kintali 2023년 9월 8일
편집: Kiran Kintali 2024년 1월 9일
The control is now available starting R2023b release for boolean arrays.
Generate code for Boolean array with MSB-to-LSB convention
You can now generate code for an array of boolean data in most significant bit (MSB) to least significant bit (LSB) convention. For example, a subsystem with boolean input and output data, the generated VHDL code with the DOWNTO convention has this form:
ENTITY Subsystem IS
PORT ( In1 : IN std_logic_vector(4 DOWNTO 0); -- boolean [5]
Out1 : OUT std_logic_vector(4 DOWNTO 0) -- boolean [5] );
END Subsystem;
You can use this functionality for the VHDL®, Verilog®, and System Verilog target languages.
To revert to the old behavior you can use this option.
>> makehdl(<pathtodut>, 'BooleanVectorDownTo', 'off')
  댓글 수: 3
Eckhard Hennig
Eckhard Hennig 2024년 1월 9일
Is there an option in R2023b that allows the indexing order to be switched back to the previous behavior (0 to ...)? Generally, I'm happy about the change to the "downto" order, but I need to restore the previous behavior for compatibility with a proprietary add-on that relies on the "to" order.
Kiran Kintali
Kiran Kintali 2024년 1월 9일
You can temporarily revert to the old behavior using 'BooleanVectorDownTo', 'off' option.

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by