[an error occurred while processing this directive]
|
Белый и пушистый процесс :))
process
begin
wait until RISING_EDGE(GCLK1);
test := tstCounter(test);
end process;
По каждому положительному фронту GCLK1: ...,0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,0,...
А этот спит зубами к стенке :)
process (GCLK1)
begin
test := tstCounter(test);
end process;
Такое впечатление, что с GCLK1 он не завязан.
Счетчик выдает бред типа ...,0,2,0,1,0,2,1,0,2,0,3,1,0,... меняясь каждые 2-4 ns...
Бред, видимо от наложения процесса, на своих предшественников :)
Почему такое происходит?
Функция инкрементации.
function tstCounter (counter: in std_logic_vector) return std_logic_vector is
variable tmp: std_logic_vector (counter'left to counter'right);
variable carry : boolean := true;
begin
for i in counter'left to counter'right loop
if counter(i) = '1' and carry then
tmp(i) := '0';
carry := true;
elsif counter(i) = '0' and carry then
tmp(i) := '1';
carry := false;
else
tmp(i) := counter(i);
end if;
end loop;
return tmp;
end;
E-mail: info@telesys.ru