how translate stateflow variable to hdl std_logic_vector(0 to 7)

조회 수: 1 (최근 30일)
borzack
borzack 2020년 10월 11일
답변: Kiran Kintali 2020년 10월 12일
Hi,
hdlcoder translate the stateflow variable fi(0,0,5,0) to std_logic_vector(0 downto 4), but sometimes I need std_logic_vector(0 to 4). Ofcourse if I use a boolean array hdlcoder translate it to std_logic_vector(0 to 4) but I can't use bitconcat, bitsliceget function, so in this case I need work with array while in the first case I work with bit.
is there a way to work with fi() type and set hdlcoder to translate big or little endian?
Thanks,
Domenico

채택된 답변

Kiran Kintali
Kiran Kintali 2020년 10월 12일
HDLCoder does not currently support such customization. Fixed Point types generate DOWNTO syntax, and arrays including array of booleans generate TO syntax.
  댓글 수: 1
borzack
borzack 2020년 10월 12일
Ok thanks. Are there dedicate functions hdlcoder compatible to compare two boolean array?
if A==B ... end

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

추가 답변 (1개)

Kiran Kintali
Kiran Kintali 2020년 10월 12일
>> type compBoolVector.m
function y = compBoolVector(u, v)
y = all(u == v);
>>
>> a = true(1, 10); b = a; % create some example types
>> codegen -config:hdl -args{a, b} compBoolVector
(or)
>> c = coder.config('hdl');
>> codegen -config c -args {a, b} compBoolVector
### Begin VHDL Code Generation
### Generating HDL Conformance Report compBoolVector_hdl_conformance_report.html.
### HDL Conformance check complete with 0 errors, 0 warnings, and 0 messages.
### Working on compBoolVector as compBoolVector.vhd.
### Generating Resource Utilization Report resource_report.html.
Code generation successful.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by