Hi everyone,
I have been searching over the net, university library, ebooks, etc. but i cudnt really find any example of mixed VHDL models in which both structural and behavioral models are used together. I have a model, as I show below which is composed of one behavioral part and structural part but, whenever I try test it, I always receive incorrect results. Cud somebody please help me with it?
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use work.Components.all;
entity Deneme is
generic ( n: natural := bitSize );
port ( x, y, m : in std_logic_vector ( n-1 downto 0 );
clk, rst: in std_logic;
product1, product2 : out std_logic_vector ( n downto 0 )
);
end Deneme;
architecture Behavioral of Deneme is
signal s, c, regSum, regCarry : std_logic_vector ( n downto 0 ) :=( others => '0' );
signal pp, uM : std_logic_vector ( n downto 0 ) :=( others => '0' );
signal sFa, cFa, u : std_logic;
signal i: integer range 0 to n-1;
begin
process ( clk )
begin
if ( clk'event and clk='1' ) then
if ( rst='0' ) then
i <= 0 ;
u <= '0' ;
pp <= ( others => '0' );
uM <= ( others => '0' );
product1 <= ( others => '0' );
product2 <= ( others => '0' );
else
if ( i < n-1 ) then
pp <= ('0' & andVecIndex( x, i, y ));
u <= pp(0) xor s(0);
uM <=('0'& andVecScalar( u, m ));
i <= i + 1;
else
i <= 0;
end if;
end if;
end if;
end process;
f1: FA port map( s(0), pp(0), uM(0), sFa, cFa );
c1: CSA port map ( s( n downto 1), c( n downto 1), pp( n downto 1), uM(n downto 1), cFa, regSum, regCarry );
R1: Reg port map ( clk, rst, regSum, s);
R2: Reg port map ( clk, rst, regCarry, c);
product1 <= s;
product2 <= c;
end Behavioral;
I have been searching over the net, university library, ebooks, etc. but i cudnt really find any example of mixed VHDL models in which both structural and behavioral models are used together. I have a model, as I show below which is composed of one behavioral part and structural part but, whenever I try test it, I always receive incorrect results. Cud somebody please help me with it?
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use work.Components.all;
entity Deneme is
generic ( n: natural := bitSize );
port ( x, y, m : in std_logic_vector ( n-1 downto 0 );
clk, rst: in std_logic;
product1, product2 : out std_logic_vector ( n downto 0 )
);
end Deneme;
architecture Behavioral of Deneme is
signal s, c, regSum, regCarry : std_logic_vector ( n downto 0 ) :=( others => '0' );
signal pp, uM : std_logic_vector ( n downto 0 ) :=( others => '0' );
signal sFa, cFa, u : std_logic;
signal i: integer range 0 to n-1;
begin
process ( clk )
begin
if ( clk'event and clk='1' ) then
if ( rst='0' ) then
i <= 0 ;
u <= '0' ;
pp <= ( others => '0' );
uM <= ( others => '0' );
product1 <= ( others => '0' );
product2 <= ( others => '0' );
else
if ( i < n-1 ) then
pp <= ('0' & andVecIndex( x, i, y ));
u <= pp(0) xor s(0);
uM <=('0'& andVecScalar( u, m ));
i <= i + 1;
else
i <= 0;
end if;
end if;
end if;
end process;
f1: FA port map( s(0), pp(0), uM(0), sFa, cFa );
c1: CSA port map ( s( n downto 1), c( n downto 1), pp( n downto 1), uM(n downto 1), cFa, regSum, regCarry );
R1: Reg port map ( clk, rst, regSum, s);
R2: Reg port map ( clk, rst, regCarry, c);
product1 <= s;
product2 <= c;
end Behavioral;