• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

include/roc/defines_udp.h (r4864/r884)

Go to the documentation of this file.
00001 #ifndef ROC_DEFINES_UDP_H
00002 #define ROC_DEFINES_UDP_H
00003 
00004 #define ROC_PASSWORD               832226211
00005 
00006 //ROC software
00007 #define ROC_ETH_OCM                 0x110090   // r/w  activate OPB-2-OCM-Prefetcher
00008 
00009 
00010 
00011 //sdcard
00012 #define ROC_ETH_CFG_READ            0x110060   // w    Beim Schreiben einer 1 werden die Konfigurationsdaten (IP, MAC, Delays) von der SD-Karte gelesen
00013 #define ROC_ETH_CFG_WRITE           0x110064   // w    Beim Schreiben einer 1 werden die Konfigurationsdaten (IP, MAC, Delays) auf der SD-Karte gespeichert
00014 #define ROC_ETH_OVERWRITE_SD_FILE   0x110068 // w
00015 //network
00016 #define ROC_ETH_SWITCHCONSOLE       0x110100 // r/w
00017 #define ROC_ETH_START_DAQ           0x100100 // w
00018 #define ROC_ETH_STOP_DAQ            0x100104 // w
00019 #define ROC_ETH_SUSPEND_DAQ         0x100108 // w go into suspend state
00020 #define ROC_ETH_IP_ADDRESS          0x110000 // r/w
00021 #define ROC_ETH_NETMASK             0x110004
00022 #define ROC_ETH_MAC_ADDRESS_UPPER   0x110008 // r/w upper two bytes
00023 #define ROC_ETH_MAC_ADDRESS_LOWER   0x11000C // r/w lower four bytes
00024 #define ROC_ETH_MASTER_LOGIN        0x110010 // r/w
00025 #define ROC_ETH_MASTER_DATAPORT     0x110014 // r/w  data port of master node
00026 #define ROC_ETH_MASTER_CTRLPORT     0x110018 // r/w
00027 #define ROC_ETH_BUFFER_FLUSH_TIMER  0x11001C // r/w
00028 #define ROC_ETH_MASTER_LOGOUT       0x110020 // w
00029 #define ROC_ETH_MASTER_IP           0x110024 // r
00030 #define ROC_ETH_RESTART_NETWORK     0x110028 // w
00031 #define ROC_ETH_CONSOLE_OUTPUT      0x11002C // w
00032 #define ROC_ETH_LOST_ETHER_FRAMES   0x110030 // r ethernet frames lost
00033 #define ROC_ETH_UKNOWN_ETHER_FRAMES 0x110034 // r number of ethernet frames with tag other than IP and ARP
00034 #define ROC_ETH_TEMAC_PRINT         0x11003C // w - just print some Temac registers and config
00035 #define ROC_ETH_TEMAC_REG0          0x110040 // r/w - set or read Remac config register
00036 #define ROC_ETH_CTRLPORT            0x110044 // r/w - control port number
00037 #define ROC_ETH_DATAPORT            0x110048 // r/w - data port number
00038 #define ROC_ETH_BURST_LOOPCNT       0x11004C // r/w - number of readout in burst loops
00039 #define ROC_ETH_OCM_LOOPCNT         0x110050 // r/w - number of readout in ocm loops
00040 #define ROC_ETH_CONSOLE_CMD         0x11006C // w - executes provided console command
00041 #define ROC_ETH_STATBLOCK           0x110070 // r - block with sc_statistic
00042 #define ROC_ETH_DEBUGMSG            0x110074 // r - last output of sc_printf command
00043 #define ROC_ETH_HIGHWATER           0x110080 // r/w - value of high water marker (in number of UDP buffers, maximum is about 78000 buffers or 112 MB)
00044 #define ROC_ETH_LOWWATER            0x110084 // r/w - value of low water marker (in number of UDP buffers, default is 10% of highwater)
00045 #define ROC_ETH_NUMBUFALLOC         0x110088 // r - number of allocated UDP buffers
00046 
00047 //Flash
00048 #define ROC_ETH_FLASH_KIBFILE_FROM_DDR  0x120000 // w position value is parsed right now only 0 is supported
00049 #define ROC_ETH_FLASH_ADDR              0x120004 // w - set current FlashFileBuffer-Address Pointer
00050 #define ROC_ETH_FLASH_DATA              0x120008 // r/w - write rawData to FlashFileBuffer and Increment Pointer / read Data from FlashFileBuffer and Pointer++;
00051 #define ROC_ETH_FLASH_CLEAR_FILEBUFFER  0x12000C // w - clears the filebuffer, sets FlashFileBuffer-Address Pointer to 0
00052 #define ROC_ETH_CHECK_BITFILEBUFFER     0x120010 // r
00053 #define ROC_ETH_CHECK_BITFILEFLASH0     0x120014 // r
00054 #define ROC_ETH_CHECK_BITFILEFLASH1     0x120018 // r
00055 #define ROC_ETH_CHECK_FILEBUFFER        0x120020 // r
00056 
00057 #define ROC_ETH_DLM                     0x130000 // w - create a DLM-Message (1=Timestamp-Reset, 4=Custom-Message)
00058 
00059 
00060 
00061 /************************************
00062  * address space finished
00063  ***********************************/
00064 
00065 
00066 
00067 
00068 
00069 // default ports number of ROC itself
00070 #define ROC_DEFAULT_CTRLPORT        13132
00071 #define ROC_DEFAULT_DATAPORT        13131
00072 
00073 //ROC TAGS
00074 #define ROC_PEEK                    111
00075 #define ROC_POKE                    112
00076 #define ROC_CONSOLE                 113
00077 #define ROC_NOPER                   114
00078 
00079 #define NOPER_PUT                   0x80000000    // to write address, one should set high LSB
00080 #define NOPER_GET                   0x0           // if address not modified, just do get operation
00081 #define NOPER_OPER_MASK             0x80000000
00082 #define NOPER_ADDR_MASK             0x7fffffff
00083 
00084 
00085 #define UDP_PAYLOAD_OFFSET 42
00086 #define MAX_UDP_PAYLOAD 1472
00087 #define MESSAGES_PER_PACKET 243
00088 
00089 //4mb buffer as in syscore for file transfer
00090 #define SC_BITFILE_BUFFER_SIZE 4194304
00091 
00092 
00093 #include <stdint.h>
00094 
00095 #pragma pack(push, 1)
00096 
00097 namespace roc {
00098 
00099    struct UdpMessage
00100    {
00101       uint8_t  tag;
00102       uint8_t  pad[3];
00103       uint32_t password;
00104       uint32_t id;
00105       uint32_t address;
00106       uint32_t value;
00107    };
00108 
00109    struct UdpMessageFull : public UdpMessage
00110    {
00111       uint8_t rawdata[MAX_UDP_PAYLOAD - sizeof(UdpMessage)];
00112    };
00113 
00114    struct UdpDataRequest
00115    {
00116       uint32_t password;
00117       uint32_t reqpktid;
00118       uint32_t frontpktid;
00119       uint32_t tailpktid;
00120       uint32_t numresend;
00121    };
00122 
00123    struct UdpDataRequestFull : public UdpDataRequest
00124    {
00125       uint32_t resend[(MAX_UDP_PAYLOAD - sizeof(struct UdpDataRequest)) / 4];
00126    };
00127 
00128    struct UdpDataPacket
00129    {
00130       uint32_t pktid;
00131       uint32_t lastreqid;
00132       uint32_t nummsg;
00133    // here all messages should follow
00134    };
00135 
00136    struct UdpDataPacketFull : public UdpDataPacket
00137    {
00138       uint8_t msgs[MAX_UDP_PAYLOAD - sizeof(struct UdpDataPacket)];
00139    };
00140 
00141    struct BoardStatistic {
00142       uint32_t   dataRate;   // data taking rate in  B/s
00143       uint32_t   sendRate;   // network send rate in B/s
00144       uint32_t   recvRate;   // network recv rate in B/s
00145       uint32_t   nopRate;    // double-NOP messages 1/s
00146       uint32_t   frameRate;  // unrecognized frames 1/s
00147       uint32_t   takePerf;   // relative use of time for data taking (*100000)
00148       uint32_t   dispPerf;   // relative use of time for packets dispatching (*100000)
00149       uint32_t   sendPerf;   // relative use of time for data sending (*100000)
00150       uint32_t   daqState;   // current daq state
00151    };
00152 
00153 
00161    union ISEBinfileHeader {
00162       struct {
00163          uint8_t ident[4];
00164          uint32_t headerSize;
00165          uint32_t binfileSize;
00166          uint8_t XORCheckSum;
00167          uint8_t bitfileName[65];
00168          uint32_t timestamp;
00169       };
00170       uint8_t bytes[512];
00171    };
00172 
00173 }
00174 
00175 #pragma pack(pop)
00176 
00177 
00178 #endif

Generated on Tue Dec 10 2013 04:52:22 for ROCsoft by  doxygen 1.7.1