Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Vivado - math.real support

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
Hello,

Is it true that Vivado doesn't support the math.real VHDL library ?
 

Do to what?
No Synth tools support ieee.math_real for synthesisable constructs.
 

Other than look-up tables, the CORDIC core can be used if it serves your purpose .
 

Did you find the answer to the original question? It sounds pitiful that Vivado should not provide ieee.math.real for compile time calculations as state-of-the-art tools use to. However, even if math_real.vhd is not shipped with the compiler, it's just a text file that can be added to your project.
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
In situations like this, wouldnt it have been much easier and quicker just to create a small design example and test for yourself? I suspected the Vivado answer you posted was related to synthesis of stuff like registers using the real data type, not constants or setup. Otherwise it would have been out of step with many other synthesisor and Im sure someone would have picked it up.


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;
 
entity rom_test is
  port (
    clk     : in  std_logic;
 
    addr    : in  std_logic_vector(7 downto 0);
    data    : out std_logic_vector(7 downto 0)
  );
end entity rom_test;
 
architecture rtl of rom_test is
  type rom_t is array(0 to 255) of std_logic_vector(7 downto 0);
 
  function set_rom return rom_t is
    variable ret    : rom_t;
  begin
    for i in ret'range loop
      ret(i)     := std_logic_vector( to_unsigned( Integer( 256.0*sin(real(i)*MATH_PI/256.0)), 8 ) );
    end loop;
 
    return ret;
  end function set_rom;
 
  constant rom_val  : rom_t := set_rom;
begin
 
  process(clk)
  begin
    if rising_edge(clk) then
      data  <= rom_val( to_integer( unsigned(addr) ) );
    end if;
  end process;
 
end architecture rtl;

 

Attachments

  • rom.png
    rom.png
    14.4 KB · Views: 81

You assume that I simply stumbled upon the post in #3 and decided to ask here - I'm not that lazy...

I'm in the process of migrating a design from Altera to Xilinx and in one of my source files "math.real" is included.
As you probably know - Vivado does live parsing tests on any file you add to the project (without actually compiling it). The line marked with "math.real" is highlighted as error in the Vivado text editor.

I'm using verstion 2017.2 - Is it possible that you're using something newer ?
 

Attachments

  • Untitled.png
    Untitled.png
    30.3 KB · Views: 75
Last edited:

2017.2 aswell
I dont use the internal text editor, so didnt notice the "errors"
I get the same red highlighting, but it compiles without a problem.
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top