Добрый вечер, было уже когда-то похожая проблема но сейчас уже не помню с чем связана.
В итоге есть код:
Код
function read_bit(signal RX, SCK:std_ulogic) return bit is
variable read_data: Std_uLogic_Vector ( 4 downto 0);
variable current_bit : bit;
begin
for i in 0 to 4 loop
if(rising_edge(SCK)) then
read_data(i) := RX;
end if;
end loop;
if (read_data = "00000") then current_bit:='0';
elsif (read_data = "00001") then current_bit:='0';
elsif (read_data = "00010") then current_bit:='0';
elsif (read_data = "00011") then current_bit:='0';
elsif (read_data = "00100") then current_bit:='0';
elsif (read_data = "00101") then current_bit:='0';
elsif (read_data = "00110") then current_bit:='0';
elsif (read_data = "00111") then current_bit:='1';
elsif (read_data = "01000") then current_bit:='0';
elsif (read_data = "01001") then current_bit:='0';
elsif (read_data = "01010") then current_bit:='0';
elsif (read_data = "01011") then current_bit:='1';
elsif (read_data = "01100") then current_bit:='0';
elsif (read_data = "01101") then current_bit:='1';
elsif (read_data = "01110") then current_bit:='1';
elsif (read_data = "01111") then current_bit:='1';
elsif (read_data = "10000") then current_bit:='0';
elsif (read_data = "10001") then current_bit:='0';
elsif (read_data = "10010") then current_bit:='0';
elsif (read_data = "10011") then current_bit:='1';
elsif (read_data = "10100") then current_bit:='0';
elsif (read_data = "10101") then current_bit:='1';
elsif (read_data = "10110") then current_bit:='1';
elsif (read_data = "10111") then current_bit:='1';
elsif (read_data = "11000") then current_bit:='0';
elsif (read_data = "11001") then current_bit:='1';
elsif (read_data = "11010") then current_bit:='1';
elsif (read_data = "11011") then current_bit:='1';
elsif (read_data = "11100") then current_bit:='1';
elsif (read_data = "11101") then current_bit:='1';
elsif (read_data = "11110") then current_bit:='1';
elsif (read_data = "11111") then current_bit:='1';
end if;
return current_bit;
end;
begin
process (SCK,RX)
variable current_bit:bit;
variable read_data: Std_uLogic_Vector ( 4 downto 0);
begin
if (falling_edge(RX)) then
current_bit:=read_bit(RX,SCK);
current_bit:=read_bit(RX,SCK);
DATA <= "0000000000000000000000000000000000000000000000000000000000000000000000000000
000"&to_stdulogic(current_bit);
end if;
end process;
И получаю ошибку
line 57: Signal read_data1<0> cannot be synthesized, bad synchronous description. The description style you are using to describe a synchronous element (register, memory, etc.) is not supported in the current software release.. Подскажите в чем дело. Тема похожая уже здесь была, я ее просматривал но осознать как подправить код не смог(. Спасибо.
P.S. про жуткий способ вычисления current_bit знаю, просто я игрался с ошибкой что-бы понять в чем дело.
Сообщение отредактировал h0t - Feb 4 2012, 18:28