schouten_tjeerd
Newbie level 5
xilinx floating point
I can't figure out how to implement the Xilinx CoreGen generated code. I want to do some floating point operations (let's say a division). I am only interested in synthesizing my vhdl code and making the FPGA actually doing something, simulation is not used.
This is what I have found out so far:
-Using ISE WebPack 10.1 generate a core:
-Project->New source->IP (CORE Generator & Architecture Wizard)
-Enter file name and tick "Add to project"
-Math functions->Floating-point v3.0
-Select the divide funtion, single precision, no extra signals
-This adds an *.xco file to the project.
-Select the xco file in the sources window, then expand "CORE Generator" in the "Processes for" window.
-Double click "View HDL Functional Model", this will open the *.vhd file from the core. Some interesting code...
Now allow me be really simple minded to make the point.
I have this code:
And it gives me this error:
Operator <DIVIDE> must have constant operands or first operand must be power of 2
I am sure this has to do with me failing to actually link the core in some way to my code. So my question is: how do I do this?
I can't figure out how to implement the Xilinx CoreGen generated code. I want to do some floating point operations (let's say a division). I am only interested in synthesizing my vhdl code and making the FPGA actually doing something, simulation is not used.
This is what I have found out so far:
-Using ISE WebPack 10.1 generate a core:
-Project->New source->IP (CORE Generator & Architecture Wizard)
-Enter file name and tick "Add to project"
-Math functions->Floating-point v3.0
-Select the divide funtion, single precision, no extra signals
-This adds an *.xco file to the project.
-Select the xco file in the sources window, then expand "CORE Generator" in the "Processes for" window.
-Double click "View HDL Functional Model", this will open the *.vhd file from the core. Some interesting code...
Now allow me be really simple minded to make the point.
I have this code:
Code:
--/////////////////////////////////////////////////////////////
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.numeric_std.all;
entity testfile is
Port ( input_vector : in STD_LOGIC_VECTOR (7 downto 0);
output_vector : out STD_LOGIC_VECTOR (7 downto 0));
end testfile;
architecture Behavioral of testfile is
begin
test_process : process is
variable temp_int : integer;
variable temp_real : real;
variable temp_real2 : real;
begin
--get the input
temp_int := conv_integer(input_vector);
temp_real := real(temp_int);
temp_real2 := temp_real / 5.3;
--dump the output
temp_int := integer(temp_real2);
output_vector <= std_logic_vector(to_unsigned(temp_int, 8));
end process test_process;
end architecture Behavioral;
----/////////////////////////////////////////////////////////////
Operator <DIVIDE> must have constant operands or first operand must be power of 2
I am sure this has to do with me failing to actually link the core in some way to my code. So my question is: how do I do this?