INSEE 05.04.2011
Interconnection Nertworks Simulation and Evaluation Environment
|
Event management functions used in trace-driven simulation. More...
Functions | |
void | init_event (event_q *q) |
void | ins_event (event_q *q, event i) |
void | do_event (event_q *q, event *i) |
event | head_event (event_q *q) |
void | rem_head_event (event_q *q) |
bool_t | event_empty (event_q *q) |
void | init_occur (event_l *l) |
void | ins_occur (event_l *l, event i) |
bool_t | occurred (event_l *l, event i) |
Event management functions used in trace-driven simulation.
Event: A task that must be done (not occurred yet). Occurred: A task that has been done (total or partially completed).
FSIN Functional Simulator of Interconnection Networks Copyright (2003-2011) J. Miguel-Alonso, A. Gonzalez, J. Navaridas
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
void do_event | ( | event_q * | q, |
event * | i | ||
) |
Uses the first event in the queue.
Takes an event an increases its packet count. When it reaches the length of the event, this is erased from the queue.
q | A pointer to a queue. |
i | A pointer to the event to do. |
bool_t event_empty | ( | event_q * | q | ) |
Is a queue empty?.
q | A pointer to the queue. |
event head_event | ( | event_q * | q | ) |
Looks at the first event in a queue.
q | A pointer to the queue. |
void init_event | ( | event_q * | q | ) |
Initializes an event queue.
q | a pointer to the queue to be initialized. |
void init_occur | ( | event_l * | l | ) |
Initializes all ocurred events lists.
There is only one list in each router.
l | A pointer to the list to be initialized. |
void ins_event | ( | event_q * | q, |
event | i | ||
) |
Adds an event to a queue.
q | a pointer to a queue. |
i | the event to be added to q. |
void ins_occur | ( | event_l * | l, |
event | i | ||
) |
Inserts an event's occurrence in an event list.
If the event is in the list, then its count is increased. Otherwise a new event is created in the occurred event list.
l | A pointer to a list. |
i | The event to be added. |
bool_t occurred | ( | event_l * | l, |
event | i | ||
) |
Has an event completely occurred?.
If it has totally occurred, this is, the event is in the list and its count is equal to its length, then it is deleted from the list.
l | a pointer to a list. |
i | the event we are seeking for. |
void rem_head_event | ( | event_q * | q | ) |
Deletes the first event in a queue.
q | A pointer to the queue. |