Re: sc_event_and/or_list

From: <john.aynsley@doulos.com>
Date: Tue Oct 12 2010 - 07:22:09 PDT

Philipp, Tor,

Any response to this? The clock is ticking...

Thanks,

John A

From:
john.aynsley@doulos.com
To:
systemc-p1666-technical@eda.org
Date:
07/10/2010 09:58
Subject:
sc_event_and/or_list
Sent by:
owner-systemc-p1666-technical@eda.org

(This message seems to have got lost first-time-around)

Philipp, All,

Using Philipp's prototype we can do some cool stuff with event lists, for
example:

  sc_event_or_list all_events() const
  {
    sc_event_or_list or_list;
    for (int i = 0; i < p.size(); i++)
      or_list = or_list | p[i]->default_event();
    return or_list;
  }
  ...
  wait( all_events() );
  ...
  sc_event_and_list list1 = e1 & e2;
  wait( list1 );
 
  sc_event_and_list list2;
  list2 & e1;
  list2 & e2;
  wait( list2);
 
  sc_event_and_list list3 = list2 & e2; // Caveat - modifies list2
  wait( list3 );

  sc_event_and_list list4;
  list4 = list3 & e2; // Caveat - modifies list3
  wait( list4 );

 
However, because the ctor sc_event_and_list(const sc_event&) is protected,
we cannot do

  sc_event_and_list list5 = e3;
 
I think it would be nice to be able to initialize a list with a single
event, so I propose we make this ctor public (but without putting the
auto_delete argument in the LRM)

Also, we cannot do

  sc_event_and_list list6 = list3 & list4;
 
because we have no sc_event_and_list& operator & ( const
sc_event_and_list& );
I propose we add this operator

Finally, note that

  list2 = list2 & e1;
 
is equivalent to

  list2 & e1;
 
the latter being permitted because operator& works through a side-effect.
Would this be a reason for introducing a separate class for
user-instantiated event lists?

Opinions?

Thanks,

John A

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner, and is 
believed to be clean. 
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Oct 12 07:22:53 2010

This archive was generated by hypermail 2.1.8 : Tue Oct 12 2010 - 07:22:54 PDT