8 #include "fms_fm101_2012_a.hh"
10 void fms_fm101_2012_a(
Board& fm101,
int t){
11 int* channels = (
int*)fm101.channels[t];
13 const int R0 = fm101.registers[0];
14 const int R1 = fm101.registers[1];
15 const int R2 = fm101.registers[2];
29 for (
int i = 0; i < 4; ++i) {
30 int fm001out = channels[i];
33 HT0 |= btest(fm001out,30);
34 HT1 |= btest(fm001out,31);
39 int SumD = getbits(fm001out,0 ,5);
40 int SumC = getbits(fm001out,5 ,5);
41 int SumBC = getbits(fm001out,10,5);
42 int SumB = getbits(fm001out,15,5);
43 int SumCD = getbits(fm001out,20,5);
44 int SumA = getbits(fm001out,25,5);
46 BS0 |= SumA > R0 || SumCD > R0 || SumB > R0 || SumBC > R0 || SumC > R0 || SumD > R0;
47 BS1 |= SumA > R1 || SumCD > R1 || SumB > R1 || SumBC > R1 || SumC > R1 || SumD > R1;
50 Sum[i] = SumA+SumB+SumC+SumD;
51 PairSum[i] = SumC+SumD;
63 int SumS = PairSum[0]+PairSum[1];
64 int SumN = PairSum[2]+PairSum[3];
66 if (SumST > 31) SumST = 31;
67 if (SumSB > 31) SumSB = 31;
68 if (SumNT > 31) SumNT = 31;
69 if (SumNB > 31) SumNB = 31;
71 if (SumS > 31) SumS = 31;
72 if (SumN > 31) SumN = 31;
78 fm101.output[t] |= SumST << 0;
79 fm101.output[t] |= SumS << 5;
80 fm101.output[t] |= SumSB << 10;
81 fm101.output[t] |= SumNT << 15;
82 fm101.output[t] |= SumN << 20;
83 fm101.output[t] |= SumNB << 25;
84 fm101.output[t] |= BS0 << 30;
85 fm101.output[t] |= BS1 << 31;
88 fm101.output[t] |= SumST << 0;
89 fm101.output[t] |= SumS << 5;
90 fm101.output[t] |= SumSB << 10;
91 fm101.output[t] |= SumNT << 15;
92 fm101.output[t] |= HT0 << 20;
93 fm101.output[t] |= HT1 << 21;
94 fm101.output[t] |= SumNB << 25;
95 fm101.output[t] |= BS0 << 30;
96 fm101.output[t] |= BS1 << 31;