cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
5,045 Views
Registered: ‎11-24-2009

Problem to Generate code with System Generator

Jump to solution

hi,

 

ich have a big problem to Generate a VHDL code From Mcode, ich wrote a Simple Program for test.the Program is a Single Port RAM like This :

 

proto={xlSigned,nbits,binpt}

persistent mem,mem=xl_state(zeros (1,depth),porto);

dout=mem(addr);

if we

mem(addr)=din;

end

 

the Programm works on the Simultion under Simulink (with xilin Mcode Block) no problems, but when i want to create a VHDL code with systemgenrator it shows me this Message:

 

Cannot map persistent variable mem to hardware possibly because: encountered method subref at line 64:21, the subref is invoked before this point. Please reference user manual.

 

Thank you for your help!

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Newbie
Newbie
5,378 Views
Registered: ‎07-03-2010

Hi this is my problem too.

when I try to use the addrsr (sample code of xilinx for addressable shift register with M_Code block) this error occurred.

when I changed compilation type in system generator configuration to bitstream it worked.

:smileyhappy:

View solution in original post

0 Kudos
2 Replies
Highlighted
Newbie
Newbie
5,009 Views
Registered: ‎02-22-2010

Hi,

I have the same problem with M-CODE, I always get this error

Cannot map persistent variable mem to hardware possibly because: encountered method subref at line 9:14, the subref is invoked before this point. Please reference user manual.

I try to read with  another index

the Code:

 

function [dout] = ram(addr, we, din, depth, nbits, binpt)

proto = {xlSigned, nbits, binpt};
 persistent mem, mem = xl_state(zeros(1, depth), proto);


  dout = mem(100);
  if we==1
    mem(addr) = din;
  end

 

thanks for the help.
0 Kudos
Highlighted
Newbie
Newbie
5,379 Views
Registered: ‎07-03-2010

Hi this is my problem too.

when I try to use the addrsr (sample code of xilinx for addressable shift register with M_Code block) this error occurred.

when I changed compilation type in system generator configuration to bitstream it worked.

:smileyhappy:

View solution in original post

0 Kudos