StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
iccp.h
1 /******
2 *
3 * A temporary header file until the change has been made. All references
4 * to cmds.hh etc have been changed to cmds.8.0.hh etc
5 *
6 * J.M. Nelson October 1999
7 *
8 * mws added the gb_build_event
9 *****************************************************************************/
10 
11 
12 #ifndef _ICCP_H_
13 #define _ICCP_H_
14 
15 /* changes :
16 // 11/18/97 changed name of SB_ANNOUNCE_DATA -> SB_ANNOUNCE_FORMATTED_DATA
17 // The SB_CONFIRM_FORMATTED_DATA is renamed to
18 // CMD_CONFIRM_FORMATTED_DATA since it will be used by SB and GL3
19 // The associated structs are renamed too.
20 // New task names added.
21 // Added new commands for taper evb communication
22 // Added new DAQ commands
23 // this is iccp.6.0
24 // the whole message structure has changed from 5.x
25 //
26 // 8/25/98 MWS changed SB_ANNOUNCE_SL3_RESULTS, etc.
27 //
28 // 9/08/98 MWS removed all commands, tasks and cmd_size defines
29 // inserted includes that represent the cmd numbering sceme
30 // described in the document
31 // added the cmds2names and task2names files
32 // 3/23/99 MWS major change. The ###2names.hh contain now just externals.
33 // if the name arrays are wanted link with /DAQ/lib/VX/UTIL/iccpNameLib.o
34 // moved the message header into another file
35 */
36 
37 // need daq1000 defintions as well, for ethernet
38 // but only in linux...
39 #include "iccp2k.h"
40 
41 typedef unsigned int uint ;
42 typedef unsigned short ushort ;
43 typedef unsigned char uchar ;
44 typedef char byte ;
45 
46 typedef unsigned char UINT8;
47 typedef unsigned short UINT16;
48 typedef unsigned int UINT32;
49 typedef unsigned long long int UINT64;
50 
51 #if USE_64BITS == 1
52 typedef unsigned long long int UINTPTR;
53 #else
54 typedef unsigned int UINTPTR;
55 #endif
56 
57 #ifndef vxworks
58 #include <stdlib.h>
59 #endif
60 
61 #define IC_MSG_LEN 120
62 
63 #include "cmds.h"
64 #include "tasks.h"
65 #include "status.h"
66 
67 // Formats send to L3
68 
69 #define L3_DEFINES 0
70 #define L3_GL3_ONLY 1
71 #define L3_GL3_SL3 2
72 #define L3_GL3_COMPRESSED 3
73 #define L3_GL3_SL3_COMPRESSED 4
74 
75 // formats send to the meszzanine
76 
77 #define MEZZANINE_DEFINES 0
78 #define RAW 1
79 #define RAW_COMPRESSED 2
80 #define ZERO_SUPPRESSED 3
81 #define ZERO_SUPPRESSED_COMPRESSED 4
82 
83 // some defined event status codes
84 // for the SB
85 #define SB_TOKEN_UNKNOWN 0
86 #define SB_CLUSTER_FINDER_STARTED 1
87 #define SB_CLUSTER_FINDER_DONE 2
88 #define SB_L3_SUMMARY_REPORTED 3
89 #define SB_FORMATTING_STARTED 4
90 #define SB_FORMATTING_DONE 5
91 #define SB_EVENT_CANCELLED_BY_TRG 6
92 
93 // for the EVB
94 
95 #define EVB_TOKEN_UNKNOWN 0
96 #define EVB_FORMATTING 1
97 #define EVB_BUILDING 2
98 #define EVB_TAPING 3
99 #define EVB_NET_FEED 4
100 #define EVB_EVENT_CANCELLED_BY_TRG 5
101 
102 // for the GL3
103 
104 #define GL3_TOKEN_UNKNOWN 0
105 #define GL3_WAITING_SB_ANNOUNCE 1
106 #define GL3_BUILDING_SL3 2
107 #define GL3_PROCESSING 3
108 #define GL3_REJECT 4
109 #define GL3_PASSED_TO_EVB 5
110 #define GL3_EVENT_CANCELLED_BY_TRG 6
111 
112 
113 // and now new with 6.0 domain bits
114 // Tonko: rearranged the numbers and added ZERO_DOMAIN
115 #define ZERO_DOMAIN 0
116 #define ETHERNET_DOMAIN 1
117 #define VME_DOMAIN 2
118 #define MYRI_DOMAIN 3
119 
120 #define LOCAL_DOMAIN 4
121 #define EVB_LOCAL_DOMAIN 4
122 
123 #define SB_LOCAL_DOMAIN 5
124 #define MZ_LOCAL_DOMAIN 6
125 #define SECTOR_DOMAIN 7
126 #define SCI_SL3_SB_DOMAIN 8
127 #define SCI_ICCP_DOMAIN 9
128 
129 #define ETHDOOR_DOMAIN 10
130 
131 // the src id can contain the following transport marker in the top 4 bits
132 #define SCI_TRANSPORT 0xF
133 #define LOCAL_TRANSPORT 0
134 
135 
136 // I guess this is a good place for the structs that describe the
137 // messages
138 // this is what ICCP 6.0 messages contain
139 // the message is called ic_msg
140 // and the union that contains all the different message
141 // bodies is ld (for load) I am happy to get input on
142 // name changes!!!!! (announce is a good candidate to be replaced)
143 
144 #pragma pack(1)
145 
146 // the CMD struct
147 struct ic_cmd_ping { uint dummy;};
148 struct ic_cmd_response { uint transaction ;};
149 struct ic_cmd_ack { uint transaction ;};
150 struct ic_cmd_cancel { uint transaction ;};
151 struct ic_cmd_req_stat { uint dummy ;};
152 struct ic_cmd_release_token { uint dummy ; };
153 struct ic_cmd_confirm_release{ uint dummy ;};
154 struct ic_cmd_confirm_formatted_data{ uint dummy ;};
155 struct ic_confirm_send { uint dummy ; };
156 // EVB
157 struct ic_evb_stat { uint dummy ;};
158 struct ic_evb_format_data{ uchar cs ; uchar res ; ushort format ;} ;
160 {
161  uint haddr;
162  uint laddr;
163  uint det_evt_id;
164  uint evb_evt_id;
165 } ;
167  uint words;
168  uint evt_id;
169  uint task;
170 };
172  uint words;
173  uint ptr; // actually a pointer! eth->evb same address space
174 };
175 // struct ic_evb_tape_request{ uint* addr;} ;
177  int readoutPeriod;
178 };
180  int run;
181  int size;
182  int offset;
183  int event;
184  int type;
185  int token;
186  int evp_type; // used by evp
187  int n_evp_type; // used by evp
188  int buffer;
189  int flags; // bit 0 set, tpc raw data inside
190 };
192  int size;
193  int token;
194  int buffer;
195  int flags; // bit 0 set, tpc raw data inside
196 };
198  int offset; // used for location of data...
199  int size;
200  int disk;
201  char name[20]; // used for filename
202  int run;
203  int streamIdx;
204  int fileIdx;
205  int buffer; // not used by taper, but passed back
206  int stream; // not used by taper, but passed back
207 };
208 
210  int offset;
211  int size;
212  int buffer;
213  int stream;
214  int disk;
215 };
216 
218  uint buff;
219  uint words;
220  uint node;
221 };
222 
223 
224 
226  int size;
227  int disk;
228  char name[20]; // used for filename
229  int run;
230  int streamIdx;
231  int fileIdx;
232  int eventIdx;
233  int stream; // not used by taper, but passed back
234 };
235 
237  int size;
238  int eventIdx;
239  int stream;
240  int disk;
241 };
242 
243 // taper
244 //struct ic_taper_done{ uint dummy; } ;
246  int run;
247  int size;
248  int offset;
249  int buffer;
250 };
251 
252 struct ic_spool_write_list { int listIdx; };
253 
254 struct ic_spool_list_written { int listIdx; };
255 
256 // daq
257 struct ic_daq_run_start{ uint dummy ;} ;
259 {
260  int run_number;
261  int num_files;
262  int num_events;
263  int junk;
264 } ;
265 struct ic_daq_run_pause{ uint run_number ;} ;
267 {
268  uint run_number;
269  uint num_triggers;
270 } ;
271 struct ic_daq_send_config { uint port; uint handler_id; };
272 struct ic_daq_flush_tokens { uint run_number; };
273 struct ic_reboot { uint system; };
275 {
276  uint run_number;
277  uint num_triggers;
278 };
280 {
281  uint run_number;
282  uint junk;
283 };
285 {
286  uint run_number;
287 };
289 {
290  uint run_number;
291  uint num_triggers;
292 };
294 {
295  uint dummy;
296 };
298 {
299  uint dummy;
300 };
302 {
303  uint dummy;
304 };
306 {
307  uint run_number;
308  uint type;
309 };
311 {
312  uint ntriggers;
313 };
315 {
316  uint num_tokens;
317  uint state;
318  uint rb[12];
319 };
320 
321 
322 // GL3
324 {
325  uint bxm ; uint bxl ;
326  ushort trg_cmd ; ushort trg_word ;
327  ushort res ; unsigned trg_type :4 ; unsigned trg_token :12 ;
328 } ;
329 // GB
330 struct ic_gb_build
331 {
332  ushort gl3Node ;
333  uchar accept;
334  uchar build ;
335  uint eventDesc[10] ; // take from data!
336  uint L3summ[4] ;
337  uint L2summary[2];
338  uint L1summary[2];
339  uint rtsDetMask ;
340  uint eventNumber;
341  uint sec;
342  uint usec;
343  uint flags; // bit 0 set, tpc raw data inside
344 } ;
345 
346 //struct ic_gl3_send_sl3 { uint* dest_header ; uint* dest_clusters ; uint* dest_tracks ; uint* dest_debug; };
347 struct ic_gl3_stat { uint dummy ;};
349 {
350  uint size_L3_header ; // this can be GL3 or GL3+SL3s
351  uint size_TRG_data ;
352  uint size_L3_data[11] ;
353 };
354 
356  uint sz; // event size
357  uint buff_id; // event buffer id
358  int local_id;
359  int tmtoken;
360  int evbidx;
361 };
362 
364  int cmd;
365  int buff_id;
366  int idx;
367 };
368 
369 /*
370 struct ic_l4_event {
371  uint l2trg_lo;
372  uint l2trg_hi;
373  uint l4trg_lo; // lo 32 bits of the trigger mask
374  uint l4trg_hi; // hi 32 bits of the trigger mask
375  uint buff_id; // event buffer id for the hlt data
376  uint evt_sz; // sz of the original event
377  uint l4_sz; // sz of the l4 output buffer
378  int local_id;
379  int tmtoken;
380  int evbidx;
381  int writeTracks;
382 };
383 */
384 
385 // Payloads for the l4 taping commands
387  uint buff_id;
388  uint sz;
389  uint disk;
390  uint fd;
391 };
392 
393 
394 //struct ic_announce_trg_sum {uint* addr ;};
395 // SB
396 struct ic_sb_announce_sl3{ uint size_of_header ; uint size_of_clusters ; uint size_of_tracks ; uint size_of_debug ; } ;
398 {
399  uint size_header ;
400  uint size_data[12] ; // size is in long words
401 } ;
402 struct ic_rcv_stat{ uchar res ; uchar mz_A ;uchar mz_B ;uchar mz_C ;};
403 struct ic_sb_stat { ic_rcv_stat rcv[12] ; } ;
404 
405 struct ic_sb_confirm_sl3 { uint dummy ;};
406 
407 //struct ic_bb_announce_event {
408 // uint size;
409 // uint token;
410 //};
411 //struct ic_bb_announce_data {
412 // uint buffer;
413 // uint offset; // Offset of this buffer in the event
414 // uint size; // Must be <= BB_STAGE_BUFF_SZ
415 //};
417  uint buffer;
418  uint addr_hi;
419  uint addr_lo;
420 };
421 //struct ic_bb_confirm_send { // use with CONFIRM_SEND command
422 // uint buffer;
423 // uint last;
424 //};
425 //struct ic_bbm_announce_data {
426 // uint size;
427 //};
428 //struct ic_bbm_send_data {
429 // uint offset;
430 // uint shm;
431 // int size;
432 //};
433 //struct ic_qdsend_announce_chunk {
434 // uint chunkwords; // For next chunk, 0 if no more
435 // uint last_chunkwords; // was there a previous send/?
436 // uint source_hi; // just gets passed back to sender
437 // uint source_lo;
438 // uint final_dest_hi; // rcv saves this
439 // uint final_dest_lo;
440 //};
441 //struct ic_qdsend_send_chunk {
442 // uint addr_hi; // Source address's (actual)
443 // uint addr_lo;
444 // uint dest_hi; // Destination address's (actual)
445 // uint dest_lo; //
446 // uint chunkwords;
447 //};
448 //struct ic_qmyri_memcpy_start {
449 // uint pTargetBuff_hi;
450 // uint pTargetBuff_lo;
451 // uint localBuffSegment;
452 // uint localBuffOffset;
453 // uint len;
454 // uint targetId;
455 //};
456 //struct ic_qmyri_memcpy_done {
457 // uint dummy;
458 //};
459 //struct ic_qmyri_ctl {
460 // int ctl_cmd;
461 // int seg; // if MCTL_REG_MEM
462 // int size; // if MCTL_REG_MEM
463 // int log_level; // if MCTL_LOG_LEVEL
464 // int daqNode; // if MCTL_NODE
465 // int myriNode; // if MCTL_NODE
466 // char name[32]; // if MCTL_NODE
467 //};
468 
470  int type; // 1=token 0, 2=physics, 4=special, 7=any...
471 };
473  int size; // words
474  int type;
475  int run;
476  int evts_of_type;
477  int evts;
478  int addr; // new... evpx protocol!
479 };
481  int addr_hi;
482  int addr_lo;
483 };
485  int dummy;
486 };
488  int dummy;
489 };
490 
491 // struct ic_rcf_write_event {
492 // int run;
493 // int size;
494 // int shm;
495 // int offset;
496 // int event;
497 // int type;
498 // int token;
499 // };
501  uint dummy;
502 };
503 //struct ic_rcf_list_written {
504 // struct rcfEventList *el;
505 //};
507  uint direction;
508  uint addr_hi;
509  uint addr_lo;
510  uint size;
511  char filename[92]; // 120 - (4 * 4) - (4 * 3)
512 };
513 // struct ic_rcf_confirm_event {
514 // int run;
515 // int size;
516 // int shm;
517 // int offset;
518 // int event;
519 // };
520 
522 {
523  int dummy;
524 };
526 {
527  int disk;
528  char filename[100];
529 };
531 {
532  int disk;
533  char filename[100];
534 };
536 {
537  int run;
538  int seq;
539 };
541 {
542  int disk;
543  int throttleRate;
544 };
546 {
547  int disk;
548  int run;
549  int seq;
550 };
551 
552 
554  int sz;
555  int detLocalId; // ID passed to and from dets...
556  int dummy;
557  UINT64 rtsMask;
558 };
559 
561  int TknMgrEventNumber;
562  int evbNodeIdx;
563  int detLocalId; // ID passed to and from dets...
564 };
565 
566 //-----======------||||||------~~~~~~-----======------||||||------~~~~~~
567 union ic_load
568 {
569  uint dword[27] ;
570  ushort word[54] ;
571  uchar byte[108] ; // this is the max you have
572 #if !(defined(NOT_DAQ) || defined(alpha))
573  ic_cmd_ping cmd_ping ;
574  ic_cmd_response cmd_rsp ;
575  ic_cmd_ack cmd_ack ;
576  ic_cmd_cancel cmd_cancel ;
577  ic_cmd_req_stat cmd_req_stat ;
578  ic_cmd_release_token cmd_release_token;
579  ic_cmd_confirm_release cmd_confirm_release ;
580  ic_cmd_confirm_formatted_data cmd_confirm_data ;
581  ic_confirm_send confirm_send;
582 
583  ic_evb_stat evb_stat; // I'll send my status (Iam EVB)
584  ic_evb_format_data evb_format ;
585  ic_evb_send_data evb_send_data;
586  ic_det_announce_data det_announce_data;
587 
588  ic_evb_announce_memcpy2 evb_announce_memcpy2;
589  ic_rts_write_counters rts_write_counters ;
590 
591  ic_evb_tape_request evb_tape_request ;
592  ic_spool_event_written spool_event_written ;
593  ic_spool_write_event spool_write_event;
594 
595  ic_taper_done taper_done ;
596 
597  ic_evbx_tape_request evbx_tape_request ;
598  ic_evbx_spool_event_written evbx_spool_event_written ;
599  ic_evbx_spool_write_event evbx_spool_write_event;
600 
601 
602  ic_daq_run_start daq_run_start ;
603  ic_daq_run_stop daq_run_stop ;
604  ic_daq_run_pause daq_run_pause ;
605  ic_daq_run_resume daq_run_resume ;
606  ic_daq_send_config daq_send_config ;
607  ic_daq_flush_tokens daq_flush_tokens;
608 
609  ic_reboot reboot ;
610  ic_drc_run_start drc_run_start ;
611  ic_drc_run_stop drc_run_stop ;
612  ic_drc_run_pause drc_run_pause ;
613  ic_drc_run_resume drc_run_resume ;
614  ic_drc_get_config drc_get_config ;
615  ic_drc_set_config drc_set_config ;
616  ic_drc_send_config drc_send_config ;
617  ic_drc_flush_tokens drc_flush_tokens ;
618  ic_drc_query_tokens drc_query_tokens ;
619  ic_mz_emul_fiber mz_emul_fiber ;
620 
621  ic_gb_build gb_build ;
622 
623  ic_gl3_build gl3_build ;
624 
625  //ic_gl3_send_sl3 gl3_snd_sl3 ;
626 
627  ic_gl3_stat gl3_stat ;
628  ic_gl3_announce_data gl3_announce_data ;
629  //ic_announce_trg_sum announce_trg_sum; // this is not a nice name !!!
630 
631  ic_sb_announce_sl3 sb_announce_sl3 ;
632  ic_sb_announce_formatted_data sb_announce_data ; // this is for the evb
633  ic_sb_stat sb_stat ;
634  ic_sb_confirm_sl3 sb_confirm_sl3 ; // I have send the SL3 results
635  //ic_bb_announce_event bb_announce_event;
636  //ic_bb_announce_data bb_announce_data;
637  ic_bb_send_data bb_send_data; // use by vxFileRequest Server
638  //ic_bb_confirm_send bb_confirm_send;
639  // ic_rcf_write_event rcf_write_event;
640  ic_rcf_writer_flush rcf_writer_flush;
641  //ic_rcf_list_written rcf_list_written;
642  // ic_rcf_confirm_event rcf_confirm_event;
643  // ic_bbm_send_data bbm_send_data;
644  //ic_bbm_announce_data bbm_announce_data;
645 
646 
647  //ic_qmyri_memcpy_start qmyri_memcpy_start;
648  //ic_qmyri_memcpy_done qmyri_memcpy_done;
649  //ic_qmyri_ctl qmyri_ctl;
650 
651  ic_evp_req_event evp_req_event;
652  ic_evp_announce_event evp_announce_event;
653  ic_evp_send_event evp_send_event;
654  ic_evp_confirm_event evp_confirm_event;
655  ic_evp_event_done evp_event_done;
656 
657  ic_vx_request_file vx_request_file;
658 
659  ic_spool_list_written spool_list_written;
660  ic_spool_write_list spool_write_list;
661 
662  ic_rcf_get_file rcf_get_file;
663  ic_rcf_write_file rcf_write_file;
664  ic_rcf_release_file rcf_release_file;
665  ic_spool_get_disk spool_get_disk;
666  ic_spool_use_disk spool_use_disk;
667  ic_spool_free_disk spool_free_disk;
668 
669  ic_eth_announce eth_announce;
670 
671  ic_l4_internal l4_internal;
672  ic_l4_startevent l4_startevent;
673  //ic_l4_event l4_event;
674  ic_l4_evt_descriptor l4_evt_descriptor;
675 
676  //TokenManagerResults tokenManagerResults;
677  //TokenManagerIccpPayload tokenManagerIccpPayload;
678 
679 #endif /* NOT_DAQ */
680  // ic_qdsend_announce_chunk qdsend_announce_chunk;
681  // ic_qdsend_send_chunk qdsend_send_chunk;
682 };
683 //-----======------||||||------~~~~~~-----======------||||||------~~~~~~
684 #include "iccpHeader.h"
685 struct ic_msg
686 {
687  ic_msg_head head ;
688  ic_load ld ; // for practical reasons I'll keep it short
689 } ;
690 
691 #pragma pack()
692 
693 
694 #include "rtsSystems.h"
695 
696 #endif
Definition: iccp.h:685
Definition: iccp.h:567
Definition: rb.hh:21