xst synthesis with attributes failure

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I have the following code which errors in 8.1.3 sw :

the error is something like ..actual value associated with a generic must be
a globally static..

coef_2_rams              : for i in 0 to 17 generate -- bit
  attribute RAM_INIT of inst : label is coef_init_2(i);
    inst: RAMD_OPREG
      generic map (
        RAM_INIT => inst'RAM_INIT
      port map (
          WADDR(3 downto 2) => "00",
          WADDR(1 downto 0) =>  etc

this is the logic being instantiated :

 a_core : if true generate
attribute INIT of ramd : label is RAM_INIT;
  ramd : RAM16X1D
    generic map (
      INIT => str2suv(ramd'INIT)  <<<< here is the problem
    port map (
      a0    => WADDR(0),
      a1    => WADDR(1),
      a2    => WADDR(2),
        a3    => WADDR(3),

str2suv is a function to convert a string to a logic_vector. This works if I
do   INIT => str2suv(RAM_INIT)

The problem looks to be the ramd'INIT I think.

The reason for doing this is to get a synthesis attibute and a generic for
simulation without the error prone typing the value twice. The code compiles
under Mentor Precision - and needs to keep doing so. Any ideas ?

The only solution I can think of it to have both :

 attribute RAM_INIT of inst : label is coef_init_2(i)

*** and ***

RAM_INIT => coef_init_2(i)

Thanks for any ideas - and if XST people are reading this, any idea when
this feature will be included ?? I have a very large number of these to
change otherwise ...


Re: xst synthesis with attributes failure
On Wed, 09 Aug 2006 22:40:27 GMT, "MikeJ"

Quoted text here. Click to load it

Presumably this is the architecture for RAMD_OPREG, and RAM_INIT is a
generic in RAMD_OPREG's entity declaration? If so, then it does look
like XST has got this wrong.

For the actual to be globally static -

1 - str2suv must be pure; XST presumably agrees that it is pure, since
it allows:

Quoted text here. Click to load it

2 - ramd'INIT must also be globally static, which it is if INIT is a
user-defined attribute and its value is the RAM_INIT generic.

My guess is that XST is assuming that a function call actual which is
the value of a user-defined attribute is never globally static. It
should be straightforward to generate a test case for this.

Your code looks overly complicated to me, but perhaps I haven't
understood it. My own work-around would be:

1 - change

Quoted text here. Click to load it

  attribute NEW_RAM_INIT of inst : label is str2suv(coef_init_2(i));
(or just get coef_init_2 to return the required type)

2 - pass inst'NEW_RAM_INIT as the value of the generic, and
3 - pass the new generic directly as the value of INIT to RAM16X1D



Re: xst synthesis with attributes failure
Hi Evan, thanks for your response.

The code was originally written for the Leonardo synthesiser, and at the
time the synthesis attribute needed to be given as a string, but the
simulation generic was a ulogic_vector. (We wrote our own simulation models
for the primitives to support ulogic).
Most of the INITs are static "2345" etc so to avoid possible errors between
synthesis and simulation the 'init trick works quite well.

until XST that is ....

in this case RAM16X1D is a xilinx primitive, so I would have to put the
"1234" in the generic as well I guess.

a_core : if true generate
Quoted text here. Click to load it

For XST I think (I will test this) the generic on it's own will give the
correct synthesis result, but then I can't run it through Leonardo again.

Re: xst synthesis with attributes failure
found one solution, adding -- pragmas to stop XST seeing the problem :)

attribute INIT  of mux4_lut1 : label is "00CA";

  mux4_lut1:  LUT4
    --pragma translate_off
    generic map (
      lut => str2suv(mux4_lut1'INIT)
    --pragma translate_on
    port map (
        I0 => DIN0(i),

Site Timeline