OpenCores
URL https://opencores.org/ocsvn/funbase_ip_library/funbase_ip_library/trunk

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.communication/] [hibi/] [3.0/] [tb/] [sad_tb/] [constants.hh] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
/*
2
 * Author: Lasse Lehtonen
3
 *
4
 * Constants for SAD HIBI testbench
5
 *
6
 *
7
 * $Id: constants.hh 1488 2010-12-03 13:06:04Z lehton87 $
8
 *
9
 */
10
 
11
#ifndef SAD_HIBI_CONSTANTS_HH
12
#define SAD_HIBI_CONSTANTS_HH
13
 
14
#include 
15
using namespace std; // hyi
16
 
17
#include 
18
using namespace sc_core; // Hyi hyi
19
using namespace sc_dt;   // No häpy at all
20
 
21
 
22
/*
23
 * Constants: Generics (passed to the VHDL DUV)
24
 */
25
 
26
const int id_width_c          = 8;
27
const int addr_width_c        = 16;
28
 
29
#ifndef HIBI_IN_SAD_MODE // Normal mode
30
 
31
const int data_width_c        = 32;
32
const int separate_addr_c     = 0;
33
 
34
#else // Separate address bus
35
 
36
#ifdef USE_R3_WRAPPERS
37
const int data_width_c        = 32;
38
const int separate_addr_c     = 1;
39
#else
40
const int data_width_c        = addr_width_c + 32;
41
const int separate_addr_c     = 1;
42
#endif
43
 
44
#endif
45
 
46
const int comm_width_c        = 5;
47
const int counter_width_c     = 16;
48
 
49
const int agent_freq_c        = 100;   // In MHz
50
const int bus_freq_c          = 100;   // In MHz
51
 
52
const int rel_agent_freq_c    = 1;
53
const int rel_bus_freq_c      = 1;
54
 
55
const int arb_type_c          = 3;
56
const int fifo_sel_c          = 0;
57
const int rx_fifo_depth_c     = 4;
58
const int rx_msg_fifo_depth_c = 4;
59
const int tx_fifo_depth_c     = 4;
60
const int tx_msg_fifo_depth_c = 4;
61
const int max_send_c          = 10;
62
 
63
const int n_cfg_pages_c       = 1;
64
const int n_time_slots_c      = 0;
65
const int keep_slot_c         = 1;
66
const int n_extra_params_c    = 1;
67
 
68
const int cfg_re_c            = 1;
69
const int cfg_we_c            = 1;
70
const int debug_width_c       = 1;
71
 
72
const int n_agents_c          = 12;
73
const int n_segments_c        = 3;
74
 
75
/*
76
 * Constants: Base addresses
77
 *
78
 * Make sure that these are same in TB's hibiv3.vhd!
79
 */
80
 
81
const sc_bv addresses_c[n_agents_c] =
82
  {0x00000010, 0x00000030, 0x00000050, 0x00000070,
83
   0x00000110, 0x00000130, 0x00000150, 0x00000170,
84
   0x00000310, 0x00000330, 0x00000350, 0x00000370};
85
 
86
const sc_bv addresses_max_c[n_agents_c] =
87
  {0x0000001F, 0x0000003F, 0x0000005F, 0x0000007F,
88
   0x0000011F, 0x0000013F, 0x0000015F, 0x0000017F,
89
   0x0000031F, 0x0000033F, 0x0000035F, 0x0000037F};
90
 
91
enum HibiCommand {IDLE = 0,
92
                  NOT_USED_1,
93
 
94
                  DATA_WR,
95
                  MSG_WR,
96
                  DATA_RD,
97
                  MSG_RD,
98
                  DATA_RDL,
99
                  MSG_RDL,
100
                  DATA_WRNP,
101
                  MSG_WRNP,
102
                  DATA_WRC,
103
                  MSG_WRC,
104
 
105
                  NOT_USED_2,
106
                  EXCL_LOCK,
107
                  NOT_USED_3,
108
                  EXCL_WR,
109
                  NOT_USED_4,
110
                  EXCL_RD,
111
                  NOT_USED_5,
112
                  EXCL_RELEASE,
113
 
114
                  NOT_USED_6,
115
                  CFG_WR,
116
                  NOT_USED_7,
117
                  CFG_RD,
118
 
119
                  NOT_USED_8,
120
                  NOT_USED_9,
121
                  NOT_USED_10,
122
                  NOT_USED_11,
123
                  NOT_USED_12,
124
                  NOT_USED_13,
125
                  NOT_USED_14,
126
                  NOT_USED_15
127
                  };
128
 
129
const sc_bv commands_c[32] =
130
{0,  1,   2,  3,  4,  5,  6,  7,
131
 8,  9,  10, 11, 12, 13, 14, 15,
132
 16, 17, 18, 19, 20, 21, 22, 23,
133
 24, 25, 26, 27, 28, 29, 30, 31};
134
 
135
 
136
string commmand2str(unsigned int cmd)
137
{
138
   switch(cmd)
139
   {
140
      case IDLE:
141
         return string("IDLE        ");
142
      case DATA_WR:
143
         return string("DATA_WR     ");
144
         break;
145
      case DATA_RD:
146
         return string("DATA_RD     ");
147
         break;
148
      case DATA_RDL:
149
         return string("DATA_RDL ¨  ");
150
         break;
151
      case DATA_WRNP:
152
         return string("DATA_WRNP   ");
153
         break;
154
      case DATA_WRC:
155
         return string("DATA_WRC    ");
156
         break;
157
 
158
      case MSG_WR:
159
         return string("MSG_WR      ");
160
         break;
161
      case MSG_RD:
162
         return string("MSG_RD      ");
163
         break;
164
      case MSG_RDL:
165
         return string("MSG_RDL     ");
166
         break;
167
      case MSG_WRNP:
168
         return string("MSG_WRNP    ");
169
         break;
170
      case MSG_WRC:
171
         return string("MSG_WRC     ");
172
         break;
173
 
174
      case EXCL_LOCK:
175
         return string("EXCL_LOCK   ");
176
         break;
177
      case EXCL_WR:
178
         return string("EXCL_WR     ");
179
         break;
180
      case EXCL_RD:
181
         return string("EXCL_RD     ");
182
         break;
183
      case EXCL_RELEASE:
184
         return string("EXCL_RELEASE");
185
         break;
186
 
187
 
188
      case CFG_WR:
189
         return string("CFG_WR      ");
190
         break;
191
      case CFG_RD:
192
         return string("CFG_RD      ");
193
         break;
194
 
195
      default:
196
         break;
197
   }
198
   return string("Not supported hibi command");
199
}
200
 
201
#endif
202
 
203
// Local Variables:
204
// mode: c++
205
// c-file-style: "ellemtel"
206
// c-basic-offset: 3
207
// End:
208
 

powered by: WebSVN 2.1.0

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