% ********************************************************************************
% file      : CoDbg.m
% usuage    : Matlab, RTL co-debug scripts
% author    : duweitao@cuc.edu.cn
% date      : 2007 Mar 5th
% memo      : run this after HBF2LModel_tb()
% ********************************************************************************

len = 512;
K1 = 16;
K2 = 8;

r2A = [7:-1:4];
r2B = [3:-1:0];
n = 512;


y1n0        = tb.simData.dataFxp.dbg.HBFLv1.outLv1Part0;
y1n0Fxp     = fi(y1n0,1,16,15);
h_y1n0Fxp   = hex(y1n0Fxp);

y2n0        = tb.simData.dataFxp.dbg.HBFLv2.outLv2Part0;
y2n0Fxp     = fi(y2n0,1,16,15);
h_y2n0Fxp   = hex(y2n0Fxp); 

y2n1        = tb.simData.dataFxp.dbg.HBFLv2.outLv2Part1;
y2n1Fxp     = fi(y2n1,1,16,15);
h_y2n1Fxp   = hex(y2n1Fxp); 

y2n2        = tb.simData.dataFxp.dbg.HBFLv2.outLv2Part2;
y2n2Fxp     = fi(y2n2,1,16,15);
h_y2n2Fxp   = hex(y2n2Fxp); 

y2n3        = tb.simData.dataFxp.dbg.HBFLv2.outLv2Part3;
y2n3Fxp     = fi(y2n3,1,16,15);
h_y2n3Fxp   = hex(y2n3Fxp); 

inFxp   = tb.simData.dataFxp.dbg.HBFLv1.inputDataFxp;
inFxp   = inFxp.';
h_inFxp = hex(inFxp);

g2Fxp   = tb.simData.dataFxp.dbg.HBFLv2.coeff2CdsFxp;

g2A = g2Fxp(2*r2A-K2+1  + 1);
g2B = g2Fxp(2*r2B +1);

y1A = y1n0Fxp(n+r2A-3/2*K2+1  );
