-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNoximBuffer.h
63 lines (38 loc) · 1.39 KB
/
NoximBuffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Noxim - the NoC Simulator
*
* (C) 2005-2010 by the University of Catania
* For the complete list of authors refer to file ../doc/AUTHORS.txt
* For the license applied to these sources refer to file ../doc/LICENSE.txt
*
* This file contains the declaration of the buffer
*/
#ifndef __NOXIMBUFFER_H__
#define __NOXIMBUFFER_H__
#include <cassert>
#include <queue>
#include "NoximMain.h"
using namespace std;
class NoximBuffer {
public:
NoximBuffer();
virtual ~ NoximBuffer() {
} void SetMaxBufferSize(unsigned int bms); // Set buffer max size (in flits)
unsigned int GetMaxBufferSize() const; // Get max buffer size
unsigned int getCurrentFreeSlots() const; // free buffer slots
bool IsFull() const; // Returns true if buffer is full
bool IsEmpty() const; // Returns true if buffer is empty
virtual void Drop(const NoximFlit & flit) const; // Called by Push() when buffer is full
virtual void Empty() const; // Called by Pop() when buffer is empty
void Push(const NoximFlit & flit); // Push a flit. Calls Drop method if buffer is full
NoximFlit Pop(); // Pop a flit
NoximFlit Front() const; // Return a copy of the first flit in the buffer
unsigned int Size() const;
void reSize(int depth);
bool Clean() ;
unsigned int max_buffer_size;
private:
// unsigned int max_buffer_size;
deque < NoximFlit > buffer;
};
#endif