MATLAB Answers

Sela
0

error input uint8 simulink

Asked by Sela
on 3 Oct 2017
Latest activity Edited by Sela
on 5 Oct 2017
Hi everybody,
I want to design a simple digital systen with Simulink in order to:
1. simulate its behaviour with Matlab
2. generate the VHDL code for a FPGA synthesis.
I would use the same system design to simulation and generation but to simulate with Matlab I must stimulate my circuit with input block (in1) using a "double" data type, instead to generate VHDL code I must use in1 with data type "uint8".
Example:
a = [0 1 1 1 0 0 0 1 0 1];
in1 = uint8(a);
If I try to simulate on Matlab that code with I have this error :
"Input format not supported. Available formats include: (1) a Simulink.SimulationData.Dataset object, (2) a double non-complex matrix, (3) a structure with or without time, (4) a MATLAB timeseries object, (5) a structure with MATLAB timeseries objects at all leaves (for bus input). All formats require the data to be finite (not Inf or NaN)."
Is it not possible use the same configuration to simuate and generate HDL code?
Could you help me please?

  0 Comments

Sign in to comment.

4 Answers

Answer by Sela
on 5 Oct 2017
Edited by Sela
on 5 Oct 2017
 Accepted Answer

Hi, the solution is to define a structure of time :
a = [0 1 0 1 0 1 0 1]; in1 = uint8(a); s.time = 0 ; s.signals.values = in1;
and change the input in the configuration to "s" instead of "in1".
Thanks to everyone

  0 Comments

Sign in to comment.


Answer by Walter Roberson
on 3 Oct 2017

I am not sure which block you are using in Simulink, but From Workspace requires that that time information be available somehow . The time can be explicit like a timeseries object, or a structure in the proper format with the proper fields. For arrays, the time is taken from the first column of the data -- but in such cases the array must be double because times must be double.
From Workspace blocks are not able to import "just plain data". From Workspace blocks are intended to deliver data at a particular time: they are blocks for execution of a model, where as importing plain data is something that would be used in a procedural language.

  2 Comments

Sela
on 3 Oct 2017
thanks for your answer. My input is the block In1 from HDL Coder 3. I can't put my input in double because after I need to you use it with HDL(HDL not support double). I have also tried with a constant (data type uint8) but it is not working too. Can you explain me what I am supposed to change, please? What block should I take?
I am not very familiar with the process. Generally you would mark data into the HDL or data out of the HDL as a signal. You would generally generate some input condition outside the HDL to trigger action, and several cycles later you would get an output from the HDL. There is an example at https://www.mathworks.com/help/hdlcoder/examples/running-an-audio-filter-on-live-audio-input-using-a-zynq-board.html

Sign in to comment.


Answer by Bharath Venkataraman on 4 Oct 2017

You can try using the Signal From Workspace block instead. I think this may work better with your data.

  0 Comments

Sign in to comment.


Answer by Kiran Kintali on 5 Oct 2017

can you please share your matlab code or simulink model?

  0 Comments

Sign in to comment.