INSEE 05.04.2011
Interconnection Nertworks Simulation and Evaluation Environment
Functions
C:/cygwin/home/Javier/insee/src/queue.c File Reference

Tools for the transit queues used in FSIN routers. More...

#include "globals.h"
Include dependency graph for queue.c:

Functions

void init_queue (queue *q)
long queue_len (queue *q)
long queue_space (queue *q)
phithead_queue (queue *q)
void ins_queue (queue *q, phit *i)
void ins_mult_queue (queue *q, phit *i, long copies)
void rem_queue (queue *q, phit *i)
void rem_head_queue (queue *q)

Detailed Description

Tools for the transit queues used in FSIN routers.

FSIN Functional Simulator of Interconnection Networks Copyright (2003-2011) J. Miguel-Alonso, A. Gonzalez

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.


Function Documentation

phit* head_queue ( queue q)

Looks at the first phit of a queue.

Requires a non-empty queue. Otherwise, panics

Parameters:
qA queue.
Returns:
A pointer to the first phit of the queue.
void init_queue ( queue q)

Initializes a queue.

Making it empty.

Parameters:
qThe queue to initialize.
void ins_mult_queue ( queue q,
phit i,
long  copies 
)

Inserts many (identical) copies of a phit "i" in queue "q"

Requires enough space. Otherwise, panics.

Parameters:
qA queue.
iThe phit to be cloned & inserted.
copiesNumber of clones of i.
void ins_queue ( queue q,
phit i 
)

Inserts a phit in a queue.

Requires a buffer with room for the phit. Otherwise, panics

Parameters:
qA queue.
iThe phit to be inserted.
long queue_len ( queue q)

Calculates the length of a queue.

Parameters:
qA queue.
Returns:
The number of phits in the queue.
long queue_space ( queue q)

Calculates the free space in a queue.

Parameters:
qA queue.
Returns:
the number of phits available in the queue.
void rem_head_queue ( queue q)

Removes the head of queue.

Does not return anything. Requires a non-empty queue. Otherwise, panics.

Parameters:
qA queue.
void rem_queue ( queue q,
phit i 
)

Take the first phit in a queue.

Removes the head phit from queue & returns it via "i" Requires a non-empty queue. Otherwise, panics.

Parameters:
qA queue.
iThe removed phit is returned here.