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

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [soft/] [linux/] [common/] [board/] [board.cpp] - Blame information for rev 34

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dsmv
 
2
#ifndef __BOARD_H__
3 6 v.karak
#include "board.h"
4 2 dsmv
#endif
5
 
6
//-----------------------------------------------------------------------------
7
 
8
#include <cassert>
9
#include <cstdlib>
10
#include <cstring>
11
#include <iostream>
12
#include <iomanip>
13
#include <climits>
14
 
15
//-----------------------------------------------------------------------------
16
 
17
using namespace std;
18
 
19
//-----------------------------------------------------------------------------
20
 
21
board::board()
22
{
23
}
24
 
25
//-----------------------------------------------------------------------------
26
 
27
board::~board()
28
{
29
}
30
 
31
//-----------------------------------------------------------------------------
32
 
33
int board::brd_open(const char *name)
34
{
35 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
36 2 dsmv
    return core_open(name);
37
}
38
 
39
//-----------------------------------------------------------------------------
40
 
41
int board::brd_init()
42
{
43 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
44 2 dsmv
    return core_init();
45
}
46
 
47
//-----------------------------------------------------------------------------
48
 
49
int board::brd_reset()
50
{
51 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
52 2 dsmv
    return core_reset();
53
}
54
 
55
//-----------------------------------------------------------------------------
56
 
57
int board::brd_close()
58
{
59 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
60 2 dsmv
    return core_close();
61
}
62
 
63
//-----------------------------------------------------------------------------
64
 
65
int board::brd_load_dsp()
66
{
67 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
68 2 dsmv
    return core_load_dsp();
69
}
70
 
71
//-----------------------------------------------------------------------------
72
 
73
int board::brd_load_pld()
74
{
75 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
76 2 dsmv
    return core_load_pld();
77
}
78
 
79
//-----------------------------------------------------------------------------
80
 
81
int board::brd_board_info()
82
{
83 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
84 2 dsmv
    return core_board_info();
85
}
86
 
87
//-----------------------------------------------------------------------------
88
 
89
int board::brd_pld_info()
90
{
91 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
92 2 dsmv
    return core_pld_info();
93
}
94
 
95
//-----------------------------------------------------------------------------
96
 
97
int board::brd_resource()
98
{
99 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
100 2 dsmv
    return core_resource();
101
}
102
 
103
//-----------------------------------------------------------------------------
104 6 v.karak
 
105
void board::brd_delay(int ms)
106
{
107
    DEBUG_PRINT("%s()\n", __FUNCTION__);
108
    core_delay(ms);
109
}
110
 
111 2 dsmv
/*
112
std::vector<struct memory_block>* board::dma_alloc(u32 dmaChannel, u32 blockNumber, u32 blockSize)
113
{
114
    return core_dma_alloc(dmaChannel, blockNumber, blockSize);
115
}
116
 
117
//-----------------------------------------------------------------------------
118
 
119
int board::dma_free(u32 dmaChannel)
120
{
121
    return core_dma_free(dmaChannel);
122
}
123
 
124
//-----------------------------------------------------------------------------
125
 
126
int board::dma_start(u32 dmaChannel)
127
{
128
    return core_dma_start(dmaChannel);
129
}
130
 
131
//-----------------------------------------------------------------------------
132
 
133
int board::dma_state(u32 dmaChannel)
134
{
135
    return core_dma_state(dmaChannel);
136
}
137
 
138
//-----------------------------------------------------------------------------
139
 
140
int board::dma_stop(u32 dmaChannel)
141
{
142
    return core_dma_stop(dmaChannel);
143
}
144
 
145
//-----------------------------------------------------------------------------
146
 
147
int board::dma_total()
148
{
149
    return core_dma_total();
150
}
151
 
152
//-----------------------------------------------------------------------------
153
 
154
struct memory_block* board::dma_stub(u32 dmaChannel)
155
{
156
    return core_dma_stub(dmaChannel);
157
}
158
*/
159
//-----------------------------------------------------------------------------
160
 
161
u32 board::brd_reg_peek_dir( u32 trd, u32 reg )
162
{
163 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
164 2 dsmv
    return core_reg_peek_dir( trd, reg );
165
}
166
 
167
//-----------------------------------------------------------------------------
168
 
169
u32 board::brd_reg_peek_ind( u32 trd, u32 reg )
170
{
171 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
172 2 dsmv
    return core_reg_peek_ind( trd, reg );
173
}
174
 
175
//-----------------------------------------------------------------------------
176
 
