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

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

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

Functions

void inj_init_queue (inj_queue *q)
long inj_queue_len (inj_queue *q)
long inj_queue_space (inj_queue *q)
void inj_ins_queue (inj_queue *q, phit *i)
void inj_ins_mult_queue (inj_queue *q, phit *i, long copies)
void inj_rem_queue (inj_queue *q, phit *i)

Detailed Description

Tools for the injection 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

void inj_init_queue ( inj_queue q)

Initializes an injection queue.

Making it empty.

Parameters:
qThe injection queue to be initialized.
void inj_ins_mult_queue ( inj_queue q,
phit i,
long  copies 
)

Inserts some clones of a phit in an injection queue.

Requires enough space. Otherwise, panics.

Parameters:
qAn injection queue.
iThe phit to be inserted.
copiesNumber of copies of i.
void inj_ins_queue ( inj_queue q,
phit i 
)

Inserts a phit in an injection queue.

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

Parameters:
qAn injection queue.
iThe phit to insert.
long inj_queue_len ( inj_queue q)

Calculates the length of an injection queue.

Parameters:
qAn injection queue.
Returns:
The number of phits in the injection queue.
long inj_queue_space ( inj_queue q)

Calculates the free space in an injection queue.

Parameters:
qAn injection queue.
Returns:
the number of free phits in the injection queue.
void inj_rem_queue ( inj_queue q,
phit i 
)

Take the first phit in an injection queue.

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

Parameters:
qAn injection queue.
iThe removed phit is returned here.