UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor asterix80
Visitor
4,603 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
Newbie soroush_srg
Newbie
4,936 Views
Registered: ‎07-03-2010

Re: Problem to Generate code with System Generator

Jump to solution

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:

0 Kudos
2 Replies
Newbie doknifgan
Newbie
4,567 Views
Registered: ‎02-22-2010

Re: Problem to Generate code with System Generator

Jump to solution

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
Newbie soroush_srg
Newbie
4,937 Views
Registered: ‎07-03-2010

Re: Problem to Generate code with System Generator

Jump to solution

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:

0 Kudos