Deleted Added
sdiff udiff text old ( 9983:2cce74fe359e ) new ( 10153:936a3a8006f6 )
full compact
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * Copyright (c) 2013 Mark D. Hill and David A. Wood
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

--- 384 unchanged lines hidden (view full) ---

393
394inline bool
395operator!=(const Event &l, const Event &r)
396{
397 return l.when() != r.when() || l.priority() != r.priority();
398}
399#endif
400
401/*
402 * Queue of events sorted in time order
403 */
404class EventQueue : public Serializable
405{
406 private:
407 std::string objName;
408 Event *head;
409 Tick _curTick;
410
411 //! Mutex to protect async queue.
412 std::mutex *async_queue_mutex;
413
414 //! List of events added by other threads to this event queue.
415 std::list<Event*> async_queue;
416
417 //! Insert / remove event from the queue. Should only be called
418 //! by thread operating this queue.
419 void insert(Event *event);
420 void remove(Event *event);
421
422 //! Function for adding events to the async queue. The added events
423 //! are added to main event queue later. Threads, other than the
424 //! owning thread, should call this function instead of insert().
425 void asyncInsert(Event *event);
426
427 EventQueue(const EventQueue &);
428
429 public:
430 EventQueue(const std::string &n);
431
432 virtual const std::string name() const { return objName; }
433 void name(const std::string &st) { objName = st; }
434
435 //! Schedule the given event on this queue. Safe to call from any
436 //! thread.
437 void schedule(Event *event, Tick when, bool global = false);

--- 48 unchanged lines hidden (view full) ---

486 * different set of events can run without disturbing events that have
487 * already been scheduled. Already scheduled events can be processed
488 * by replacing the original head back.
489 * USING THIS FUNCTION CAN BE DANGEROUS TO THE HEALTH OF THE SIMULATOR.
490 * NOT RECOMMENDED FOR USE.
491 */
492 Event* replaceHead(Event* s);
493
494#ifndef SWIG
495 virtual void serialize(std::ostream &os);
496 virtual void unserialize(Checkpoint *cp, const std::string &section);
497#endif
498};
499
500void dumpMainQueue();
501

--- 111 unchanged lines hidden ---