177
void board::brd_reg_poke_dir( u32 trd, u32 reg, u32 val )
178
{
179 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
180 2 dsmv
    return core_reg_poke_dir( trd, reg, val );
181
}
182
 
183
//-----------------------------------------------------------------------------
184
 
185
void board::brd_reg_poke_ind( u32 trd, u32 reg, u32 val )
186
{
187 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
188 2 dsmv
    return core_reg_poke_ind( trd, reg, val );
189
}
190
 
191
//-----------------------------------------------------------------------------
192
 
193
u32  board::brd_bar0_read( u32 offset )
194
{
195 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
196 2 dsmv
    return core_bar0_read( offset );
197
}
198
 
199
//-----------------------------------------------------------------------------
200
 
201
void board::brd_bar0_write( u32 offset, u32 val )
202
{
203 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
204 2 dsmv
    return core_bar0_write( offset, val );
205
}
206
 
207
//-----------------------------------------------------------------------------
208
 
209
u32  board::brd_bar1_read( u32 offset )
210
{
211 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
212 2 dsmv
    return core_bar1_read( offset );
213
}
214
 
215
//-----------------------------------------------------------------------------
216
 
217
void board::brd_bar1_write( u32 offset, u32 val )
218
{
219 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
220 2 dsmv
    return core_bar1_write(offset, val);
221
}
222
 
223
//----------BRDSHELL-----------------------------------------------------------
224
 
225
u32 board::dma_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA)
226
{
227 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
228 2 dsmv
    return core_alloc(DmaChan, sSCA);
229
}
230
 
231
//-----------------------------------------------------------------------------
232
 
233 6 v.karak
u32 board::dma_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
234
                                u32 blkNum, u32 isSysMem, u32 dir,
235
                                u32 addr, BRDstrm_Stub **pStub)
236 2 dsmv
{
237 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
238
    return core_allocate_memory(DmaChan, pBuf, blkSize,
239
                                blkNum, isSysMem, dir, addr, pStub);
240 2 dsmv
}
241
 
242
//-----------------------------------------------------------------------------
243
 
244
u32 board::dma_free_memory(int DmaChan)
245
{
246 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
247 2 dsmv
    return core_free_memory(DmaChan);
248
}
249
 
250
//-----------------------------------------------------------------------------
251
 
252
u32 board::dma_start(int DmaChan, int IsCycling)
253
{
254 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
255 2 dsmv
    return core_start_dma(DmaChan, IsCycling);
256
}
257
 
258
//-----------------------------------------------------------------------------
259
 
260
u32 board::dma_stop(int DmaChan)
261
{
262 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
263 2 dsmv
    return core_stop_dma(DmaChan);
264
}
265
 
266
//-----------------------------------------------------------------------------
267
 
268
u32 board::dma_state(int DmaChan, u32 msTimeout, int& state, u32& blkNum)
269
{
270 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
271 2 dsmv
    return core_state_dma(DmaChan, msTimeout, state, blkNum);
272
}
273
 
274
//-----------------------------------------------------------------------------
275
 
276
u32 board::dma_wait_buffer(int DmaChan, u32 msTimeout)
277
{
278 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
279 2 dsmv
    return core_wait_buffer(DmaChan, msTimeout);
280
}
281
 
282
//-----------------------------------------------------------------------------
283
 
284
u32 board::dma_wait_block(int DmaChan, u32 msTimeout)
285
{
286 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
287 2 dsmv
    return core_wait_block(DmaChan, msTimeout);
288
}
289
 
290
//-----------------------------------------------------------------------------
291
 
292
u32 board::dma_reset_fifo(int DmaChan)
293
{
294 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
295 2 dsmv
    return core_reset_fifo(DmaChan);
296
}
297
 
298
//-----------------------------------------------------------------------------
299
 
300
u32 board::dma_set_local_addr(int DmaChan, u32 addr)
301
{
302 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
303 2 dsmv
    return core_set_local_addr(DmaChan, addr);
304
}
305
 
306
//-----------------------------------------------------------------------------
307
 
308
u32 board::dma_adjust(int DmaChan, u32 mode)
309
{
310 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
311 2 dsmv
    return core_adjust(DmaChan, mode);
312
}
313
 
314
//-----------------------------------------------------------------------------
315
 
316
u32 board::dma_done(int DmaChan, u32 blockNumber)
317
{
318 6 v.karak
    DEBUG_PRINT("%s()\n", __FUNCTION__);
319 2 dsmv
    return core_done(DmaChan, blockNumber);
320
}
321
 
322
//-----------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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