Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Visitor
asterix80
Posts: 2
Registered: ‎11-24-2009
0
Accepted Solution

Problem to Generate code with System Generator

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!

 

 

Newbie
doknifgan
Posts: 1
Registered: ‎02-22-2010
0

Re: Problem to Generate code with System Generator

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.
Newbie
soroush_srg
Posts: 1
Registered: ‎07-03-2010
0

Re: Problem to Generate code with System Generator

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: