1 |
13 |
quickwayne |
//////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
//
|
3 |
|
|
// ***************************************************************************
|
4 |
|
|
// ** **
|
5 |
|
|
// ** Copyright (c) 1995-2005 Xilinx, Inc. All rights reserved. **
|
6 |
|
|
// ** **
|
7 |
|
|
// ** You may copy and modify these files for your own internal use solely **
|
8 |
|
|
// ** with Xilinx programmable logic devices and Xilinx EDK system or **
|
9 |
|
|
// ** create IP modules solely for Xilinx programmable logic devices and **
|
10 |
|
|
// ** Xilinx EDK system. No rights are granted to distribute any files **
|
11 |
|
|
// ** unless they are distributed in Xilinx programmable logic devices. **
|
12 |
|
|
// ** **
|
13 |
|
|
// ***************************************************************************
|
14 |
|
|
//
|
15 |
|
|
//////////////////////////////////////////////////////////////////////////////
|
16 |
|
|
// Filename: D:\thesis\FIFO1\drivers\fifo_link_v1_00_a\src\\fifo_link.h
|
17 |
|
|
// Version: 1.00.a
|
18 |
|
|
// Description: fifo_link (FIFO link) Driver Header File
|
19 |
|
|
// Date: Fri Oct 06 17:25:29 2006 (by Create and Import Peripheral Wizard)
|
20 |
|
|
//////////////////////////////////////////////////////////////////////////////
|
21 |
|
|
|
22 |
|
|
#ifndef FIFO_LINK_H
|
23 |
|
|
#define FIFO_LINK_H
|
24 |
|
|
|
25 |
|
|
#ifdef __MICROBLAZE__
|
26 |
|
|
#include "mb_interface.h"
|
27 |
|
|
#define write_into_fsl(val, id) microblaze_bwrite_datafsl(val, id)
|
28 |
|
|
#define read_from_fsl(val, id) microblaze_bread_datafsl(val, id)
|
29 |
|
|
#else
|
30 |
|
|
#include "xpseudo_asm_gcc.h"
|
31 |
|
|
#define write_into_fsl(val, id) putfsl(val, id)
|
32 |
|
|
#define read_from_fsl(val, id) getfsl(val, id)
|
33 |
|
|
#endif
|
34 |
|
|
|
35 |
|
|
/*
|
36 |
|
|
* A macro for accessing FSL peripheral.
|
37 |
|
|
*
|
38 |
|
|
* This example driver writes all the data in the input arguments
|
39 |
|
|
* into the input FSL bus through blocking wrties. FSL peripheral will
|
40 |
|
|
* automatically read from the FSL bus. Once all the inputs
|
41 |
|
|
* have been written, the output from the FSL peripheral is read
|
42 |
|
|
* into output arguments through blocking reads.
|
43 |
|
|
*
|
44 |
|
|
* Arguments:
|
45 |
|
|
* output_slot_id
|
46 |
|
|
* Compile time constant indicating FSL slot from
|
47 |
|
|
* which output data is read. Defined in
|
48 |
|
|
* xparameters.h .
|
49 |
|
|
* input_slot_id
|
50 |
|
|
* Compile time constant indicating FSL slot into
|
51 |
|
|
* which input data is written. Defined in
|
52 |
|
|
* xparameters.h .
|
53 |
|
|
* input_0 An array of unsigned integers. Array size is 1
|
54 |
|
|
* output_0 An array of unsigned integers. Array size is 1
|
55 |
|
|
*
|
56 |
|
|
* Caveats:
|
57 |
|
|
* The output_slot_id and input_slot_id arguments must be
|
58 |
|
|
* constants available at compile time. Do not pass
|
59 |
|
|
* variables for these arguments.
|
60 |
|
|
*
|
61 |
|
|
* Since this is a macro, using it too many times will
|
62 |
|
|
* increase the size of your application. In such cases,
|
63 |
|
|
* or when this macro is too simplistic for your
|
64 |
|
|
* application you may want to create your own instance
|
65 |
|
|
* specific driver function (not a macro) using the
|
66 |
|
|
* macros defined in this file and the slot
|
67 |
|
|
* identifiers defined in xparameters.h . Please see the
|
68 |
|
|
* example code (fifo_link_app.c) for details.
|
69 |
|
|
*/
|
70 |
|
|
|
71 |
|
|
#define fifo_link(\
|
72 |
|
|
input_slot_id,\
|
73 |
|
|
output_slot_id,\
|
74 |
|
|
input_0, \
|
75 |
|
|
output_0 \
|
76 |
|
|
)\
|
77 |
|
|
{\
|
78 |
|
|
int i;\
|
79 |
|
|
\
|
80 |
|
|
for (i=0; i<1; i++)\
|
81 |
|
|
{\
|
82 |
|
|
write_into_fsl(input_0[i], input_slot_id);\
|
83 |
|
|
}\
|
84 |
|
|
\
|
85 |
|
|
for (i=0; i<1; i++)\
|
86 |
|
|
{\
|
87 |
|
|
read_from_fsl(output_0[i], output_slot_id);\
|
88 |
|
|
}\
|
89 |
|
|
}
|
90 |
|
|
|
91 |
|
|
#endif
|