romikot
Newbie level 6
Hi
I just wrote some program in vhdl(using only behavioral code), i wanted that the program will work only in simulation.
But the funny thing that happened is that the code is synthesizeble without errors or warnings.
But than i simulate its not doing whats it's supposed to do.
after a few simulation i realized that there is one line of code that the program not doing!!!
Ill post the code and highlight the line that is not being done, perhaps i missing something (although its been synthesized without warnnings).
Im must say that i new to vhdl. and know only basic stuff, i dont know how to do a test bench. i just going to the isim and forcing values and clock(im sure i doing it right ).
Will apriciate any help.
thanks
I just wrote some program in vhdl(using only behavioral code), i wanted that the program will work only in simulation.
But the funny thing that happened is that the code is synthesizeble without errors or warnings.
But than i simulate its not doing whats it's supposed to do.
after a few simulation i realized that there is one line of code that the program not doing!!!
Ill post the code and highlight the line that is not being done, perhaps i missing something (although its been synthesized without warnnings).
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_unsigned.all;
use IEEE.NUMERIC_STD.ALL;
entity bindiv is
Port ( mispar : in STD_LOGIC_VECTOR (4 downto 0);
mehalek : in STD_LOGIC_VECTOR (4 downto 0);
moza : out STD_LOGIC_VECTOR (4 downto 0);
reset: in std_logic;
clk : in STD_LOGIC);
end bindiv;
architecture Behavioral of bindiv is
signal hishuvim : std_logic_vector (8 downto 0) :=(others => '0');
signal mikum : integer range 4 downto 0 :=4 ;
begin
process(clk)
begin
if clk'event and clk='1' then
if reset='1' then
hishuvim(4 downto 0)<=mispar;
hishuvim(8 downto 5)<=(others => '0');
mikum<=4;
else
if mehalek>hishuvim(8 downto 4) then
moza(mikum)<='0';
else
moza(mikum)<='1';
[SIZE=3]hishuvim(8 downto 4)<=hishuvim(8 downto 4)- mehalek(4 downto 0);--this line isnt working [/SIZE]
end if;
mikum<=mikum-1 ;
hishuvim <= hishuvim(7 downto 0) & '0';
end if;
end if;
end process;
end Behavioral;
Will apriciate any help.
thanks