I know. The non-synthesised code is:
curr_xV : in float( 8 downto -23 );
xV : in float( 8 downto -23 );
d1 : out float( 8 downto -23 ) ;
Which synthesises to a code with:
curr_xV : in STD_LOGIC_VECTOR ( 8 downto -23 );
xV : in STD_LOGIC_VECTOR ( 8 downto -23 );
d1 : out STD_LOGIC_VECTOR ( 8 downto -23 ) ;
So, the synthesiser is changing it, not me. This is the code post-synthesis, post-map:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
library SIMPRIM;
use SIMPRIM.VCOMPONENTS.ALL;
use SIMPRIM.VPACKAGE.ALL;
entity float_point_package_module is
port (
clk : in STD_LOGIC := 'X';
enable : in STD_LOGIC := 'X';
curr_xV : in STD_LOGIC_VECTOR ( 8 downto -23 );
xV : in STD_LOGIC_VECTOR ( 8 downto -23 );
d1 : out STD_LOGIC_VECTOR ( 8 downto -23 )
);
end float_point_package_module;
architecture Structure of float_point_package_module is
signal STARTUP_V6_PWRUP_GTXE1_ML_INSERTED_ML_CFGMCLK_SIG : STD_LOGIC;
signal STARTUP_V6_PWRUP_GTXE1_ML_INSERTED_EOS : STD_LOGIC;
signal STARTUP_V6_PWRUP_GTXE1_ML_INSERTED_DINSPI : STD_LOGIC;
signal STARTUP_V6_PWRUP_GTXE1_ML_INSERTED_PREQ : STD_LOGIC;
signal STARTUP_V6_PWRUP_GTXE1_ML_INSERTED_TCKSPI : STD_LOGIC;
signal STARTUP_V6_PWRUP_GTXE1_ML_INSERTED_CFGCLK : STD_LOGIC;
signal GND : STD_LOGIC;
signal VCC : STD_LOGIC;
begin
NlwBlock_float_point_package_module_GND : X_ZERO
port map (
O => GND
);
NlwBlock_float_point_package_module_VCC : X_ONE
port map (
O => VCC
);
NlwBlockROC : X_ROC
generic map (ROC_WIDTH => 100 ns)
port map (O => GSR);
NlwBlockTOC : X_TOC
port map (O => GTS);
end Structure;
- - - Updated - - -
Pre-synthesis is:
library std;
library IEEE;
library ieee_proposed;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use std.textio.all;
use ieee_proposed.fixed_float_types.all;
use ieee_proposed.fixed_pkg.all;
use ieee_proposed.float_pkg.all;
--use IEEE.NUMERIC_STD.ALL;
entity float_point_package_module is
port(
clk : in STD_LOGIC;
enable : in STD_LOGIC;
curr_xV : in float(8 downto -23);--REAL;
xV : in float(8 downto -23);--REAL;
d1 : out float(8 downto -23));
end float_point_package_module;
architecture Behavioral of float_point_package_module is
constant tau : integer := 4;
type array_float_small is array (0 to 6) of float(8 downto -23);
--type array_d1temp is array (0 to 2007) of float(8 downto -23);
type array_float_big is array (0 to 2047) of float(8 downto -23);
type array_float is array (0 to 2007) of float(8 downto -23);
signal read_enable, calc_enable,write_enable : STD_LOGIC := '0';
signal array_curr_xV : array_float_small;
signal array_xV : array_float_big;
-- signal array_d1 : array_float;
--signal endoffile : bit := '0';
-- signal linenumber : integer:=1;
begin
process(clk)
variable i,k,index : integer := 0;
variable d1temp : float(8 downto -23) :=(others=>'0');
variable d1_fixed : array_float :=((others=> (others=>'0')));
file outfile : text is out "./TestFiles/d1_1.txt"; --declare output file
variable outline : line; --line number declaration
begin
if (clk'event and clk = '1') then--or (enable'event and enable = '1') then
if enable = '1' then
read_enable <= '1';
end if;
if read_enable = '1' then
read_enable <= '1';
if(i<=6)then
array_curr_xV(i) <= curr_xV;
end if;
array_xV(i) <= xV;
i := i+1;
if(i = 2048)then
read_enable <= '0';
i := 0;
calc_enable <= '1';
end if;
elsif calc_enable = '1' then
d1temp := (array_curr_xV(k)-array_xV(i+k*tau))*(array_curr_xV(k)-array_xV(i+k*tau));
d1_fixed(i) := d1_fixed(i) + d1temp;
i := i +1;
if(i = 2008 and k < 6)then
i := 0;
k := k+1;
elsif(i=2008 and k=6)then
i := 0;
k := 0;
calc_enable <= '0';
write_enable <= '1';
end if;
elsif write_enable = '1' then
-- for i in 0 to 2007 loop
d1 <= d1_fixed(index);
----------------------------ADDED FOR TEST PURPOSES------------------------
-- if(endoffile='0') then --if the file end is not reached.
-- write(outline, to_real(d1_fixed(index),false,false), right, 10); --to_real for lesbare tall
-- writeline(outfile, outline);
-- linenumber <= linenumber + 1;
-- else
-- null;
-- end if;
-------------------------------END TEST PURPOSES---------------------------
index := index+1;
--end loop;
if(index = 2008)then
index := 0;
write_enable <= '0';
end if;
end if;
end if;
end process;
end Behavioral;
The modulename_synthesis-file has the same entity declaration, but it is 120 075 lines long, so I won't post it here for readability,.