source: trunk/IPs/systemC/Environnement/Queue/include/Queue.h @ 78

Last change on this file since 78 was 78, checked in by rosiere, 16 years ago

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 1.6 KB
Line 
1#ifndef ENVIRONNEMENT_QUEUE_QUEUE_H
2#define ENVIRONNEMENT_QUEUE_QUEUE_H
3
4#include <stdint.h>
5#include <iostream>
6#include "Slot.h"
7
8namespace environnement {
9namespace queue {
10 
11  template <class T>
12  class Queue
13  {
14  protected : std::string _name;
15  protected : uint32_t    _nb_slot;   // number of slot
16  protected : uint32_t    _size;      // size of queue
17  protected : slot_t<T> * _slot;
18
19  public : Queue (std::string name,
20                  uint32_t size)
21      {
22        _name    = name;
23        _nb_slot = 0;
24        _size    = size;
25        _slot    = new slot_t<T> [size];
26      };
27
28    public : virtual ~Queue ()
29      {
30        delete [] _slot;
31      };
32
33      // *****[ empty ]*****
34      // Test if the queue is empty
35    public : bool empty ()
36      {
37        return (_nb_slot == 0);
38      }
39     
40      // *****[ full ]*****
41      // Test if the queue is full
42    public : bool full ()
43      {
44        return (_nb_slot == _size);
45      }
46
47      // *****[ nb_slot_free ]*****
48      // return the number of free slot
49    public : uint32_t nb_slot_free ()
50      {
51        return (_size-_nb_slot);
52      }
53
54      // *****[ nb_slot_use ]*****
55      // return the number of use slot
56    public : uint32_t nb_slot_use ()
57      {
58        return (_nb_slot);
59      }
60
61      // *****[ pop ]*****
62      // read the queue, and update the pointer
63    public : virtual T    pop  ()             {return T();};
64
65      // *****[ pop ]*****
66      // read the queue, and update the pointer
67    public : virtual T    pop  (uint32_t num) {return T();};
68
69      // *****[ push ]*****
70      // Push a new value (they must have a slot free)
71    public : virtual bool push (T val)        {return false;};
72 
73    }; // Queue
74 
75};
76};
77#endif
78 
Note: See TracBrowser for help on using the repository browser.