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

Subversion Repositories noc

[/] [noc/] [src/] [packet_header.h] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 imori
#ifndef PACKET_HEADER_H
2
#define PACKET_HEADER_H
3
 
4
//Message : [Packet|Packet|Packet|.....]
5
//Packet  : [Head flit|Body flit|Body flit|....|Tail flit]
6
//Flit    : [|Phit|Phit|....]
7
//|dst_addr|flit_num|src_addr|data|
8
//
9
//Null space is "000000000"
10
 
11
#define FLIT_SIZE               16
12
#define OI_FLIT_SIZE    16
13
#define FLIT_TYPE(x)    x<<15
14
#define FLIT_DST(addr)  addr<<14
15
#define PKT_SIZE(size)  size<<7
16
 
17
//                      Switching Table.
18
//WEST   EAST   SOUTH   NORTH   CORE
19
//
20
#define CORE    0
21
#define WEST    1
22
#define EAST    2
23
#define NORTH   3
24
#define SOUTH   4
25
 
26
#define _HEAD_FLIT      0x00
27
#define _BODY_FLIT      0x01
28
#define _TAIL_FLIT      0x02
29
 
30
#define R_FLAG          0x20000
31
 
32
typedef struct HEAD_FLIT{
33
        //LSB
34
        unsigned sequence       : 4;            //The sequence of flits.
35
        unsigned pkt_size       : 3;            //The number of flits. 2^4 = 16 Bytes.
36
        unsigned dst_addr       : 6;            //Destination address 2^6 = 64 address,so that is 64 tiles.
37
        unsigned conn_type      : 1;            //'1' is optical interconnects and '0' is electrical interconnects.
38
        unsigned type           : 2;            //'0' is header flit, '1' is body flit, and '2' is tail flit.
39
        //MSB
40
};
41
 
42
typedef struct BODY_FLIT{
43
        unsigned data           : 14;
44
        unsigned type           : 2;
45
};
46
 
47
typedef struct PACKET{
48
        HEAD_FLIT head;
49
        unsigned short *data;
50
};
51
 
52
#endif

powered by: WebSVN 2.1.0

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