2 #include "fms_fm101_2015_a.hh"
3 #include "fms_fm001_2015_a.hh"
8 void fms_fm101_2015_a(
Board& fm101,
int t,
int simdat){
9 const int BSThr1=fm101.registers[0];
10 const int BSThr2=fm101.registers[1];
11 const int BSThr3=fm101.registers[2];
20 if(simdat==0) {in=(
int*)fm101.channels[t];}
21 else {in=(
int*)fm101.dsmdata[t];}
28 int DD=getFM001_D23(T) + getFM001_D23(B);
31 int BS3 = getFM001_BS3(T) | getFM001_BS3(B) | (DD>BSThr3);
32 int BS2 = getFM001_BS2(T) | getFM001_BS2(B) | (DD>BSThr2);
33 int BS1DD=(DD>BSThr1);
36 int BS1T=getFM001_BS1A(T);
37 int BS1M=getFM001_BS1BCD(T) | getFM001_BS1BCD(B) | BS1DD;
38 int BS1B=getFM001_BS1A(B);
41 int JpT=getFM001_JpAB(T)+getFM001_JpCD(T);
42 int JpM=getFM001_JpCD(T)+getFM001_JpCD(B);
43 int JpB=getFM001_JpAB(B)+getFM001_JpCD(B);
44 if(JpT>0xff) JpT=0xff;
45 if(JpM>0xff) JpM=0xff;
46 if(JpB>0xff) JpB=0xff;
48 fm101.output[t] = BS3 | BS2 << 1
49 | BS1T << 2 | BS1M << 3 | BS1B <<4
50 | JpT << 5 | JpM << 16 | JpB <<24;
53 printf(
"%s input T=%08x B=%08x\n",fm101.name,T,B);
54 printf(
"%s out=%08x BS3=%1d BS2=%1d BS1T/M/B=%1d %1d %1d JpT/M/B %3d %3d %3d\n",
55 fm101.name,fm101.output[t],
56 BS3,BS2,BS1T,BS1M,BS1B,JpT,JpM,JpB);
60 int getFM101_2015a_BS3(
int out) {
return getbits(out, 0, 1);}
61 int getFM101_2015a_BS2(
int out) {
return getbits(out, 1, 1);}
62 int getFM101_2015a_BS1T(
int out) {
return getbits(out, 2, 1);}
63 int getFM101_2015a_BS1M(
int out) {
return getbits(out, 3, 1);}
64 int getFM101_2015a_BS1B(
int out) {
return getbits(out, 4, 1);}
65 int getFM101_2015a_JpT(
int out) {
return getbits(out, 5, 8);}
66 int getFM101_2015a_JpM(
int out) {
return getbits(out,16, 8);}
67 int getFM101_2015a_JpB(
int out) {
return getbits(out,24, 8);}