E
erman koseoglu
Guest
process(clkin)
variable used : STD_LOGIC_VECTOR(1000 to 9999):= (others => '0');
variable f : integer :=1000;
variable t : integer :=1000;
variable delayClock: integer :=0;
variable tb,fb : STD_LOGIC_VECTOR(15 downto 0);
begin
if(rising_edge(clkin) and clkin='1') then
--guessing mode
if feedbackEntry_button='1' then
tb:=bcdFromInteger(t);
if (tb(3 downto 0)/=fb(3 downto 0)) then
used(t):='1';
end if;
if(t<9999) then
t:=t+1;
end if;
else
t:=1000;
fb:=bcdFromInteger(f);
if(used(f)='1') then
f:=f+1;
end if;
end if;
--clock divider
delayClock:=delayClock+1;
if(delayClock>1500) then
delayClock:=0;
end if;
if(delayClock=0) then
myClock<=not myClock;
end if;
o<=f;
end if;
end process;
this proces causes synthesis problem(it is stuck in infinite loop)
what the program does(should do) is it guesses a 4 digit number "f" from solution set "used". When the feedbacketrybutton is pressed(and hold) program iterates from 1000 to 9999 (variable t) and compares the t with f. if their first digit(first 4 bit in bcd format) aren't same but should be(according to feedbackswitch(0)='1') then it eliminates t from solution set.
why can't xilinx find a design to implement it and how can i improve my code.
thanks in advance
variable used : STD_LOGIC_VECTOR(1000 to 9999):= (others => '0');
variable f : integer :=1000;
variable t : integer :=1000;
variable delayClock: integer :=0;
variable tb,fb : STD_LOGIC_VECTOR(15 downto 0);
begin
if(rising_edge(clkin) and clkin='1') then
--guessing mode
if feedbackEntry_button='1' then
tb:=bcdFromInteger(t);
if (tb(3 downto 0)/=fb(3 downto 0)) then
used(t):='1';
end if;
if(t<9999) then
t:=t+1;
end if;
else
t:=1000;
fb:=bcdFromInteger(f);
if(used(f)='1') then
f:=f+1;
end if;
end if;
--clock divider
delayClock:=delayClock+1;
if(delayClock>1500) then
delayClock:=0;
end if;
if(delayClock=0) then
myClock<=not myClock;
end if;
o<=f;
end if;
end process;
this proces causes synthesis problem(it is stuck in infinite loop)
what the program does(should do) is it guesses a 4 digit number "f" from solution set "used". When the feedbacketrybutton is pressed(and hold) program iterates from 1000 to 9999 (variable t) and compares the t with f. if their first digit(first 4 bit in bcd format) aren't same but should be(according to feedbackswitch(0)='1') then it eliminates t from solution set.
why can't xilinx find a design to implement it and how can i improve my code.
thanks in advance