OpenCores
URL https://opencores.org/ocsvn/connect-6/connect-6/trunk

Subversion Repositories connect-6

[/] [connect-6/] [trunk/] [XILINX/] [BUILD_SCC_SRCH/] [synth_src/] [q.hpp] - Blame information for rev 17

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 sumanta.ch
#ifndef Q_H
2
#define Q_H
3
 
4
#include "shared.h"
5
#define max_size 361
6
#define ptr_bw 32
7
class q {
8
  //tp arr[max_size];
9
  unsigned int head, tail;
10
  unsigned char wrapped;
11
  #pragma bitsize q.head ptr_bw
12
  #pragma bitsize q.tail ptr_bw
13
  #pragma bitsize q.wrapped 1
14
 
15
  public:
16
 
17
  /* constructor */
18
  q () { head = tail = 0; wrapped = false; };
19
 
20
 // /* returns front data of queue */
21
 // tp front () {
22
 //   return arr[head];
23
 // }
24
 
25
  bool active;
26
  /* return true iff queue is empty */
27
  bool empty () {
28
    return ((head == tail) && !wrapped);
29
  }
30
 
31
  /* return true iff queue is full */
32
  bool full () {
33
    return ((head == tail) && wrapped);
34
  }
35
  void reset(){
36
  head=tail=0;wrapped=false;active=1;
37
  }
38
 
39
  /* pop front of queue, returning the front data */
40
  /* q is corrupted if pop when empty */
41
  AIMove pop ();
42
 
43
  /* push data into back of queue */
44
  /* q is corrupted if push when full */
45
   void push (AIMove d);
46
 
47
  /* return current size of the queue */
48
  int size ();
49
};
50
//extern q moves_fifo;
51
//#pragma no_inter_loop_memory_analysis moves_fifo.head
52
//#pragma no_inter_loop_memory_analysis moves_fifo.tail
53
//#pragma no_inter_loop_memory_analysis moves_fifo.wrapped
54
//#pragma no_inter_loop_memory_analysis moves_fifo.active
55
//      #pragma no_inter_loop_memory_analysis moves_fifo
56
extern q moves_fifo1;
57
#pragma no_inter_loop_memory_analysis moves_fifo1.head
58
#pragma no_inter_loop_memory_analysis moves_fifo1.tail
59
#pragma no_inter_loop_memory_analysis moves_fifo1.wrapped
60
#pragma no_inter_loop_memory_analysis moves_fifo1.active
61
        #pragma no_inter_loop_memory_analysis moves_fifo1
62
//#ifndef PICO_SYNTH 
63
//  /* not synthesizable */
64
//  std::string to_string () const {
65
//    std::string s;
66
//    std::stringstream out;
67
//
68
//    out << "{ ";
69
//
70
//    if (wrapped) {
71
//      for (int i=head; i<max_size; i++) {
72
//        out << arr[i];
73
//      out << " , ";
74
//      }
75
//      for (int i=0; i<tail; i++) {
76
//        out << arr[i];
77
//      if (i != tail - 1) out << " , ";
78
//      }
79
//    } else {
80
//      for (int i=head; i<tail; i++) {
81
//        out << arr[i];
82
//      if (i != tail - 1) out << " , ";
83
//      }
84
//    }
85
//
86
//    out << " }";
87
//    s = out.str();
88
//    return s; 
89
//  }
90
//
91
//  operator std::string () { return to_string(); }
92
//  
93
//#endif
94
//
95
//
96
//
97
//#ifndef PICO_SYNTH 
98
///* not synthesizable */
99
//template <class tp, int max_size, int ptr_bw>
100
//std::ostream& operator << (std::ostream &os, const q<tp,max_size,ptr_bw> &f)
101
//{
102
//  os << f.to_string();
103
//  return os;
104
//}
105
//#endif
106
//
107
//
108
//#undef Q_ASSERT
109
////extern q<AIMove,361,32> moves_fifo;
110
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.