Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Problem with black box in Matlab System generator

Status
Not open for further replies.

Serwan Bamerni

Member level 2
Joined
Dec 21, 2014
Messages
45
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
367
I using Xilinx system generator blocks in Matlab.

I simply using only a black box with a gateway in and gateway out.

The code for the black box is very simple and work correctly with ISE design suite

Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.ALL;

entity test44_vhdl is
    Port ( row : in  std_logic_vector (1 downto 0);
           slice : out  std_logic_vector (3 downto 0));
end test44_vhdl;

architecture Behavioral of test44_vhdl is

type oneD is array (1 to 3) of integer range 0 to 15;
constant table: oneD := (3, 9, 13);

begin

    slice <= std_logic_vector(to_unsigned(table(to_integer(unsigned(row))), slice'length));

end Behavioral;

but unfortunately it doesn't work with the matlab system generator.

I got the following error message

Exception: ISE Simulator Simulation failed during initialization.

can any one help me what is the wrong with this code and what change should I do so the model work correctly
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,099
Helped
2,079
Reputation
4,177
Reaction score
2,041
Trophy points
1,393
Activity points
39,643
Are you sure that is the only message?

- - - Updated - - -

PS. If row comes in as "00", you will have an error during simulation as the table you have doesnt have an entry for 0. When the design is elaborated, unless you initialise the connection to row otherwise, it will start as "UU" which will get converted to "00" during the table lookup, causing an error.
 

Serwan Bamerni

Member level 2
Joined
Dec 21, 2014
Messages
45
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
367
thank you brother for your reply

you right, I don't have a value assigned to the table when row is "00"

I just assign a value to the table at 00 and now the model work correctly

Code:
type oneD is array (0 to 3) of integer range 0 to 15;
constant table: oneD := (3, 9, 13, 6);
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top