|
@@ -11,12 +11,14 @@ module DspPipeline
|
|
|
parameter WindNormCoefWidth = 32,
|
|
parameter WindNormCoefWidth = 32,
|
|
|
parameter WindCorrCoefWidth = 32,
|
|
parameter WindCorrCoefWidth = 32,
|
|
|
parameter IntermediateWidth = 14,
|
|
parameter IntermediateWidth = 14,
|
|
|
- parameter FracWidth = 51
|
|
|
|
|
|
|
+ // parameter FracWidth = 51
|
|
|
|
|
+ parameter FracWidth = 32
|
|
|
)
|
|
)
|
|
|
(
|
|
(
|
|
|
input Clk_i,
|
|
input Clk_i,
|
|
|
input Rst_i,
|
|
input Rst_i,
|
|
|
input Val_i,
|
|
input Val_i,
|
|
|
|
|
+ input MeasWindEnd_i,
|
|
|
input StartFpConv_i,
|
|
input StartFpConv_i,
|
|
|
|
|
|
|
|
input [WindCorrCoefWidth-1:0] FilterCorrCoef_i,
|
|
input [WindCorrCoefWidth-1:0] FilterCorrCoef_i,
|
|
@@ -35,7 +37,7 @@ module DspPipeline
|
|
|
//================================================================================
|
|
//================================================================================
|
|
|
// LOCALPARAMS
|
|
// LOCALPARAMS
|
|
|
localparam NormResultWidth = AccWidth+WindNormCoefWidth;
|
|
localparam NormResultWidth = AccWidth+WindNormCoefWidth;
|
|
|
- localparam AdcWindWidth = 37;
|
|
|
|
|
|
|
+ localparam AdcWindWidth = 18;
|
|
|
//================================================================================
|
|
//================================================================================
|
|
|
// REG/WIRE
|
|
// REG/WIRE
|
|
|
wire [AdcWindWidth-1:0] adcWindResult;
|
|
wire [AdcWindWidth-1:0] adcWindResult;
|
|
@@ -47,7 +49,9 @@ module DspPipeline
|
|
|
wire adcWindCosResultVal;
|
|
wire adcWindCosResultVal;
|
|
|
|
|
|
|
|
wire [AccWidth-1:0] AccResultI;
|
|
wire [AccWidth-1:0] AccResultI;
|
|
|
|
|
+ wire resultIVal;
|
|
|
wire [AccWidth-1:0] AccResultQ;
|
|
wire [AccWidth-1:0] AccResultQ;
|
|
|
|
|
+ wire resultQVal;
|
|
|
|
|
|
|
|
wire [ResultWidth-1:0] NormResultI;
|
|
wire [ResultWidth-1:0] NormResultI;
|
|
|
wire NormResultIVal;
|
|
wire NormResultIVal;
|
|
@@ -92,7 +96,7 @@ AdcWindMult
|
|
|
(
|
|
(
|
|
|
.Rst_i (Rst_i),
|
|
.Rst_i (Rst_i),
|
|
|
.Clk_i (Clk_i),
|
|
.Clk_i (Clk_i),
|
|
|
- .Val_i (valRegReg),
|
|
|
|
|
|
|
+ .Val_i (Val_i),
|
|
|
.FactorA_i (AdcData_i),
|
|
.FactorA_i (AdcData_i),
|
|
|
.FactorB_i (Wind_i),
|
|
.FactorB_i (Wind_i),
|
|
|
.Result_o (adcWindResult),
|
|
.Result_o (adcWindResult),
|
|
@@ -143,10 +147,12 @@ SummAccQ
|
|
|
(
|
|
(
|
|
|
.Clk_i (Clk_i),
|
|
.Clk_i (Clk_i),
|
|
|
.Rst_i (Rst_i),
|
|
.Rst_i (Rst_i),
|
|
|
|
|
+ .AccZeroing_i (MeasWindEnd_i),
|
|
|
.Val_i (adcWindSinResultVal),
|
|
.Val_i (adcWindSinResultVal),
|
|
|
|
|
|
|
|
.Data_i (adcWindSinResult[53:0]),
|
|
.Data_i (adcWindSinResult[53:0]),
|
|
|
- .Result_o (AccResultQ)
|
|
|
|
|
|
|
+ .Result_o (AccResultQ),
|
|
|
|
|
+ .ResultVal_o (resultQVal)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
SumAcc
|
|
SumAcc
|
|
@@ -158,10 +164,12 @@ SummAccI
|
|
|
(
|
|
(
|
|
|
.Clk_i (Clk_i),
|
|
.Clk_i (Clk_i),
|
|
|
.Rst_i (Rst_i),
|
|
.Rst_i (Rst_i),
|
|
|
|
|
+ .AccZeroing_i (MeasWindEnd_i),
|
|
|
.Val_i (adcWindCosResultVal),
|
|
.Val_i (adcWindCosResultVal),
|
|
|
|
|
|
|
|
.Data_i (adcWindCosResult[53:0]),
|
|
.Data_i (adcWindCosResult[53:0]),
|
|
|
- .Result_o (AccResultI)
|
|
|
|
|
|
|
+ .Result_o (AccResultI),
|
|
|
|
|
+ .ResultVal_o (resultIVal)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
//===============================InToFpConv=======================================
|
|
//===============================InToFpConv=======================================
|
|
@@ -178,7 +186,7 @@ QToFp32
|
|
|
.Rst_i (Rst_i),
|
|
.Rst_i (Rst_i),
|
|
|
.InData_i (AccResultQ),
|
|
.InData_i (AccResultQ),
|
|
|
.AverageNoizeLvl_i (AverageNoizeLvl_i),
|
|
.AverageNoizeLvl_i (AverageNoizeLvl_i),
|
|
|
- .InDataVal_i (StartFpConv_i),
|
|
|
|
|
|
|
+ .InDataVal_i (resultQVal),
|
|
|
.OutData_o (qFp32Result),
|
|
.OutData_o (qFp32Result),
|
|
|
.OutDataVal_o (qFp32ResultVal)
|
|
.OutDataVal_o (qFp32ResultVal)
|
|
|
);
|
|
);
|
|
@@ -196,7 +204,7 @@ IToFp32
|
|
|
.Rst_i (Rst_i),
|
|
.Rst_i (Rst_i),
|
|
|
.InData_i (AccResultI),
|
|
.InData_i (AccResultI),
|
|
|
.AverageNoizeLvl_i (AverageNoizeLvl_i),
|
|
.AverageNoizeLvl_i (AverageNoizeLvl_i),
|
|
|
- .InDataVal_i (StartFpConv_i),
|
|
|
|
|
|
|
+ .InDataVal_i (resultIVal),
|
|
|
.OutData_o (iFp32Result),
|
|
.OutData_o (iFp32Result),
|
|
|
.OutDataVal_o (iFp32ResultVal)
|
|
.OutDataVal_o (iFp32ResultVal)
|
|
|
);
|
|
);
|