anchor.diff:     f18A:step (F18A),
      f18A:stop (F18A,wait),
   
  -   Trace = trace:stop(),
  -
  -   ?assertEqual(ok,verify:compare(?WRITE_STEP,trace:extract(Trace,n001),noprint)).
  -
  -readwrite_test() ->
  -   log:info(?TAG,"-- READ/WRITE TEST"),
  +   check(waitall([]),
  +         [ { ?WRITE_STOP,n001 }
  +         ]).
  +
  +readwrite_go_test() ->
  +   M = setup("-- READ-WRITE TEST/GO"),
  +
  +   spawn(fun() ->
  +      F18A = f18A:create(n001,n002,[read,nop,nop,nop]),
  +      f18A:reset(F18A),
  +      f18A:go   (F18A,wait),
  +      M ! { n001,stopped }
  +      end),
  +
  +   spawn(fun() ->
  +      F18A = f18A:create(n002,n001,[nop,nop,{write,135},nop]),
  +      f18A:reset(F18A),
  +      f18A:go   (F18A,wait),
  +      M ! { n002,stopped }
  +      end),
  +      
  +   check(waitall([{n001,stopped},{n002,stopped}]),
  +         [ { ?READWRITE1,n001 },
  +           { ?READWRITE2,n002 }
  +         ]).
  +
  +readwrite_step_test() ->
  +   M = setup("-- READ-WRITE TEST/STEP"),
  +
  +   spawn(fun() ->
  +      F18A = f18A:create(n001,n002,[read,nop,nop,nop]),
  +      f18A:reset(F18A),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      M ! { n001,stopped }
  +      end),
  +
  +   spawn(fun() ->
  +      F18A = f18A:create(n002,n001,[nop,nop,{write,135},nop]),
  +      f18A:reset(F18A),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      M ! { n002,stopped }
  +      end),
  +      
  +   check(waitall([{n001,stopped},{n002,stopped}]),
  +         [ { ?READWRITE1,n001 },
  +           { ?READWRITE2,n002 }
  +         ]).
  +
  +writeread_go_test() ->
  +   M = setup("-- WRITE-READ TEST/GO"),
  +
  +   spawn(fun() ->
  +      F18A = f18A:create(n001,n002,[nop,nop,read,nop]),
  +      f18A:reset(F18A),
  +      f18A:go   (F18A,wait),
  +      M ! { n001,stopped } 
  +      end),
  +
  +   spawn(fun() ->
  +      F18A = f18A:create(n002,n001,[{write,135},nop,nop,nop]),
  +      f18A:reset(F18A),
  +      f18A:go   (F18A,wait),
  +      M ! { n002,stopped } 
  +      end),
  +      
  +   check(waitall([{n001,stopped},{n002,stopped}]),
  +        [ { ?WRITEREAD1,n001 },
  +          { ?WRITEREAD2,n002 }
  +        ]).
  +
  +writeread_step_test() ->
  +   M = setup("-- WRITE-READ TEST/STEP"),
  +
  +   spawn(fun() ->
  +      F18A = f18A:create(n001,n002,[nop,nop,read,nop]),
  +      f18A:reset(F18A),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      M ! { n001,stopped } 
  +      end),
  +
  +   spawn(fun() ->
  +      F18A = f18A:create(n002,n001,[{write,135},nop,nop,nop]),
  +      f18A:reset(F18A),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      f18A:step (F18A,wait),
  +      M ! { n002,stopped } 
  +      end),
  +      
  +   check(waitall([{n001,stopped},{n002,stopped}]),
  +        [ { ?WRITEREAD1,n001 }, 
  +          { ?WRITEREAD2,n002 } 
  +        ]).
  +
  +%% UTILILITY FUNCTIONS
  +
  +setup(TestName) ->
  +   log:info(?TAG,TestName),
      trace:stop (),
      trace:start(),
  -
  -   M = self(),
  -
  -   spawn(fun() ->
  -      F18A = f18A:create(n001,n002,[read,nop,nop,nop]),
  -      f18A:reset(F18A),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:stop (F18A,wait),
  -      M ! { n001,stopped }
  -      end),
  -
  -   spawn(fun() ->
  -      F18A = f18A:create(n002,n001,[nop,nop,{write,135},nop]),
  -      f18A:reset(F18A),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:stop (F18A,wait),
  -      M ! { n002,stopped }
  -      end),
  -      
  -   wait({n001,stopped}),
  -   wait({n002,stopped}),
  -
  -   Trace = trace:stop(),
  -
  -   ?assertEqual(ok,verify:compare(?READWRITE1,trace:extract(Trace,n001),noprint)),
  -   ?assertEqual(ok,verify:compare(?READWRITE2,trace:extract(Trace,n002),noprint)).
  -
  -writeread_test() ->
  -   log:info(?TAG,"-- WRITE/READ TEST"),
  -   trace:stop (),
  -   trace:start(),
  -
  -   M  = self(),
  -
  -   spawn(fun() ->
  -      F18A = f18A:create(n001,n002,[nop,nop,read,nop]),
  -      f18A:reset(F18A),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:stop (F18A,wait),
  -      M ! { n001,stopped } 
  -      end),
  -
  -   spawn(fun() ->
  -      F18A = f18A:create(n002,n001,[{write,135},nop,nop,nop]),
  -      f18A:reset(F18A),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:step (F18A,wait),
  -      f18A:stop (F18A,wait),
  -      M ! { n002,stopped } 
  -      end),
  -      
  -   wait({n001,stopped}),
  -   wait({n002,stopped}),
  -
  -   Trace = trace:stop(),
  -
  -   ?assertEqual(ok,verify:compare(?WRITEREAD1,trace:extract(Trace,n001),noprint)),
  -   ?assertEqual(ok,verify:compare(?WRITEREAD2,trace:extract(Trace,n002),noprint)).
  +   self().
  +
  +check(_Trace,[]) ->
  +   ok;
  +
  +check(Trace,[{Expected,ID}|T]) ->
  +   ?assertEqual(ok,verify:compare(Expected,trace:extract(Trace,ID),noprint)),
  +   check(Trace,T).
  +
  +waitall([]) ->
  +   trace:stop();
  +
  +waitall([H|T]) ->
  +   wait(H),
  +   waitall(T).
   
   wait(X) ->
      receive 
  
