INSEE 05.04.2011
Interconnection Nertworks Simulation and Evaluation Environment
Data Structures | Typedefs | Functions
C:/cygwin/home/Javier/insee/src/queue.h File Reference

Definition of the queues used in FSIN routers. Both transit & injection queues are defined here. More...

#include "phit.h"
#include "misc.h"
Include dependency graph for queue.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  queue
struct  inj_queue

Typedefs

typedef struct queue queue
typedef struct inj_queue inj_queue

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)
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

Definition of the queues used in FSIN routers. Both transit & injection queues are defined here.


Typedef Documentation

typedef struct inj_queue inj_queue

This structure defines an injection queue.

typedef struct queue queue

This structure defines a transit queue.


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 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.
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.