|
|
@@ -16,7 +16,8 @@ real signal;
|
|
|
|
|
|
reg [31:0] tbCnt;
|
|
|
reg [31:0] pNumCnt;
|
|
|
-wire oscWind = (tbCnt>=4500&tbCnt<=5499)? 1'b1:1'b0;
|
|
|
+// wire oscWind = (tbCnt>=4500&tbCnt<=5499)? 1'b1:1'b0;
|
|
|
+wire oscWind = (tbCnt>=4500&tbCnt<=4999)? 1'b1:1'b0;
|
|
|
|
|
|
wire signed [13:0] ncoSin1;
|
|
|
wire signed [13:0] ncoCos1;
|
|
|
@@ -37,22 +38,25 @@ wire signed [13:0] adcDataMixedCut = adcDataMixed[27-:14];
|
|
|
wire signed [13:0] sinAdd = (ncoSin1>>>1)+(ncoSin2>>>1);
|
|
|
|
|
|
wire signed [17:0] wind;
|
|
|
+
|
|
|
+// wire signed [13:0] singlePulse = (tbCnt>=4505&tbCnt<=4510)? 14'h1fff:14'h0;
|
|
|
+wire signed [13:0] singlePulse = (tbCnt==4505)? 14'h1fff:14'h0;
|
|
|
//==========================================================================================
|
|
|
//clocks gen
|
|
|
always #10 Clk50 = ~Clk50;
|
|
|
|
|
|
//==========================================================================================
|
|
|
|
|
|
-parameter N = 5;
|
|
|
+parameter N = 4;
|
|
|
parameter M = 1;
|
|
|
|
|
|
initial begin
|
|
|
Clk50 = 1'b1;
|
|
|
Rst = 1'b1;
|
|
|
- decimFactor = 3'd2;
|
|
|
+ decimFactor = 3'd4;
|
|
|
#100;
|
|
|
Rst = 1'b0;
|
|
|
-end
|
|
|
+end
|
|
|
|
|
|
always @(posedge Clk50) begin
|
|
|
if (!Rst) begin
|
|
|
@@ -133,7 +137,7 @@ DecimFilterWrapper
|
|
|
.AdcDataWidth (14),
|
|
|
.N (N),
|
|
|
.M (M),
|
|
|
- .FilteredDataWidth (29),
|
|
|
+ .FilteredDataWidth (30),
|
|
|
.FirOutDataWidth (48),
|
|
|
.FirOutCutBit (42)
|
|
|
)
|
|
|
@@ -147,7 +151,8 @@ DecimFilter
|
|
|
.IfFtwL_i (24'h51eb85),
|
|
|
.IfFtwH_i (24'h23),
|
|
|
|
|
|
- .AdcData_i (sinAdd),
|
|
|
+ .AdcData_i (singlePulse),
|
|
|
+ // .AdcData_i (sinAdd),
|
|
|
// .AdcData_i (adcDataMixedCut),
|
|
|
|
|
|
.FilteredAdcDataI_o (resultI),
|
|
|
@@ -219,30 +224,31 @@ always @(posedge Clk50) begin
|
|
|
end else begin
|
|
|
if (oscWind) begin
|
|
|
// $display("AdcData is %d", sinAdd);
|
|
|
- $fwrite(inSignal,"%d\n", sinAdd);
|
|
|
+ // $fwrite(inSignal,"%d\n", sinAdd);
|
|
|
+ $fwrite(inSignal,"%d\n", singlePulse);
|
|
|
end
|
|
|
end
|
|
|
end
|
|
|
|
|
|
-// always @(posedge Clk50) begin
|
|
|
- // if (Rst) begin
|
|
|
- // filteredData = $fopen("C:/Users/Stepan/Desktop/4portCompact/S5443Current/S5443_M/S5443.srcs/sources_1/new/filteredData.txt","w");
|
|
|
- // end else begin
|
|
|
- // if (resultVal) begin
|
|
|
- // $fwrite(filteredData,"%d\n", resultI);
|
|
|
- // end
|
|
|
- // end
|
|
|
-// end
|
|
|
-
|
|
|
always @(posedge Clk50) begin
|
|
|
if (Rst) begin
|
|
|
filteredData = $fopen("C:/Users/Stepan/Desktop/4portCompact/S5443Current/S5443_M/S5443.srcs/sources_1/new/filteredData.txt","w");
|
|
|
end else begin
|
|
|
- if (windResultVal) begin
|
|
|
- $fwrite(filteredData,"%d\n", windResultCut);
|
|
|
+ if (resultVal) begin
|
|
|
+ $fwrite(filteredData,"%d\n", resultI);
|
|
|
end
|
|
|
end
|
|
|
-end
|
|
|
+end
|
|
|
+
|
|
|
+// always @(posedge Clk50) begin
|
|
|
+ // if (Rst) begin
|
|
|
+ // filteredData = $fopen("C:/Users/Stepan/Desktop/4portCompact/S5443Current/S5443_M/S5443.srcs/sources_1/new/filteredData.txt","w");
|
|
|
+ // end else begin
|
|
|
+ // if (windResultVal) begin
|
|
|
+ // $fwrite(filteredData,"%d\n", windResultCut);
|
|
|
+ // end
|
|
|
+ // end
|
|
|
+// end
|
|
|
|
|
|
endmodule
|
|
|
|