2 #include "qt32b_fms_2015_a.hh"
3 #include "fms_fm006_2015_a.hh"
6 #include "registerHack.hh"
8 void fms_fm006_2015_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 BS1E =(bs[0]>BSThr1) | (bs[1]>BSThr1);
54 int BS1F =(bs[2]>BSThr1);
57 int JpEF = (bs[0] + bs[2])>>BitSelect;
58 if(JpEF>0xFF) JpEF =0xFF;
63 | BS1E << 2 | BS1F << 3
68 printf(
"%s input E=%08x F=%08x\n",fm006.name,E,F);
69 printf(
"%s out=%08x BS3=%1d BS2=%1d BS1E/F=%1d %1d sum=%4d %4d %4d JpEF=%3d\n",
70 fm006.name,fm006.output[t],BS3,BS2,BS1E,bs[0],bs[1],bs[2],BS1F,JpEF);
74 int getFM006_BS3(
int out) {
return getbits(out, 0, 1);}
75 int getFM006_BS2(
int out) {
return getbits(out, 1, 1);}
76 int getFM006_BS1E(
int out) {
return getbits(out, 2, 1);}
77 int getFM006_BS1F(
int out) {
return getbits(out, 3, 1);}
78 int getFM006_JpEF(
int out) {
return getbits(out,16, 8);}