1
 when f9 =>
       if melcol < 128 and framcounter < 2560 then
           temp <= std_logic_vector(signed(framout)*to_signed(melf(melrow,melcol),8));
           firstmelout <= firstmelout + (to_integer(unsigned(temp)))/1000;
           melcol <= melcol+1;
           framcounter <= framcounter+1;
           fstate <= f9;
       elsif melcol = 128 and melrow < 13 and framcounter < 2560 then
           -----MEMORY NEEDED
           framcounter <= framcounter -128;
           melrow <= melrow+1;      --melrow filter number
           melcol <= 0;
           secondmelout <= firstmelout;
           fstate <= f10;
       elsif melcol = 128 and melrow = 13 and framcounter < 2560 then
           ---------MEMORY NEEDED
           framcounter <= framcounter +128;
           melrow <= 0;
           melcol <= 0;
           secondmelout <= firstmelout;
           fstate <= f10;
       elsif framcounter = 2560 then
           flagmel <= '1';
           fstate <= f12;
       else fstate <= f12;
       end if;

   when f10 =>
       varmel <= real(secondmelout);
       --varmel := LOG10(firstmelout);
       --varlogresult := 100*varlogresult;
       wea3(0) <= '1';
       --logresult <= intlogresult;
       fstate <= f11;

我在将非常数整数转换为实数时遇到问题。我想取 firstmelout 的 log10,但需要真正的类型。因此,我尝试使用“real()”将其转换为真实,但 Vivado 返回此错误消息;不支持非常量实值表达式

我尝试了很多东西,但我无法解决它,我正在等待你的帮助,非常感谢。

4

1 回答 1

1

real如评论中所述,您应该根据可综合的定点或浮点类型定义逻辑,而不是使用综合应用程序的类型。您可能会发现,在更改逻辑以使用这些新类型的过程中,您需要重新考虑如何实现您想要实现的目标。

正如其他人在评论中所述,请查看以下资源:

于 2015-12-28T18:39:22.137 回答