2 #include "qt32b_fms_2015_a.hh"
3 #include "fms_fm001_2017_a.hh"
8 void fms_fm001_2017_a(
Board& fm001,
int t,
int simdat){
10 const int BSThr1 = fm001.registers[0];
11 const int BSThr2 = fm001.registers[1];
12 const int BSThr3 = fm001.registers[2];
13 const int BitSelect = fm001.registers[3];
22 if(simdat==0) {in=(
int*)fm001.channels[t];}
23 else {in=(
int*)fm001.dsmdata[t];}
30 int A01 = getQT01Sum(A);
31 int A23 = getQT23Sum(A);
32 int B01 = getQT01Sum(B);
33 int B23 = getQT23Sum(B);
34 int C01 = getQT01Sum(C);
35 int C23 = getQT23Sum(C);
36 int D01 = getQT01Sum(D);
37 int D23 = getQT23Sum(D);
48 fm001.userdata[t][0]=bs[0];
49 fm001.userdata[t][1]=bs[1];
50 fm001.userdata[t][2]=bs[2];
51 fm001.userdata[t][3]=bs[3];
52 fm001.userdata[t][4]=bs[4];
53 fm001.userdata[t][5]=bs[5];
57 fm001.userdata[t][7]=0;
58 fm001.userdata[t][8]=0;
59 fm001.userdata[t][9]=0;
60 for(
int i=0; i<MAX; i++){
61 if(bs[i]>BSThr3) {BS3=1; fm001.userdata[t][7]+=(1<<i); }
62 if(bs[i]>BSThr2) {BS2=1; fm001.userdata[t][8]+=(1<<i); }
63 if(bs[i]>BSThr1) { fm001.userdata[t][9]+=(1<<i); }
65 int BS1ABC=(bs[0]>BSThr1) | (bs[1]>BSThr1) | (bs[2]>BSThr1) | (bs[3]>BSThr1);
66 int BS1CD=(bs[4]>BSThr1) | (bs[5]>BSThr1);
69 int JpAB = (bs[0] + bs[1])>>BitSelect;
70 int JpCD = (bs[3] + bs[5])>>BitSelect;
71 if(JpAB>0xFF) JpAB=0xFF;
72 if(JpCD>0xFF) JpCD=0xFF;
77 | BS1CD << 2 | BS1ABC << 3
79 | JpAB << 16 | JpCD << 24;
83 printf(
"%s input A=%08x B=%08x C=%08x D=%08x\n",fm001.name,A,B,C,D);
84 printf(
"%s out=%08x BS3=%1d BS2=%1d BS1ABC/CD=%1d %1d sum=%4d %4d %4d %4d %4d %4d Jp=%3d %3d\n",
85 fm001.name,fm001.output[t],BS3,BS2,BS1ABC,BS1CD,
86 bs[0],bs[1],bs[2],bs[3],bs[4],bs[5],JpAB,JpCD);
90 int getFM001_2017a_BS3(
int out) {
return getbits(out, 0, 1);}
91 int getFM001_2017a_BS2(
int out) {
return getbits(out, 1, 1);}
92 int getFM001_2017a_BS1CD(
int out) {
return getbits(out, 2, 1);}
93 int getFM001_2017a_BS1ABC(
int out) {
return getbits(out, 3, 1);}
94 int getFM001_2017a_D23(
int out) {
return getbits(out, 4,12);}
95 int getFM001_2017a_JpAB(
int out) {
return getbits(out,16, 8);}
96 int getFM001_2017a_JpCD(
int out) {
return getbits(out,24, 8);}