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.interface/] [udp2hibi/] [1.0/] [drv/] [udp2hibi.h] - Blame information for rev 183

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

Line No. Rev Author Line
1 145 lanttu
/*
2
 * Driver functions for UDP2HIBI block.
3
 *
4
 * These are more like examples, so modify if you see it necessary
5
 *
6
 * Original author: Jussi Nieminen
7
 * Last update: 7.1.2010
8
 * History:
9
 *  7.1.2010: created
10
 */
11
 
12
#ifndef UDP2HIBI_H_
13
#define UDP2HIBI_H_
14
 
15
 
16
/* Reserve a slot from udp2hibi's rx configuration table. The udp2hibi
17
 * then relays matching transmissions to address receiving_haddr. An ack
18
 * is sent if reservation is succesful, and a nack comes if the table
19
 * is full. 1 is returned on success, 0 if the given rx info is somehow
20
 * invalid.
21
 */
22
int udp2hibi_rx_conf( int ip_addr, int dest_port, int source_port, int receiving_haddr, int udp2hibi_haddr );
23
 
24
 
25
/* Lock udp2hibi to listen data that is coming to address udp2hibi_haddr.
26
 * Also configure destination ip and ports for a following transfer.
27
 * An ack is sent to the receiving_haddr, if the udp2hibi is not already
28
 * reserved. If a nack is received, it means that someone else is using
29
 * udp2hibi right now and you should try again after a while. Returns 1
30
 * on success, 0 if there is something wrong with the given parameters.
31
 * Timeout has to be under 2^28.
32
 */
33
int udp2hibi_tx_conf( unsigned int timeout, int ip_addr, int dest_port, int source_port, int receiving_haddr, int udp2hibi_haddr );
34
 
35
 
36
/* Check if the tx/rx ack received is correct. Both functions return
37
 * 1 on success, and 0 if it's a nack or an invalid header.
38
 */
39
int udp2hibi_check_tx_ack( unsigned int received_header );
40
int udp2hibi_check_rx_ack( unsigned int received_header );
41
 
42
 
43
/* You are responsible of storing the data to be sent to correct addresses
44
 * in the shared memory between cpu and n2h2. This function only saves you
45
 * from generating and storing the udp2hibi data header.
46
 */
47
 void udp2hibi_write_data_header( int* mem_addr, int tx_length );
48
 
49
 
50
 /* This function makes udp2hibi again available for other agents.
51
  * Call this after you have finished sending. And don't you forget,
52
  * or the other agents will be very angry...
53
  */
54
  void udp2hibi_release_lock( int udp2hibi_haddr );
55
 
56
#endif /*UDP2HIBI_H_*/

powered by: WebSVN 2.1.0

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