2 #include "qt32b_fms_2015_a.hh"
3 #include "fms_fm005_2015_a.hh"
8 void fms_fm005_2015_a(
Board& fm005,
int t,
int simdat){
9 int BSThr1 = fm005.registers[0];
10 int BSThr2 = fm005.registers[1];
11 int BSThr3 = fm005.registers[2];
12 int BitSelect= fm005.registers[3];
21 if(simdat==0) {in=(
int*)fm005.channels[t];}
22 else {in=(
int*)fm005.dsmdata[t];}
29 int G01 = getQT01Sum(G);
30 int G23 = getQT23Sum(G);
31 int H01 = getQT01Sum(H);
32 int H23 = getQT23Sum(H);
33 int I01 = getQT01Sum(I);
34 int I23 = getQT23Sum(I);
35 int J01 = getQT01Sum(J);
36 int J23 = getQT23Sum(J);
49 fm005.userdata[t][0]=bs[0];
50 fm005.userdata[t][1]=bs[1];
51 fm005.userdata[t][2]=bs[2];
52 fm005.userdata[t][3]=bs[3];
53 fm005.userdata[t][4]=bs[4];
54 fm005.userdata[t][5]=bs[5];
55 fm005.userdata[t][6]=bs[6];
59 fm005.userdata[t][7]=0;
60 fm005.userdata[t][8]=0;
61 fm005.userdata[t][9]=0;
62 for(
int i=0; i<MAX; i++){
63 if(bs[i]>BSThr3) {BS3=1; fm005.userdata[t][7]+=(1<<i); }
64 if(bs[i]>BSThr2) {BS2=1; fm005.userdata[t][8]+=(1<<i); }
65 if(bs[i]>BSThr1) { fm005.userdata[t][9]+=(1<<i); }
67 int BS1GHIJ= (bs[0]>BSThr1) | (bs[1]>BSThr1) | (bs[2]>BSThr1) | (bs[3]>BSThr1)
68 | (bs[4]>BSThr1) | (bs[5]>BSThr1) | (bs[6]>BSThr1);
71 int JpGH = (bs[0] + bs[2])>>BitSelect;
72 int JpIJ = (bs[4] + bs[6])>>BitSelect;
73 if(JpGH >0xFF) JpGH=0xFF;
74 if(JpIJ >0xFF) JpIJ=0xFF;
81 | JpGH << 16 | JpIJ << 24;
84 printf(
"%s input G=%08x H=%08x I=%08x J=%08x\n",fm005.name,G,H,I,J);
85 printf(
"%s out=%08x BS3=%1d BS2=%1d BS1GHIJ=%1d sum=%4d %4d %4d %4d %4d %4d %4d JpGH/IJ=%3d %3d\n",
86 fm005.name,fm005.output[t],BS3,BS2,BS1GHIJ,
87 bs[0],bs[1],bs[2],bs[3],bs[4],bs[5],bs[6],JpGH,JpIJ);
91 int getFM005_BS3(
int out) {
return getbits(out, 0, 1);}
92 int getFM005_BS2(
int out) {
return getbits(out, 1, 1);}
93 int getFM005_BS1GHIJ(
int out){
return getbits(out, 2, 1);}
94 int getFM005_J23(
int out) {
return getbits(out, 4,12);}
95 int getFM005_JpGH(
int out) {
return getbits(out,16, 8);}
96 int getFM005_JpIJ(
int out) {
return getbits(out,24, 8);}