ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcdcsSEQ.hpp
Go to the documentation of this file.
1
8#ifndef ngcdcsSEQ_H
9#define ngcdcsSEQ_H
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16#include <ngc/core/ngcbAddr.h>
17#include <ngc/core/ngcbMOD.hpp>
19#include <ngc/core/ngcbDIC.hpp>
22
26#define ngcdcsSEQ_NGCII 0x00010000
27
31#define ngcdcsSEQ_MAX_PAT (ngcbSEQ_PATRAM_SIZE / 4)
32
36#define ngcdcsSEQ_MAX_STATES ngcbSEQ_PATRAM_SIZE
37
38/*
39 * Sequencer soft states
40 */
41#define ngcdcsSEQ_STAT_IDLE 0x00000000 //< sequencer idle state
42#define ngcdcsSEQ_STAT_WAITING 0x00000001 //< sequencer waiting state
43#define ngcdcsSEQ_STAT_RUNNING 0x00000002 //< sequencer running state
44#define ngcdcsSEQ_STAT_PAUSED 0x00000004 //< sequencer paused state
45#define ngcdcsSEQ_STAT_FAILURE 0x10000000 //< sequencer failure state
46
47/*
48 * Trigger modes
49 */
50#define ngcdcsSEQ_TRIGGERMODE_DIRECT 0x0 //< direct trigger mode
51#define ngcdcsSEQ_TRIGGERMODE_SHUTTER 0x1 //< shutter mode
52
53/*
54 * Sequencer control flags alignment
55 */
56#define ngcdcsSEQ_CTRL_DISABLE 0 //< disable sequencer control flags
57#define ngcdcsSEQ_CTRL_ALIGN 1 //< align sequencer control flags
58
64 unsigned int low;
65
67 unsigned int high;
68
70 int time;
71
73 int mod;
74
76 ngcdcs_pat_st_t() {low = 0x0; high = 0x0; time = 0; mod = 0;}
77};
78
83{
84public:
86 int addr;
87
90
93
95 int time;
96
98 char name[128];
99
102 addr = -1;
103 numStates = 0;
104 time = 0;
105 memset(name, 0, sizeof(name));
106 state = NULL;
107 }
108
110 virtual ~ngcdcs_pat_t() {}
111
112protected:
113private:
114};
115
120{
121public:
124
126 virtual ~ngcdcs_pat_ld_t() {delete[] state;}
127
128protected:
129private:
130};
131
136 int idx; //< Pattern index
137 char name[64]; //< Pattern name
138
140 ngcdcs_pat_assign_t() {idx = 0; name[0] = '\0';}
141};
142
147 char name[64]; //< Keyword name
148 char value[256]; //< Keyword value
149
151 ngcdcs_key_assign_t() {name[0] = '\0'; value[0] = '\0';}
152};
153
158 int sx; //< Start pixel in x-direction
159 int sy; //< Start pixel in y-direction
160 int nx; //< Window dimension in x-direction
161 int ny; //< Window dimension in y-direction
162 int dx; //< Chip dimension in x-direction
163 int dy; //< Chip dimension in y-direction
164 int rot; //< Rotation
165 int sx_flag; //< Start pixel in x-direction changed
166 int sy_flag; //< Start pixel in y-direction changed
167 int nx_flag; //< Dimension in x-direction changed
168 int ny_flag; //< Dimension in y-direction changed
169 int rot_flag; //< Rotation has changed
170
173 sx = 1; sy = 1;
174 nx = 0; ny = 0; // full size
175 rot = 0; dx = 0; dy = 0; // no rotation
176 sx_flag = 0; sy_flag = 0;
177 nx_flag = 0; ny_flag = 0;
178 rot_flag = 0;
179 }
180};
181
186{
187public:
189 double clock;
190
193
195 int cvtExt;
196
199
202
205
208
211
214
217
219 int status;
220
223
225 char clkFile[256];
226
228 char prgFile[256];
229
232
235
238
241
244
247
249 double realDit;
250
252 double tim;
253
256
258 int sync;
259
261 int convert[2];
262
265
268
271
274
277
280
282 FILE *sdebug;
283
285 ngcdcsSEQ0(const ngcb_route_t &r, int nc, int nb)
286 : ngcdcsCLDC0(r, nc, nb) {
287 Init_();
288 }
289
294 ngcdcsSEQ0(ngcbIFC *ifc, const ngcb_route_t &r, int nc, int nb)
295 : ngcdcsCLDC0(ifc, r, nc, nb) {
296 Init_();
297 }
298
300 virtual ~ngcdcsSEQ0() {}
301
303 virtual int Selftest() {
304 Verbose("ngcdcsSEQ%d: selftest\n", Instance()+1);
305 return (Success());
306 }
307
309 virtual int RunCtrl(int flag) {
310 runCtrl = flag;
311 return (Success());
312 }
313
315 virtual int CvtExt(int flag) {
316 cvtExt = flag;
317 return (Success());
318 }
319
321 virtual int Convert(int strobe, int flag) {
322 if ((strobe == 1) || (strobe == 2)) convert[strobe - 1] = flag;
323 return (Success());
324 }
325
327 virtual int SyncExt(int flag) {
328 syncExt = flag;
329 return (Success());
330 }
331
333 virtual int Start() {
334 numTrigger_ = 0;
336 return (Success());
337 }
338
340 virtual int Pause() {
342 return (Success());
343 }
344
346 virtual int Stop(int align, int force = 0) {
347 USE(align); USE(force);
349 return (Success());
350 }
351
353 virtual int Align() {return (Success());}
354
356 virtual int Disarm() {return (Success());}
357
359 virtual int Break(int trigger = 1) {
360 USE(trigger);
361 return (Stop(ngcdcsSEQ_CTRL_ALIGN, 1));
362 }
363
365 virtual int BreakTimeout(int force = 0) {
366 USE(force);
367 return (0);
368 }
369
371 virtual int Wait(int event, int timeout, int interval) {
372 USE(event); USE(timeout); USE(interval);
373 return (Success());
374 }
375
377 virtual int TriggerOn(int flag) {
378 triggerOn = flag;
379 return (Success());
380 }
381
383 virtual int TriggerMode(int mode) {
384 triggerMode = mode;
385 return (Success());
386 }
387
389 virtual int Trigger(int armed=1) {
390 USE(armed);
391 numTrigger_++;
392 return (Success());
393 }
394
396 virtual int ClearPrgFile() {
397 prgFile[0] = '\0';
398 return (Success());
399 }
400
402 virtual int LoadPrgFile(const char *fileName = NULL) {
403 if (fileName != NULL) str2str(prgFile, fileName, sizeof(prgFile) - 1);
404 return (Success());
405 }
406
408 virtual int Window(ngcdcs_win_t w) {
409 win.sx = w.sx; win.sy = w.sy; win.nx = w.nx; win.ny = w.ny;
410 win.rot = w.rot;
411 updateFlag = 1;
412 Verbose("ngcdcsSEQ%d: window is [%d,%d,%d,%d] - rot = %d\n",
413 Instance() + 1, win.sx, win.sy, win.nx, win.ny, win.rot);
414
415 return (Success());
416 }
417
419 virtual void NewStatus(int newStatus) {
420 status = newStatus;
421 switch (status)
422 {
424 {
425 strcpy(statStr_, "idle"); break;
426 }
428 {
429 strcpy(statStr_, "running"); break;
430 }
432 {
433 strcpy(statStr_, "paused"); break;
434 }
436 {
437 strcpy(statStr_, "waiting"); break;
438 }
440 {
441 strcpy(statStr_, "failure"); break;
442 }
443 default:
444 {
445 strcpy(statStr_, "unknown"); break;
446 }
447 }
448 }
449
451 virtual char *StatusString() {return statStr_;}
452
454 virtual int Status(int *s) {*s = 0x0; return (Success());}
455
457 virtual int RunningState() {
458 return ((status != ngcdcsSEQ_STAT_IDLE) &&
460 }
461
463 virtual int FailureState() {return (status == ngcdcsSEQ_STAT_FAILURE);}
464
466 virtual ngcb_evt_t Event(int stat) {
467 ngcb_evt_t e;
468 e.board = route.Board();
471 e.cond = 1;
472 switch (stat)
473 {
475 {
476 e.reference = e.mask;
477 break;
478 }
479 default:
480 {
481 e.reference = ~e.mask;
482 break;
483 }
484 }
485 return (e);
486 }
487
489 virtual int DwellTime(int f, int a) {
490 timeFactor = f; timeAdd = a;
491 return (Success());
492 }
493
495 virtual int TimeFactor(int f) {
496 timeFactor = f;
497 return (Success());
498 }
499
501 virtual int TimeAdd(int a) {
502 timeAdd = a;
503 return (Success());
504 }
505
507 virtual int SimSeqTiming() {return (Success());}
508
510 virtual int LoadClkFile(const char *fileName) {
511 USE(fileName);
512 return (Success());
513 }
514
516 virtual unsigned int NumTrigger() {return (0);}
517
522 virtual unsigned int BlindTrigger() {return (0);}
523
528 virtual unsigned int LostTrigger() {return (0);}
529
530protected:
531
532private:
534 char statStr_[32];
535
537 int numTrigger_;
538
540 void Init_() {
542 strcpy(statStr_, "idle");
543 clock = 10e-9; // default clock is 10 nanoseconds
544 runCtrl = 1;
545 cvtExt = 1;
546 breakMode = 0;
547 continuous = 0;
548 memset(clkFile, 0, sizeof(clkFile));
549 memset(prgFile, 0, sizeof(prgFile));
550 clkFile[0] = '\0';
551 prgFile[0] = '\0';
552 triggerOn = 0;
554 timeFactor = 1;
555 timeAdd = 0;
556 timeSim = 1;
557 updateFlag = 0;
558 new_prgfile = 0;
559 useBreakTmo = 0;
560 triggerCtrl = 1;
561 numTrigger_ = 0;
562 realDit = 0.0;
563 tim = 0.0;
564 timAuto = 0;
565 autoStop = 1;
566 sync = 0x2; // disbled by default
567 stopDelay = 5; // 5 milliseconds
568 syncExt = 1;
569 convert[0] = 1;
570 convert[1] = 1;
571 dictionary = NULL;
572 dicParam = NULL;
573 sdebug = NULL;
574 optimize = 0;
575 }
576};
577
582{
583public:
585 explicit ngcdcsSEQ(const ngcb_route_t &r);
586
588 ngcdcsSEQ(ngcbIFC *ifc, const ngcb_route_t &r);
589
592
594 ngcdcsSEQ(ngcbIFC *ifc, const ngcb_route_t &r, ngcbPARAM_LIST *p);
595
597 virtual ~ngcdcsSEQ();
598
601
604
607
610
613
616
619
621 int pdu[4];
622
624 int packets[4];
625
627 int bpix[4];
628
631
633 int Selftest();
634
635 /*
636 * Clock patterns
637 */
638
640 int ClkState(int idx, int flag);
641
643 int ClkState(int idx);
644
646 int PatTime(const ngcdcs_pat_t &pat, int apply = 1);
647
649 int PatNumStates(const ngcdcs_pat_t &pat);
650
652 void StorePatSetup();
653
655 int RestorePatSetup();
656
658 int InitPat(int low, int high);
659
661 int InitPatLow(int value);
662
664 int InitPatHigh(int value);
665
667 int InitPatFirst(int n);
668
670 int InitPatLast(int n);
671
673 int InitPatLow();
674
676 int InitPatHigh();
677
679 int LastPat(int *low, int *high);
680
682 int FirstPat(int *low, int *high);
683
685 int SetupPat(int stopFlag = 1);
686
688 int SetPat(int idx, ngcdcs_pat_t &pat);
689
691 int GetPat(ngcdcs_pat_t *pat);
692
694 int GetPat(int idx, ngcdcs_pat_t *pat);
695
697 int CheckPatRam();
698
700 int GetState(int *low, int *high, int patNum, int stateNum);
701
703 int SetPatClk(int idx, int clkNum, const char *s);
704
706 void DumpPat(char *reply, const ngcdcs_pat_t &pat);
707
709 int DwellTime(int factor, int add);
710
712 int TimeFactor(int factor);
713
715 int TimeAdd(int add);
716
718 int LoadClkFile(const char *name);
719
721 int SaveClkFile(const char *fileName);
722
724 virtual int LoadClk(const char *fileName);
725
727 virtual int SaveClk(const char *fileName);
728
730 int Monitor(int num, int clkChan);
731
732 /*
733 * Sequencer program
734 */
735
737 int ExecTime(double *execTime);
738
740 int ExecTime(double *execTime, int *prgCode, int codeAddr, int length);
741
743 int ResolveSubRt(ngcdcs_seqp_t *prg);
744
746 int CleanLoop(ngcdcs_seqp_t *prg);
747
749 int CheckPrg(const ngcdcs_seqp_t &prg);
750
752 int CheckSeqRam();
753
755 int SetPrg(const ngcdcs_seqp_t &prg);
756
758 int GetPrg(ngcdcs_seqp_t *prg);
759
761 void DumpCode(char *reply, const ngcdcs_seqp_t &prg, int offset, int length);
762
764 int DumpPrg(char *reply, ngcdcs_seqp_t &prg, int n = -1);
765
767 int ClearPrgFile();
768
770 int LoadPrgFile(const char *name = NULL);
771
773 virtual int PrgFile(const char *fileName);
774
776 int Parameters(const char *fileName, char *list);
777
779 int MinPulse(double *min, int clkNum);
780
782 int PulseCnt(int *rising, int *falling, int clkNum);
783
785 int BreakTimeout(int force = 0);
786
788 int SimPrg(ngcdcsSEQ_EMU *emulator, ngcdcs_ticks_t start, int length);
789
791 int SimSeqTiming();
792
794 int SetPdu(int value, int chan = 0);
795
797 int SetPackets(int value, int chan = 0);
798
800 int SetBytesPerPix(int value, int chan = 0);
801
802 // Get RTMS frame configuration
803 int GetFramCfg(int *pduValue, int *packetsValue, int *bpix, int chan);
804
805 /*
806 * Sequencer control
807 */
808
810 void Reset();
811
813 int Enable(int check = 1);
814
816 int Disable();
817
819 int Convert(int strobe, int flag);
820
822 int TriggerOn(int flag);
823
825 int TriggerMode(int mode);
826
828 int RunCtrl(int flag);
829
831 int CvtExt(int flag);
832
834 int SyncExt(int flag);
835
837 int Start();
838
840 int Step();
841
843 int Stop(int align, int force = 0);
844
846 int Align();
847
849 int Disarm();
850
852 int Pause();
853
855 int Break(int trigger = 1);
856
858 int BreakWait(int timeout, int interval = 100);
859
860 // Poll with timeout until status matches event
861 int Wait(int event, int timeout, int interval = 100);
862
864 int Trigger(int armed = 1);
865
866
867 /*
868 * Status
869 */
870
872 void NewStatus(int newStatus);
873
875 char *StatusString();
876
878 int Status(int *hwStat);
879
881 ngcb_evt_t Event(int stat);
882
885 return ((status != ngcdcsSEQ_STAT_IDLE) &&
887 }
888
891
893 unsigned int NumTrigger() {return (numTrigger_);}
894
899 unsigned int BlindTrigger() {return (blindTrigger_);}
900
905 unsigned int LostTrigger() {return (lostTrigger_);}
906
908 virtual int LookupCB(const char *name, char *value);
909
911 int SlxEnable();
912
914 int SlxDisable();
915
917 int ShiftOut(const char *array, int numBits);
918
920 int ShiftOut(const int *array, int numBits);
921
923 int SlxSetup(const char *key, const int *idx, const char *value,
924 int *status = NULL);
925
927 int SlxStatus(const char *key, const int *idx, char *value,
928 int *status = NULL);
929
930protected:
931
932private:
934 void Init_();
935
937 int revision_;
938
940 ngcbPARAM_LIST *paramList_;
941
942
943 /*
944 * Clock patterns
945 */
946
949
952
954 ngcdcs_pat_t *pattern_;
955
957 int clkMask_[2];
958
960 int initPatLow_;
961
963 int initPatHigh_;
964
966 int initPatLow0_;
967
969 int initPatHigh0_;
970
972 int initPatNum_;
973
975 int autoInitDone_;
976
978 int InitPat_(int low, int high);
979
981 int AutoInit_();
982
984 int patStored_;
985
987 int WritePat_(const ngcdcs_pat_t &pat);
988
990 int LoadClkBin_(const char *fileName);
991
993 int SaveClkBin_(const char *fileName);
994
996 int LoadClkAscii_(const char *fileName);
997
999 int SaveClkAscii_(const char *fileName);
1000
1002 int ResetPatterns_(int clr = 0);
1003
1005 int ClockVal_(int c, const ngcdcs_pat_st_t &s);
1006
1008 int CheckDwellTime_(int factor, int add);
1009
1011 int LastPatNum_(const ngcdcs_seqp_t &prg, const int *code, int size);
1012
1014 int FirstPatNum_(const ngcdcs_seqp_t &prg, const int *code, int size);
1015
1016
1017 /*
1018 * Sequencer program
1019 */
1020
1022 int seqRamClr_[3];
1023
1025 int seqRam_[ngcbSEQ_RAM_SIZE];
1026
1028 int breakTmo_;
1029
1031 int breakTmoFlag_;
1032
1034 int WritePrg_(const ngcdcs_seqp_t &prg);
1035
1037 int PrgFileBin_(const char *fileName);
1038
1040 int PrgFileAscii_(const char *fileName, char *setupBuf = NULL);
1041
1043 void AddSeqIdx_(char *keyWord);
1044
1046 void DelSeqIdx_(char *keyWord);
1047
1049 int Lookup_(const char *name, char *value);
1050
1052 ngcbPARAM *DynParam_(const char *name);
1053
1055 int CleanLoop_(int *code, int *codeLength);
1056
1058 int LdCode_(const char *fileName, int *code, int *length,
1059 ngcdcs_shift_t *shift, char *setupBuf = NULL);
1060
1062 int Script_(const char *shell, const char *script, FILE *dbg,
1063 ngcdcs_key_assign_t *defParam, int numDefParam,
1064 ngcdcs_key_assign_t *defSubRt, int numDefSubRt,
1065 ngcdcs_pat_assign_t *defPat, int numDefPat,
1066 ngcdcs_key_assign_t *newParam, int *numNewParam,
1067 int *loops);
1068
1070 int NumWaitStates_(int *prgCode, int codeAddr, int length, int *ret = NULL);
1071
1073 int BreakTimeout_(double *timeout);
1074
1075 /*
1076 * Status and monitoring
1077 */
1078
1080 unsigned int numTrigger_;
1081
1083 unsigned int blindTrigger_;
1084
1086 unsigned int lostTrigger_;
1087
1089 char statStr_[32];
1090
1092 int stopped_;
1093
1095 int firstRun_;
1096
1098 int Start_(int step = 0);
1099};
1100
1101#endif
Definition ngcbDIC.hpp:51
Definition ngcbIFC.hpp:760
ngcb_route_t route
Local route to module (header)
Definition ngcbMOD.hpp:31
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:68
int Instance()
Get instance.
Definition ngcbOBJ.cpp:58
virtual void Verbose(int level, const char *format,...) __attribute__((format(printf
Verbose message if verbose level exceeds level.
Definition ngcbOBJ.cpp:74
Definition ngcbPARAM.hpp:201
Definition ngcbPARAM.hpp:41
ngcdcsCLDC0(const ngcb_route_t &r, int nc, int nb)
Constructor with route, number of clocks and number of biases.
Definition ngcdcsCLDC.hpp:213
virtual int LoadPrgFile(const char *fileName=NULL)
Load program file.
Definition ngcdcsSEQ.hpp:402
virtual int Start()
Start sequencer.
Definition ngcdcsSEQ.hpp:333
char clkFile[256]
Clock pattern file name.
Definition ngcdcsSEQ.hpp:225
virtual unsigned int LostTrigger()
Definition ngcdcsSEQ.hpp:528
int status
Soft state: idle, waiting, running or failure.
Definition ngcdcsSEQ.hpp:219
virtual int LoadClkFile(const char *fileName)
Load clock pattern file.
Definition ngcdcsSEQ.hpp:510
virtual int SyncExt(int flag)
Enable/disable external SYNC pulse.
Definition ngcdcsSEQ.hpp:327
ngcdcs_win_t win
Read-out window.
Definition ngcdcsSEQ.hpp:222
virtual int SimSeqTiming()
Simulate timing.
Definition ngcdcsSEQ.hpp:507
int timAuto
Automatic computation of minimum TIM-period.
Definition ngcdcsSEQ.hpp:255
int syncExt
External SYNC pulse.
Definition ngcdcsSEQ.hpp:198
virtual int TimeFactor(int f)
Set dwell-time factor.
Definition ngcdcsSEQ.hpp:495
virtual int BreakTimeout(int force=0)
Compute timeout for break command.
Definition ngcdcsSEQ.hpp:365
int timeAdd
Global dwell-time add.
Definition ngcdcsSEQ.hpp:240
ngcdcsSEQ0(const ngcb_route_t &r, int nc, int nb)
Constructor with route, number of clocks and number of biases.
Definition ngcdcsSEQ.hpp:285
virtual int FailureState()
Check if sequencer is in failure state.
Definition ngcdcsSEQ.hpp:463
int breakMode
Break mode.
Definition ngcdcsSEQ.hpp:201
virtual int Window(ngcdcs_win_t w)
Set read-out window.
Definition ngcdcsSEQ.hpp:408
int runCtrl
External run-control flag.
Definition ngcdcsSEQ.hpp:192
FILE * sdebug
Script debug stream.
Definition ngcdcsSEQ.hpp:282
virtual int Convert(int strobe, int flag)
Enable/disable convert strobe.
Definition ngcdcsSEQ.hpp:321
int stopDelay
Delay after sequencer stop/reset (ms)
Definition ngcdcsSEQ.hpp:246
virtual int TimeAdd(int a)
Set dwell-time add-value.
Definition ngcdcsSEQ.hpp:501
int triggerMode
Trigger mode.
Definition ngcdcsSEQ.hpp:234
virtual int RunningState()
Check if sequencer is in running state.
Definition ngcdcsSEQ.hpp:457
virtual int Status(int *s)
Get status value.
Definition ngcdcsSEQ.hpp:454
int triggerCtrl
Enable/disable automatic trigger control during break.
Definition ngcdcsSEQ.hpp:216
virtual void NewStatus(int newStatus)
Set new soft status.
Definition ngcdcsSEQ.hpp:419
ngcdcsSEQ0(ngcbIFC *ifc, const ngcb_route_t &r, int nc, int nb)
Definition ngcdcsSEQ.hpp:294
virtual int TriggerMode(int mode)
Set Trigger mode.
Definition ngcdcsSEQ.hpp:383
virtual ngcb_evt_t Event(int stat)
Return event configuration for status switch.
Definition ngcdcsSEQ.hpp:466
int convert[2]
Convert strobe enabled.
Definition ngcdcsSEQ.hpp:261
virtual int Stop(int align, int force=0)
Stop sequencer.
Definition ngcdcsSEQ.hpp:346
virtual int RunCtrl(int flag)
Ebnable/disable external run control.
Definition ngcdcsSEQ.hpp:309
int optimize
Optimize.
Definition ngcdcsSEQ.hpp:267
virtual int Align()
Align sequencer control flags.
Definition ngcdcsSEQ.hpp:353
int cvtExt
Exteranl convert.
Definition ngcdcsSEQ.hpp:195
virtual int TriggerOn(int flag)
Enable/disable external trigger.
Definition ngcdcsSEQ.hpp:377
virtual int Disarm()
Disable sequencer control flags.
Definition ngcdcsSEQ.hpp:356
virtual int Break(int trigger=1)
Stop sequencer at next break-point.
Definition ngcdcsSEQ.hpp:359
ngcbPARAM_LIST postSetup
Post-setup.
Definition ngcdcsSEQ.hpp:276
virtual int ClearPrgFile()
Clear program file.
Definition ngcdcsSEQ.hpp:396
int sync
Sequencer synchronized (generic flag)
Definition ngcdcsSEQ.hpp:258
virtual int Trigger(int armed=1)
Issue trigger command.
Definition ngcdcsSEQ.hpp:389
virtual int CvtExt(int flag)
Enable/disable external convert.
Definition ngcdcsSEQ.hpp:315
virtual int DwellTime(int f, int a)
Set dwell-time factor and add-value.
Definition ngcdcsSEQ.hpp:489
virtual int Selftest()
Selftest.
Definition ngcdcsSEQ.hpp:303
double realDit
Actual DIT.
Definition ngcdcsSEQ.hpp:249
ngcbDIC * dictionary
Pointer to dictionary;.
Definition ngcdcsSEQ.hpp:270
double tim
Minimum TIM-period.
Definition ngcdcsSEQ.hpp:252
ngcbPARAM_LIST * dicParam
Dictionary placeholders.
Definition ngcdcsSEQ.hpp:273
int continuous
Continuous mode flag.
Definition ngcdcsSEQ.hpp:204
virtual unsigned int BlindTrigger()
Definition ngcdcsSEQ.hpp:522
ngcbPARAM_LIST useList
Use-list.
Definition ngcdcsSEQ.hpp:279
virtual char * StatusString()
Get status string.
Definition ngcdcsSEQ.hpp:451
virtual int Pause()
Pause sequencer.
Definition ngcdcsSEQ.hpp:340
double clock
Time of one clock tick.
Definition ngcdcsSEQ.hpp:189
char prgFile[256]
Sequencer program file name.
Definition ngcdcsSEQ.hpp:228
int autoStop
Automatic stop/start.
Definition ngcdcsSEQ.hpp:264
int timeFactor
Global dwell-time factor.
Definition ngcdcsSEQ.hpp:237
virtual unsigned int NumTrigger()
Return number of trigger commands since last start.
Definition ngcdcsSEQ.hpp:516
virtual ~ngcdcsSEQ0()
Destructor.
Definition ngcdcsSEQ.hpp:300
int timeSim
Enable sequence time simulation.
Definition ngcdcsSEQ.hpp:243
virtual int Wait(int event, int timeout, int interval)
Poll with timeout until status register matches event.
Definition ngcdcsSEQ.hpp:371
int triggerOn
Trigger enable flag.
Definition ngcdcsSEQ.hpp:231
int useBreakTmo
Use break-timeout.
Definition ngcdcsSEQ.hpp:213
int new_prgfile
Flag, indicating that a new program file is in the setup list.
Definition ngcdcsSEQ.hpp:210
int updateFlag
Flag to update the sequencer program.
Definition ngcdcsSEQ.hpp:207
Definition ngcdcsSEQ_PRG.hpp:205
int GetPrg(ngcdcs_seqp_t *prg)
Get sequencer program.
Definition ngcdcsSeqPrg.cpp:165
int SaveClkFile(const char *fileName)
Save clock pattern file.
Definition ngcdcsSeqClk.cpp:123
int FailureState()
Check if sequencer is in failure state.
Definition ngcdcsSEQ.hpp:890
int clkMon3
Clock on monitor 3.
Definition ngcdcsSEQ.hpp:615
int LoadClkFile(const char *name)
Load clock pattern file.
Definition ngcdcsSeqClk.cpp:27
void Reset()
Align soft-states after reset.
Definition ngcdcsSEQ.cpp:208
int Pause()
Pause sequencer.
Definition ngcdcsSEQ.cpp:1826
int SetPackets(int value, int chan=0)
Set packets per frame per channel.
Definition ngcdcsSeqPrg.cpp:4515
int SetBytesPerPix(int value, int chan=0)
Set bytes per payload data unit per channel.
Definition ngcdcsSeqPrg.cpp:4566
unsigned int BlindTrigger()
Definition ngcdcsSEQ.hpp:899
int packets[4]
Payload packets per frame.
Definition ngcdcsSEQ.hpp:624
int SetPrg(const ngcdcs_seqp_t &prg)
Set sequencer program.
Definition ngcdcsSeqPrg.cpp:122
int Parameters(const char *fileName, char *list)
Get used parameters from file.
Definition ngcdcsSeqPrg.cpp:3714
virtual int LoadClk(const char *fileName)
Clock pattern file loader.
Definition ngcdcsSeqClk.cpp:166
int ShiftOut(const char *array, int numBits)
Copy byte array to shift register.
Definition ngcdcsSeqSlx.cpp:27
int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcdcsSEQ.cpp:218
int CheckSeqRam()
Verify sequencer program RAM consistency.
Definition ngcdcsSeqPrg.cpp:195
int softMon
Use soft monitor for digital clocks.
Definition ngcdcsSEQ.hpp:618
int PulseCnt(int *rising, int *falling, int clkNum)
Compute number of edges on clock.
Definition ngcdcsSEQ.cpp:2445
int Step()
Run til next break-point.
Definition ngcdcsSEQ.cpp:1051
int DumpPrg(char *reply, ngcdcs_seqp_t &prg, int n=-1)
Dump program to string.
Definition ngcdcsSeqPrg.cpp:4248
ngcdcs_pat_t * pattern
Clock pattern setup.
Definition ngcdcsSEQ.hpp:600
void StorePatSetup()
Store patterns to private copy.
Definition ngcdcsSeqPat.cpp:1042
int LoadPrgFile(const char *name=NULL)
Load sequencer program file.
Definition ngcdcsSeqPrg.cpp:312
int bpix[4]
Payload bytes per pixel unit.
Definition ngcdcsSEQ.hpp:627
int TimeFactor(int factor)
Set global dwell-time factor.
Definition ngcdcsSeqPat.cpp:854
int SetPatClk(int idx, int clkNum, const char *s)
Set specific clock timing.
Definition ngcdcsSeqPat.cpp:1427
int clkMon1
Clock on monitor 1.
Definition ngcdcsSEQ.hpp:609
int InitPatFirst(int n)
Init with first state of pattern.
Definition ngcdcsSeqPat.cpp:648
int Disarm()
Disable sequencer control flags.
Definition ngcdcsSEQ.cpp:1279
int Start()
Start sequencer.
Definition ngcdcsSEQ.cpp:1046
int BreakWait(int timeout, int interval=100)
Poll with timeout until break-point is reached.
Definition ngcdcsSEQ.cpp:1319
virtual int SaveClk(const char *fileName)
Clock pattern file saver.
Definition ngcdcsSeqClk.cpp:174
int Break(int trigger=1)
Stop sequencer at next breakpoint.
Definition ngcdcsSEQ.cpp:1340
int Disable()
Call-back at transition to not operational state.
Definition ngcdcsSEQ.cpp:399
void NewStatus(int newStatus)
Set new soft status.
Definition ngcdcsSEQ.cpp:748
int SimSeqTiming()
Simulate sequence timing.
Definition ngcdcsSEQ.cpp:3140
int ClkState(int idx, int flag)
Enable/disable clock.
Definition ngcdcsSeqClk.cpp:1369
int BreakTimeout(int force=0)
Compute timeout for break command.
Definition ngcdcsSEQ.cpp:3127
int SimPrg(ngcdcsSEQ_EMU *emulator, ngcdcs_ticks_t start, int length)
Program Simulator.
Definition ngcdcsSeqPrg.cpp:4339
char * StatusString()
Get status string.
Definition ngcdcsSEQ.cpp:799
virtual int PrgFile(const char *fileName)
Sequencer program loader.
Definition ngcdcsSeqPrg.cpp:530
int RestorePatSetup()
Restore patterns from private copy.
Definition ngcdcsSeqPat.cpp:1073
int InitPatLow()
Get actual initial pattern (low)
Definition ngcdcsSeqPat.cpp:780
ngcdcsSEQ(const ngcb_route_t &r)
Constructor with route.
Definition ngcdcsSEQ.cpp:28
int CheckPrg(const ngcdcs_seqp_t &prg)
Check and cleanup program.
Definition ngcdcsSeqPrg.cpp:93
int Wait(int event, int timeout, int interval=100)
Poll with timeout until status register matches event.
Definition ngcdcsSEQ.cpp:1498
ngcdcs_slxcfg_t slx
SELEX configuration.
Definition ngcdcsSEQ.hpp:630
int Monitor(int num, int clkChan)
Set channel for clock-monitor.
Definition ngcdcsSEQ.cpp:1893
int DwellTime(int factor, int add)
Set global dwell-time factor+add.
Definition ngcdcsSeqPat.cpp:916
int SyncExt(int flag)
Enable/disable external SYNC pulse.
Definition ngcdcsSEQ.cpp:687
int CvtExt(int flag)
Enable/disable external convert.
Definition ngcdcsSEQ.cpp:626
int GetState(int *low, int *high, int patNum, int stateNum)
Get pattern state.
Definition ngcdcsSeqPat.cpp:1366
int FirstPat(int *low, int *high)
Get first executed clock state.
Definition ngcdcsSeqPat.cpp:602
int SlxEnable()
Enable SELEX serial interface.
Definition ngcdcsSeqSlx.cpp:163
int SetupPat(int stopFlag=1)
Upload all defined patterns.
Definition ngcdcsSeqPat.cpp:978
void DumpCode(char *reply, const ngcdcs_seqp_t &prg, int offset, int length)
Dump piece of prg-code.
Definition ngcdcsSeqPrg.cpp:4033
int SetPat(int idx, ngcdcs_pat_t &pat)
Set a clock pattern.
Definition ngcdcsSeqPat.cpp:1107
int ClearPrgFile()
Clear program file.
Definition ngcdcsSeqPrg.cpp:250
int PatTime(const ngcdcs_pat_t &pat, int apply=1)
Compute pattern time.
Definition ngcdcsSeqPat.cpp:790
int RunCtrl(int flag)
Enable/disable external run-control.
Definition ngcdcsSEQ.cpp:565
int PatNumStates(const ngcdcs_pat_t &pat)
Compute number of states.
Definition ngcdcsSeqPat.cpp:837
int SetPdu(int value, int chan=0)
Set payload data units per channel.
Definition ngcdcsSeqPrg.cpp:4470
int SlxSetup(const char *key, const int *idx, const char *value, int *status=NULL)
SELEX setup.
Definition ngcdcsSeqSlx.cpp:201
int TriggerMode(int mode)
Select trigger mode.
Definition ngcdcsSEQ.cpp:502
int ResolveSubRt(ngcdcs_seqp_t *prg)
Resolve subroutines.
Definition ngcdcsSeqPrg.cpp:3910
int autoInit
Automatic clock pattern initialization.
Definition ngcdcsSEQ.hpp:606
int clkMon2
Clock on monitor 2.
Definition ngcdcsSEQ.hpp:612
int GetPat(ngcdcs_pat_t *pat)
Get a clock pattern by address.
Definition ngcdcsSeqPat.cpp:1285
virtual int LookupCB(const char *name, char *value)
Parameter lookup.
Definition ngcdcsSeqPrg.cpp:681
int Align()
Align sequencer control flags.
Definition ngcdcsSEQ.cpp:1213
int CleanLoop(ngcdcs_seqp_t *prg)
Remove zero loops etc. in sequencer program.
Definition ngcdcsSeqOptimize.cpp:196
int Status(int *hwStat)
Get status value.
Definition ngcdcsSEQ.cpp:804
int RunningState()
Check if sequencer is in running state.
Definition ngcdcsSEQ.hpp:884
int MinPulse(double *min, int clkNum)
Compute minimum pulse distance on clock.
Definition ngcdcsSEQ.cpp:2274
ngcdcs_seqp_t program
Sequencer program.
Definition ngcdcsSEQ.hpp:603
int SlxStatus(const char *key, const int *idx, char *value, int *status=NULL)
SELEX status.
Definition ngcdcsSeqSlx.cpp:522
int Trigger(int armed=1)
Send trigger command to sequencer.
Definition ngcdcsSEQ.cpp:1712
int LastPat(int *low, int *high)
Get last executed clock state.
Definition ngcdcsSeqPat.cpp:556
int Convert(int strobe, int flag)
Enable/disable convert strobe.
Definition ngcdcsSeqPat.cpp:953
unsigned int LostTrigger()
Definition ngcdcsSEQ.hpp:905
virtual ~ngcdcsSEQ()
Destructor.
Definition ngcdcsSEQ.cpp:58
int Stop(int align, int force=0)
Stop sequencer.
Definition ngcdcsSEQ.cpp:1056
int InitPatLast(int n)
Init with last state of pattern.
Definition ngcdcsSeqPat.cpp:685
int GetFramCfg(int *pduValue, int *packetsValue, int *bpix, int chan)
Definition ngcdcsSeqPrg.cpp:4610
int TimeAdd(int add)
Set global dwell-time add.
Definition ngcdcsSeqPat.cpp:885
int InitPatHigh()
Get actual initial pattern (high)
Definition ngcdcsSeqPat.cpp:785
int ExecTime(double *execTime)
Compute program execution time.
Definition ngcdcsSEQ.cpp:1960
int SlxDisable()
Disable SELEX serial interface.
Definition ngcdcsSeqSlx.cpp:182
void DumpPat(char *reply, const ngcdcs_pat_t &pat)
Dump pattern to string.
Definition ngcdcsSeqPat.cpp:1590
unsigned int NumTrigger()
Return number of trigger commands since last start.
Definition ngcdcsSEQ.hpp:893
int CheckPatRam()
Verify sequencer pattern RAM consistency.
Definition ngcdcsSeqPat.cpp:1616
int pdu[4]
Payload data units.
Definition ngcdcsSEQ.hpp:621
int Selftest()
Selftest.
Definition ngcdcsSeqSelftest.cpp:27
ngcb_evt_t Event(int stat)
Return event configuration for status switch.
Definition ngcdcsSEQ.cpp:912
int InitPat(int low, int high)
Set default initial pattern.
Definition ngcdcsSeqPat.cpp:722
int TriggerOn(int flag)
Enable/disable trigger mode.
Definition ngcdcsSEQ.cpp:433
ngcdcs_pat_ld_t()
Constructor.
Definition ngcdcsSEQ.hpp:123
virtual ~ngcdcs_pat_ld_t()
Destructor.
Definition ngcdcsSEQ.hpp:126
Definition ngcdcsSEQ.hpp:83
ngcdcs_pat_st_t * state
States array pointer.
Definition ngcdcsSEQ.hpp:89
int numStates
Number of states in this pattern.
Definition ngcdcsSEQ.hpp:92
int addr
Address (relative to RAM base)
Definition ngcdcsSEQ.hpp:86
ngcdcs_pat_t()
Constructor.
Definition ngcdcsSEQ.hpp:101
char name[128]
Pattern name.
Definition ngcdcsSEQ.hpp:98
int time
Clock pattern execution time in ticks.
Definition ngcdcsSEQ.hpp:95
virtual ~ngcdcs_pat_t()
Destructor.
Definition ngcdcsSEQ.hpp:110
#define ngcbDFE_STAT_SEQ
Definition ngcbAddr.h:87
#define ngcbDFE_ADDR_STAT
Definition ngcbAddr.h:35
#define ngcbSEQ_RAM_SIZE
Definition ngcbAddr.h:278
#define ngcbSEQ_PATRAM_SIZE
Definition ngcbAddr.h:283
#define str2str(s1, s2, n)
Definition ngcb.h:74
#define USE(x)
Definition ngcb.h:29
#define ngcdcsSEQ_STAT_RUNNING
Definition ngcdcsSEQ.hpp:43
#define ngcdcsSEQ_STAT_IDLE
Definition ngcdcsSEQ.hpp:41
#define ngcdcsSEQ_STAT_WAITING
Definition ngcdcsSEQ.hpp:42
#define ngcdcsSEQ_STAT_PAUSED
Definition ngcdcsSEQ.hpp:44
#define ngcdcsSEQ_STAT_FAILURE
Definition ngcdcsSEQ.hpp:45
#define ngcdcsSEQ_CTRL_ALIGN
Definition ngcdcsSEQ.hpp:57
#define ngcdcsSEQ_TRIGGERMODE_DIRECT
Definition ngcdcsSEQ.hpp:50
#define ngcdcsSEQ_MAX_STATES
Definition ngcdcsSEQ.hpp:36
Definition ngcbIFC.hpp:520
int addr
Address.
Definition ngcbIFC.hpp:525
int board
Board number (1, ...)
Definition ngcbIFC.hpp:522
int mask
32-bit mask
Definition ngcbIFC.hpp:528
int reference
32-bit reference value
Definition ngcbIFC.hpp:531
int cond
Condition: 0 = match any, 1 = match all (default)
Definition ngcbIFC.hpp:534
Definition ngcbIFC.hpp:78
Definition ngcdcsSEQ.hpp:146
ngcdcs_key_assign_t()
Constructor.
Definition ngcdcsSEQ.hpp:151
char value[256]
Definition ngcdcsSEQ.hpp:148
char name[64]
Definition ngcdcsSEQ.hpp:147
Definition ngcdcsSEQ.hpp:135
int idx
Definition ngcdcsSEQ.hpp:136
ngcdcs_pat_assign_t()
Constructor.
Definition ngcdcsSEQ.hpp:140
char name[64]
Definition ngcdcsSEQ.hpp:137
Definition ngcdcsSEQ.hpp:62
unsigned int high
Pattern state high.
Definition ngcdcsSEQ.hpp:67
int time
Pattern state dwell-time (in ticks)
Definition ngcdcsSEQ.hpp:70
int mod
Allow global dewll time modification.
Definition ngcdcsSEQ.hpp:73
ngcdcs_pat_st_t()
Constructor.
Definition ngcdcsSEQ.hpp:76
unsigned int low
Pattern state low.
Definition ngcdcsSEQ.hpp:64
Definition ngcdcsSEQ_PRG.hpp:118
Definition ngcdcsSLX.hpp:85
Definition ngcdcsSLX.hpp:137
Definition ngcdcsSEQ_PRG.hpp:22
Definition ngcdcsSEQ.hpp:157
int sx_flag
Definition ngcdcsSEQ.hpp:165
int ny_flag
Definition ngcdcsSEQ.hpp:168
int nx_flag
Definition ngcdcsSEQ.hpp:167
int dx
Definition ngcdcsSEQ.hpp:162
int rot
Definition ngcdcsSEQ.hpp:164
int nx
Definition ngcdcsSEQ.hpp:160
int dy
Definition ngcdcsSEQ.hpp:163
ngcdcs_win_t()
Constructor.
Definition ngcdcsSEQ.hpp:172
int sy
Definition ngcdcsSEQ.hpp:159
int sy_flag
Definition ngcdcsSEQ.hpp:166
int ny
Definition ngcdcsSEQ.hpp:161
int rot_flag
Definition ngcdcsSEQ.hpp:169
int sx
Definition ngcdcsSEQ.hpp:158