2 #include "qt32b_fms_2015_a.hh"
3 #include "fms_fm006_2017_a.hh"
6 #include "registerHack.hh"
8 void fms_fm006_2017_a(
Board& fm006,
int t,
int simdat){
10 int BSThr1 = fm006.registers[0];
11 int BSThr2 = fm006.registers[1];
12 int BSThr3 = fm006.registers[2];
13 int BitSelect= fm006.registers[3];
22 if(simdat==0) {in=(
int*)fm006.channels[t];}
23 else {in=(
int*)fm006.dsmdata[t];}
28 int E01 = getQT01Sum(E);
29 int E23 = getQT23Sum(E);
30 int F01 = getQT01Sum(F);
31 int F23 = getQT23Sum(F);
39 fm006.userdata[t][0]=bs[0];
40 fm006.userdata[t][1]=bs[1];
41 fm006.userdata[t][2]=bs[2];
45 fm006.userdata[t][7]=0;
46 fm006.userdata[t][8]=0;
47 fm006.userdata[t][9]=0;
48 for(
int i=0; i<MAX; i++){
49 if(bs[i]>BSThr3) {BS3=1; fm006.userdata[t][7]+=(1<<i); }
50 if(bs[i]>BSThr2) {BS2=1; fm006.userdata[t][8]+=(1<<i); }
51 if(bs[i]>BSThr1) { fm006.userdata[t][9]+=(1<<i); }
53 int BS1EF =(bs[0]>BSThr1) | (bs[1]>BSThr1) | (bs[2]>BSThr1);
56 int JpEF = (bs[0] + bs[2])>>BitSelect;
57 if(JpEF>0xFF) JpEF =0xFF;
67 printf(
"%s input E=%08x F=%08x\n",fm006.name,E,F);
68 printf(
"%s out=%08x BS3=%1d BS2=%1d BS1EF=%1d sum=%4d %4d %4d JpEF=%3d\n",
69 fm006.name,fm006.output[t],BS3,BS2,BS1EF,bs[0],bs[1],bs[2],JpEF);
73 int getFM006_2017a_BS3(
int out) {
return getbits(out, 0, 1);}
74 int getFM006_2017a_BS2(
int out) {
return getbits(out, 1, 1);}
75 int getFM006_2017a_BS1EF(
int out) {
return getbits(out, 2, 1);}
76 int getFM006_2017a_JpEF(
int out) {
return getbits(out,16, 8);}