'EVENT attribute.


Subject: 'EVENT attribute.
dmsidorov@mtu-net.ru
Date: Tue Apr 17 2001 - 13:11:56 MDT


Hi!

In the next code cc<=cc+1 in the line 16
never will be done because the
CK'event newer will be occured. Why?
CK assign have been done before ck'event checking.

With regards,
Dmitry B. Sidorov.

---------------------- CUT HERE --------------------
library std;
use std.textio.all;

entity ts7 is
end ts7;

architecture behav of ts7 is
  signal CK : bit := '0'; -- clock
  signal s1, cc : integer := 0;
begin
  -- clock processing
  clock : process
  begin
    ck <= not ck;
    if (CK'event and CK = '1') then -- CK'event newer will be occured!
      cc <= cc + 1; -- clock counter
    end if;
    wait for 1 us;
  end process;
  -- output
  output : process (CK)
    file RESULT_FILE : text open write_mode is "../ts7.out";
    variable myout : line;
  begin
    s1 <= s1 + 1;
    write (myout, cc); write (myout, '_'); write (myout, s1);
    writeLine (RESULT_FILE, myout);
  end process;
end behav;



This archive was generated by hypermail 2b25 : Mon Mar 18 2002 - 13:00:01 MST