positive.code:             M ! { n001,stopped }
           end),
  
     wait({n001,stopped}),
     Trace = trace:stop(),
  
     ?assertEqual(ok,verify:compare(?GO,trace:extract(Trace,n001),noprint)).
  
  step_test() ->
     log:info   (?TAG,"-- STEP TEST"),
     trace:stop (),
     trace:start(),
  
     M    = self(),
     F18A = f18A:create(n001,n000,[nop,nop,nop,nop,nop]),
  
     spawn(fun() ->
  
negative.code:                           M    ! { n000,stopped }
                         end)),
     
     check(waitall([{n000,stopped},{n001,stopped}]),
           [ { ?READ,n001 }
           ]).
  
  
  read_step_test() ->
     M = setup("-- READ TEST/STEP"),
     util:unregister(n000),
  
     F18A = f18A:create(n001,n000,[read]),
  
     spawn(fun() ->
              f18A:reset(F18A),
              f18A:step (F18A,wait),
              f18A:step (F18A,wait),
              M ! { n001,stopped }
           end),
  
     register(n000,spawn(fun() ->
                            n001 ! { n000,write,678 },
                            wait({n001,read,ok}),
                            M    ! { n000,stopped }
                         end)),
     
     check(waitall([{n000,stopped},{n001,stopped}]),
           [ { ?READ,n001 }
           ]).
  
  write_go_test() ->
     M = setup("-- WRITE TEST/GO"),
     util:unregister(n000),
     util:unregister(n001),
  
     F18A = f18A:create(n001,n000,[{write,678}]),
     
     register(n000,spawn(fun() ->
  