ソースを参照

Улучшение читаемости кода отдельных модулей, удаление неиспользуемого функционала.

ChStepan 1 年間 前
コミット
4a1e6b51ea
38 ファイル変更318 行追加152 行削除
  1. 3 24
      S5444_M/src/src/AdcDataRx/AdcDataInterface.v
  2. 2 0
      S5444_M/src/src/AdcDataRx/AdcSync.v
  3. 7 2
      S5444_M/src/src/DitherGen/DitherGenv2.v
  4. 4 0
      S5444_M/src/src/ExtDspInterface/DspInterface.v
  5. 8 3
      S5444_M/src/src/ExtDspInterface/DspPpiOut.v
  6. 8 1
      S5444_M/src/src/ExtDspInterface/SlaveSpi.v
  7. 13 2
      S5444_M/src/src/GainOverloadControl/GainControl.v
  8. 13 1
      S5444_M/src/src/GainOverloadControl/GainControlWrapper.v
  9. 15 0
      S5444_M/src/src/GainOverloadControl/OverloadDetect.v
  10. 0 12
      S5444_M/src/src/InitRst/InitRst.v
  11. 5 1
      S5444_M/src/src/InternalDsp/AdcCalibration.v
  12. 7 0
      S5444_M/src/src/InternalDsp/ComplPrng.v
  13. 9 7
      S5444_M/src/src/InternalDsp/CordicNco.v
  14. 7 0
      S5444_M/src/src/InternalDsp/CordicRotation.v
  15. 9 0
      S5444_M/src/src/InternalDsp/DspPipeline.v
  16. 7 13
      S5444_M/src/src/InternalDsp/InternalDsp.v
  17. 8 0
      S5444_M/src/src/InternalDsp/MeasCtrlModule.v
  18. 9 1
      S5444_M/src/src/InternalDsp/NcoRstGen.v
  19. 7 0
      S5444_M/src/src/InternalDsp/WinParameters.v
  20. 10 4
      S5444_M/src/src/InternalDsp/Win_calc.v
  21. 9 3
      S5444_M/src/src/Math/MultModule.v
  22. 7 2
      S5444_M/src/src/Math/MyIntToFp.v
  23. 13 0
      S5444_M/src/src/Math/SimpleMult.v
  24. 7 3
      S5444_M/src/src/Math/SumAcc.v
  25. 4 0
      S5444_M/src/src/MeasDataFifo/FifoController.v
  26. 3 0
      S5444_M/src/src/MeasDataFifo/MeasDataFifoWrapper.v
  27. 5 0
      S5444_M/src/src/PulseMeas/ActivePortSelector.v
  28. 9 2
      S5444_M/src/src/PulseMeas/MeasStartEventGen.v
  29. 7 3
      S5444_M/src/src/PulseMeas/Mux.v
  30. 3 3
      S5444_M/src/src/PulseMeas/PGenRstGenerator.v
  31. 9 0
      S5444_M/src/src/PulseMeas/PulseGen.v
  32. 9 0
      S5444_M/src/src/PulseMeas/PulseGenNew.v
  33. 8 3
      S5444_M/src/src/PulseMeas/SampleStrobeGenRstDemux.v
  34. 8 3
      S5444_M/src/src/PulseMeas/StartAfterGainSel.v
  35. 7 3
      S5444_M/src/src/PulseMeas/TrigInt2Mux.v
  36. 9 4
      S5444_M/src/src/RegMap/RegMap.v
  37. 17 17
      S5444_M/src/src/Sim/S5443TopPulseProfileTb.v
  38. 33 35
      S5444_M/src/src/Top/S5443Top.v

+ 3 - 24
S5444_M/src/src/AdcDataRx/AdcDataInterface.v

@@ -18,6 +18,7 @@
 // additional comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	AdcDataInterface	
 #(	
 	parameter	AdcDataWidth	=	14,
@@ -63,9 +64,11 @@ module	AdcDataInterface
 	output	[AdcDataWidth-1:0]	Adc2ChR2Data_o,
 	output	[AdcDataWidth-1:0]	Adc2ChT2Data_o
 );
+
 //================================================================================
 //  reg/wire
 //================================================================================	
+
 	wire    [ChNum-1:0]    	adc1P;
     wire    [ChNum-1:0]    	adc1N;
     wire    [ChNum-1:0]    	adc2P;
@@ -175,30 +178,6 @@ AdcSync Adc2Sync
 	.Data_o	({adc2ChR2DataSync, adc2ChT2DataSync})
 );
 
-// AdcSyncFifo	adc1SyncFifo	(
-	// .rst		(Rst_i),
-	// .wr_clk		(Adc1RxClk),	
-	// .rd_clk		(Clk_i),
-	// .din		(adc1Dout),
-	// .din		({testAdc,testAdc}),
-	// .wr_en		(1'b1),
-	// .rd_en		(1'b1),
-	// .dout		({adc1ChT1DataSync, adc1ChR1DataSync}),
-	// .full		(),
-	// .empty		()
-// );
-
-// AdcSyncFifo	adc2SyncFifo	(
-	// .rst		(Rst_i),
-	// .wr_clk		(Adc2RxClk),	
-	// .rd_clk		(Clk_i),
-	// .din		(adc2Dout),
-	// .wr_en		(1'b1),
-	// .rd_en		(1'b1),
-	// .dout		({adc2ChR2DataSync, adc2ChT2DataSync}),
-	// .full		(),
-	// .empty		()
-// );
 endmodule
 
 

+ 2 - 0
S5444_M/src/src/AdcDataRx/AdcSync.v

@@ -21,7 +21,9 @@ module AdcSync
 //================================================================================
 //  ASSIGNMENTS
 //================================================================================
+
 	assign	Data_o	=	adcDataSyncPipe[2];
+	
 //================================================================================
 //  CODING
 //================================================================================

+ 7 - 2
S5444_M/src/src/DitherGen/DitherGenv2.v

@@ -3,9 +3,9 @@
 // Company: 
 // Engineer:		Churbanov S.
 // 
-// Create Date:    10:00:14 13/08/2019 
+// Create Date:   
 // Design Name: 
-// Module Name:    DspPpiOut 
+// Module Name:     
 // Project Name: 
 // Target Devices: 
 // Tool versions: 
@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module DitherGenv2
 #(	
 	parameter	CmdDataRegWith		=	24,
@@ -32,6 +33,7 @@ module DitherGenv2
 	output	DitherCtrlT2R2_o,
 	output	DitherCtrlT1R1_o
 );
+
 //================================================================================
 //  REG/WIRE
 //================================================================================
@@ -74,11 +76,14 @@ module DitherGenv2
 
 	wire	dithGenT2R2	=	((ncoSignalT2R2>>ditherAmpT2R2)>sawCnt)	?	1'b1:1'b0;
 	wire	dithGenT1R1	=	((ncoSignalT1R1>>ditherAmpT1R1)>sawCnt)	?	1'b1:1'b0;
+
 //================================================================================
 //  ASSIGNMENTS
 //================================================================================	
+
 	assign	DitherCtrlT2R2_o	=	(ditherEnT2R2)	?	dithGenT2R2:1'b0;
 	assign	DitherCtrlT1R1_o	=	(ditherEnT1R1)	?	dithGenT1R1:1'b0;
+	
 //================================================================================
 //  CODING
 //================================================================================	

+ 4 - 0
S5444_M/src/src/ExtDspInterface/DspInterface.v

@@ -18,6 +18,7 @@
 // additional comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	DspInterface
 #(	
 	parameter	AdcDataWidth	=	14,	
@@ -87,9 +88,11 @@ module	DspInterface
 
 	input	LpOutStart_i
 );
+
 //================================================================================
 //	REG/WIRE
 //================================================================================
+
 	wire	[ResultWidth*(ChNum*2)-1:0]	measDataBus;
 	wire	[ResultWidth*(ChNum*2)-1:0]	fftDataBus;
 	wire	[ResultWidth*(ChNum*2)-1:0]	bypassDataBus;
@@ -116,6 +119,7 @@ module	DspInterface
 	wire	signed	[15:0]	filteredDecimDataI;
 	wire	signed	[15:0]	filteredDecimDataQ;
 	wire	filteredDecimDataVal;
+	
 //================================================================================
 //	ASSIGNMENTS
 //================================================================================

+ 8 - 3
S5444_M/src/src/ExtDspInterface/DspPpiOut.v

@@ -19,6 +19,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module DspPpiOut
 #(	
 	parameter	ODataWidth		=	16,	
@@ -41,9 +42,11 @@ module DspPpiOut
 	output	LpOutFs_o,
 	output	[ODataWidth-1:0]	LpOutData_o
 );
+
 //================================================================================
 //  REG/WIRE
 //================================================================================
+
 	reg	lpDataRst;
 	reg	[5:0]	txCnt	=	6'd0;	
 	reg	[DataBusWidth-1:0]	lpDataBuf;
@@ -63,15 +66,19 @@ module DspPpiOut
 	wire	[31:0]	serviceData	=	{ampEnR2,ampEnT2,ampEnR1,ampEnT1};
 	
 	wire	outDataVal	=	(txCnt	<=	18	&&	txCnt	!=	0);
+
 //================================================================================
 //  ASSIGNMENTS
 //================================================================================	
+
 	assign	LpOutData_o	=	lpDataBuf[ODataWidth-1:0];
 	assign	LpOutFs_o	=	lpOutFs;
 	assign	PpiBusy_o	=	ppiBusy;
+
 //================================================================================
 //  CODING
 //================================================================================	
+
 always	@(posedge	Clk_i)	begin
 	if	(!Rst_i)	begin
 		if	(LpOutStart_i)	begin
@@ -138,9 +145,7 @@ always	@(posedge	Clk_i)	begin
 		lpDataBuf	<=	{DataBusWidth{1'b0}};
 	end
 end
-//================================================================================
-//  INSTANTIATIONS
-//================================================================================		
+
 ODDR2
 #(
 	.DDR_ALIGNMENT("NONE"),

+ 8 - 1
S5444_M/src/src/ExtDspInterface/SlaveSpi.v

@@ -5,7 +5,7 @@
 // 
 // Create Date: 17.09.2020 14:18:14
 // Design Name: 
-// Module Name: SlaveSpi
+// Module Name: 
 // Project Name: 
 // Target Devices: 
 // Tool Versions: 
@@ -56,9 +56,11 @@ module	SlaveSpi
 	input	Miso_i,
 	output	Miso_o
 );
+
 //================================================================================
 //	REG/WIRE
 //================================================================================
+
 	reg	[CmdRegWidth-1:0]		dataCaptReg;
 	reg	[DataCntWidth-1:0]		dataCnt;
 	reg	[HeaderWidth-1:0]		ansAddr;
@@ -66,18 +68,22 @@ module	SlaveSpi
 	wire	directTransit	=	(ansAddr	==	Adc0DirAccessAddr)|(ansAddr	==	Adc1DirAccessAddr);
 	reg	txWind;
 	reg	[4:0]	txCnt;
+
 //================================================================================
 //	ASSIGNMENTS
 //================================================================================
+
 	assign	Mosi_o		=	(!spiMode&directTransit)?	Mosi_i:1'b1;
 	assign	Sck_o		=	(directTransit)?	Sck_i:1'b0;
 	assign	Ss0_o		=	(directTransit&&(ansAddr==Adc0DirAccessAddr))?	Ss_i:1'b1;
 	assign	Ss1_o		=	(directTransit&&(ansAddr==Adc1DirAccessAddr))?	Ss_i:1'b1;
 	assign	AnsAddr_o	=	ansAddr;
 	assign	Miso_o		=	txWind?	AnsReg_i[txCnt]:1'b0;
+
 //================================================================================
 //	CODING
 //================================================================================
+
 always	@(posedge	Sck_i)	begin
 	if	(~Ss_i)	begin
 		dataCaptReg	<=	{dataCaptReg[CmdRegWidth-2:0],Mosi_i};
@@ -129,6 +135,7 @@ end
 //================================================================================
 //	Generating output signals
 //================================================================================
+
 reg	ssReg;
 reg	ssRegR;
 

+ 13 - 2
S5444_M/src/src/GainOverloadControl/GainControl.v

@@ -4,9 +4,9 @@
 // Company: 
 // Engineer: 		Churbanov S.
 // 
-// Create Date:    15:24:31 08/20/2019 
+// Create Date:    
 // Design Name: 
-// Module Name:    gain_master 
+// Module Name:    
 // Project Name: 
 // Target Devices: 
 // Tool versions: 
@@ -19,6 +19,7 @@
 // Additional Comments: 16.09.2019 file modified in assotiate with task.
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module GainControl
 #(	
 	parameter	AdcNcoMultWidth	=	35,
@@ -45,12 +46,17 @@ module GainControl
 
 //================================================================================
 //  LOCALPARAMS
+//================================================================================
+
 	localparam	CntWidth		=	32;
 	localparam	Delay			=	100;
 	localparam	AverageDelay	=	MeasPeriod+Delay-1;
 	localparam	SumWidth		=	AdcNcoMultWidth+6-1;
+
 //================================================================================
 //  REG/WIRE
+//================================================================================
+
 	reg		[CntWidth-1:0]	measCnt;
 	
 	reg		signed	[SumWidth-1:0]	adcSinSum;			
@@ -78,13 +84,18 @@ module GainControl
 	wire	[(ThresholdWidth*2)-9:0]	highThresholdCompl	=	{10'b0,GainHighThreshold_i,6'b0};
 	
 	wire	accWind	=	(measCnt>0	&	measCnt	<=MeasPeriod-2);
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	GainNewState_o	=	gainNewState;
 	assign	SensEn_o		=	sensEn;
 	assign	MeasStart_o		=	GainAutoEn_i?	measEnd:StartMeas_i;
+
 //================================================================================
 //  CODING
+//================================================================================
 
 always	@(posedge	Clk_i)	begin
 	if	(!Rst_i)	begin

+ 13 - 1
S5444_M/src/src/GainOverloadControl/GainControlWrapper.v

@@ -6,7 +6,7 @@
 // 
 // Create Date:    15:24:31 08/20/2019 
 // Design Name: 
-// Module Name:    gain_master 
+// Module Name:     
 // Project Name: 
 // Target Devices: 
 // Tool versions: 
@@ -19,6 +19,7 @@
 // Additional Comments: 16.09.2019 file modified in assotiate with task.
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module GainControlWrapper
 #(	
 	parameter	AdcDataWidth		=	14,
@@ -49,20 +50,30 @@ module GainControlWrapper
 
 //================================================================================
 //  LOCALPARAM
+//================================================================================
+
 	localparam	MultDataWidth	=	36;
 	
 //================================================================================
+//  REG/WIRE
+//================================================================================
+
 	wire	[MultDataWidth-1:0]	adcSin;
 	wire	[MultDataWidth-1:0]	adcCos;
 
 	wire	[MultDataWidth-1:0]	adcSinCut	=	adcSin	[MultDataWidth-1:0];
 	wire	[MultDataWidth-1:0]	adcCosCut	=	adcCos	[MultDataWidth-1:0];
 	wire	gainNewState;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	AmpEnNewState_o	=	(GainAutoEn_i)?	gainNewState:GainManualState_i;
+
 //================================================================================
 //  CODING
+//================================================================================
 
 MultModule		
 #(	
@@ -102,4 +113,5 @@ GainMaster
 	.SensEn_o				(SensEn_o),
 	.MeasStart_o			(MeasStart_o)
 ); 
+
 endmodule

+ 15 - 0
S5444_M/src/src/GainOverloadControl/OverloadDetect.v

@@ -34,6 +34,8 @@ module OverloadDetect
 
 //================================================================================
 //  LOG2 FUNCTION
+//================================================================================
+
 	function integer Log2;
 	input integer value;
 		begin
@@ -48,23 +50,35 @@ module OverloadDetect
 			end	
 		end
 	endfunction
+
 //================================================================================
 //  LOCALPARAMS
+//================================================================================
+
 	localparam CntWidth	=	Log2(MeasPeriod);
 	localparam SumWidth	=	AdcDataWidth+CntWidth;
+
 //================================================================================
 //  REG/WIRE
+//================================================================================
+
 	reg		overloadReg;
 	reg		[CntWidth-1:0]	measCnt;		
 	
 	reg		[SumWidth-1:0]	adcSum;	
 	
 	wire	[AdcDataWidth-1:0]	absAdc	=	(AdcData_i[AdcDataWidth-1])?	(~AdcData_i + 1):AdcData_i;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	Overload_o	=	overloadReg;
+
 //================================================================================
 //  CODING
+//================================================================================
+
 always	@(posedge	Clk_i)	begin
 	if	(!Rst_i)	begin
 		if	(measCnt	!= MeasPeriod-1)	begin
@@ -98,4 +112,5 @@ always	@(posedge	Clk_i)	begin
 		end
 	end
 end
+
 endmodule

+ 0 - 12
S5444_M/src/src/InitRst/InitRst.v

@@ -4,9 +4,7 @@ module InitRst (
 );
 
 //================================================================================
-//
 //  FUNCTIONS
-//
 //================================================================================
 
     function integer bit_num;
@@ -21,36 +19,28 @@ module InitRst (
     endfunction
 
 //================================================================================
-//
 //  PARAMETER/LOCALPARAM
-//
 //================================================================================
 
     parameter   DELAY_VALUE     = 20;
     localparam  DELAY_CNT_W     = bit_num(DELAY_VALUE);
 
 //================================================================================
-//
 //  PORTS
-//
 //================================================================================
 
     input           clk_i;
     output  reg     signal_o;
 
 //================================================================================
-//
 //  STATE MACHINE STATES
-//
 //================================================================================
 
     localparam      SM_RST_S    = 1'b0;
     localparam      SM_DONE_S   = 1'b1;
 
 //================================================================================
-//
 //  REG/WIRE
-//
 //================================================================================
 
     reg                         curr_state  = SM_RST_S;
@@ -62,9 +52,7 @@ module InitRst (
     reg                         signal_next;
 
 //================================================================================
-//
 //  CODING
-//
 //================================================================================
 
 initial begin

+ 5 - 1
S5444_M/src/src/InternalDsp/AdcCalibration.v

@@ -6,7 +6,7 @@
 // 
 // Create Date:    14:12:30 06/03/2020 
 // Design Name: 
-// Module Name:    WinParameters 
+// Module Name:     
 // Project Name: 
 // Target Devices: 
 // Tool versions: 
@@ -39,6 +39,7 @@ module AdcCalibration
 //================================================================================
 //  Func
 //================================================================================
+
 	function integer Log2;
 	input integer value;
 		begin
@@ -56,6 +57,7 @@ module AdcCalibration
 //================================================================================
 //  REG/WIRE
 //================================================================================
+
 	reg signed	[AccWidth:0]	adcAcc;
 	reg signed	[AdcDataWidth-1:0]	calValue;
 	reg signed	[AdcDataWidth-1:0]	calValueR;
@@ -69,8 +71,10 @@ module AdcCalibration
 //================================================================================
 //  ASSIGNMENTS
 //================================================================================	
+
 	assign	CalDone_o	=	calDone;
 	assign	CalibratedAdcData_o	=	calibratedData;
+	
 //================================================================================
 //  CODING
 //================================================================================	

+ 7 - 0
S5444_M/src/src/InternalDsp/ComplPrng.v

@@ -15,6 +15,7 @@
 // Dependencies: None
 // 
 //////////////////////////////////////////////////////////////////////////////////
+
 module ComplPrng
 #(
 	parameter DataPrngWidth = 4,
@@ -29,9 +30,11 @@ module ComplPrng
 	// output signed	[OutDataWidth-1:0] DataAndPrng_o
 	output signed	[OutDataWidth-1:0] PrngData_o
 );
+
 //================================================================================
 //	REG/WIRE
 //================================================================================
+
 reg [31:0] s1;
 reg [31:0] s2;
 reg [31:0] s3;
@@ -44,18 +47,22 @@ wire	signed	[DataPrngWidth-1:0]	dataPrngCut;
 reg		signed	[OutDataWidth-1:0]	dataPrngCutExtended;
 
 reg	signed	[OutDataWidth-1:0]	dataAndPrngReg;
+
 //================================================================================
 //	ASSIGNMENTS
 //================================================================================
+
 // assign	adcDataExtended		=	{Data_i[InDataWidth-1], Data_i[InDataWidth-1], Data_i, 4'b0};
 assign	dataPrngCut			=	dataPrng[31-:DataPrngWidth];
 // assign	dataPrngCutExtended	=	{{OutDataWidth-DataPrngWidth{dataPrngCut[DataPrngWidth-1]}}, dataPrngCut};
 // assign	DataAndPrng_o		=	adcDataExtended+dataPrngCutExtended;
 // assign	DataAndPrng_o		=	dataAndPrngReg;
 assign	PrngData_o			=	dataPrngCutExtended;
+
 //================================================================================
 //	CODING
 //================================================================================
+
 always @(posedge Clk_i) begin
 	if (Rst_i) begin
 		s1 <= 32'd12345;

+ 9 - 7
S5444_M/src/src/InternalDsp/CordicNco.v

@@ -26,6 +26,7 @@ module CordicNco
 //================================================================================
 //  FUNCTIONS
 //================================================================================
+
     function integer log2;
         input integer value;
         begin
@@ -36,14 +37,17 @@ module CordicNco
             end
         end
     endfunction
+
 //================================================================================
 //  LOCALPARAMS
 //================================================================================
+
 	localparam  [PhIncWidth-1:0]	angle270	= 3<<(PhIncWidth-2);
 	localparam  [PhIncWidth-1:0]	angle180	= 1<<(PhIncWidth-1);
 	localparam  [PhIncWidth-1:0]	angle90		= 1<<(PhIncWidth-2);
 	
 	localparam [17:0] initValue = 18'd78498;
+
 //================================================================================
 //  REG/WIRE DECLARATIONS
 //================================================================================
@@ -68,9 +72,11 @@ module CordicNco
     integer	i;
 	
 	reg		valR;
+
 //================================================================================
 //  ASSIGNMENTS
 //================================================================================
+
     assign	xPipe[0]	=	(Val_i)	?	initValue:xPipe[0];
     assign	yPipe[0]	=	(Val_i)	?	initValue:yPipe[0];
     assign	valPipe[0]	=	valSr[2];
@@ -98,9 +104,11 @@ module CordicNco
 
 	assign	Sin_o	=	WindVal_i	?	sin_o	:	14'h0;
 	assign	Cos_o	=	WindVal_i	?	cos_o	:	14'h0;
+
 //================================================================================
 //  CODING
 //================================================================================
+
 always @(posedge Clk_i) begin
     if (Rst_i) begin
         valR	<=	1'b0;
@@ -109,7 +117,6 @@ always @(posedge Clk_i) begin
 	end
 end
 
-//  Phase handle logic
 always @(posedge Clk_i) begin
     if (Rst_i) begin
         phaseAcc   <= {PhIncWidth{1'b0}};
@@ -141,9 +148,6 @@ always @(posedge Clk_i) begin
     end
 end
 
-//--------------------------------------------------------------------------------
-//  CORDIC pipe
-
 always @(posedge Clk_i) begin
     if (Rst_i) begin
         valSr <= 3'b0;
@@ -186,9 +190,6 @@ generate
     end
 endgenerate
 
-//--------------------------------------------------------------------------------
-//  Output logic
-
 generate 
     if (EnSinN) begin
         always @(posedge Clk_i) begin
@@ -243,4 +244,5 @@ always @(posedge Clk_i) begin
 		Val_o		<= valPipe[0];
     end	
 end
+
 endmodule

+ 7 - 0
S5444_M/src/src/InternalDsp/CordicRotation.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module cordic_rotation 
 #(	parameter   ODatWidth	= 16,
 	parameter   Shift		= 1)
@@ -33,19 +34,25 @@ module cordic_rotation
 	output	reg	signed	[ODatWidth-1:0]	Y_o,
 	output	reg	Val_o
 );
+
 //================================================================================
 //  REG/WIRE DECLARATIONS
 //================================================================================
+
     wire    [ODatWidth-1:0]    shiftedInX;
     wire    [ODatWidth-1:0]    shiftedInY;
+
 //================================================================================
 //  ASSIGNMENTS
 //================================================================================
+
     assign  shiftedInX    =   X_i >>> Shift;
     assign  shiftedInY    =   Y_i >>> Shift;
+
 //================================================================================
 //  CODING
 //================================================================================
+
 always @(posedge Clk_i) begin
     if (Rst_i) begin
         Val_o	<= 1'b0;

+ 9 - 0
S5444_M/src/src/InternalDsp/DspPipeline.v

@@ -36,10 +36,15 @@ module DspPipeline
 
 //================================================================================
 //  LOCALPARAMS
+//================================================================================
+
 	localparam	NormResultWidth	=	AccWidth+WindNormCoefWidth;
 	localparam	AdcWindWidth	=	18;
+
 //================================================================================
 //  REG/WIRE 
+//================================================================================
+
 	wire	[AdcWindWidth-1:0]	adcWindResult;
 	wire	adcWindResultVal;
 	
@@ -68,12 +73,16 @@ module DspPipeline
 	
 	reg		valReg;
 	reg		valRegReg;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	CorrResultVal_o	=	CorrResultReVal&CorrResultImVal;
 	
 //================================================================================
 //  CODING
+//================================================================================
 
 	always	@(posedge	Clk_i)	begin
 		if	(!Rst_i)	begin

+ 7 - 13
S5444_M/src/src/InternalDsp/InternalDsp.v

@@ -19,6 +19,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module InternalDsp	
 #(	
 	parameter	AdcDataWidth		=	14,	
@@ -90,6 +91,8 @@ module InternalDsp
 
 //================================================================================
 //  REG/WIRE
+//================================================================================
+
 	wire	[WindNormCoefWidth-1:0]	windNormCoef;
 	wire	[WindPNumWidth-1:0]		windPointsNum;
 	wire	[WindPNumWidth-1:0]		averageNoizeLvl;
@@ -141,6 +144,7 @@ module InternalDsp
 	
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
 
 	assign	adcDataBus	[ChNum-1]	=	{{2{Adc2ChT2Data_i[AdcDataWidth-1]}},Adc2ChT2Data_i,4'b0};
 	assign	adcDataBus	[ChNum-2]	=	{{2{Adc2ChR2Data_i[AdcDataWidth-1]}},Adc2ChR2Data_i,4'b0};
@@ -178,7 +182,8 @@ module InternalDsp
 	assign	CalModeDone_o	=	&calDone;
 	
 //================================================================================
-//  INSTANTIATIONS
+//  CODING
+//================================================================================
 
 //----------------------------------------------
 //Module generates event signals for measurement
@@ -274,18 +279,6 @@ Win_calc	WinCalcInst
 	.win_o			(wind)
 );
 
-// Approximation3 WindCalc2
-// (
-    // .Clk_i			(Clk_i), 
-    // .Rst_i			(Rst_i),
-    // .Clk100_i		(WindCalcClk_i),
-    // .WinCtrl_i		(winCtrl),
-    // .Win_value_i	(windArg),
-    // .filterCmd_i	(measCtrlReg[15-:8]), 
-	// .Win_o			(wind)
-// );
-
-
 //----------------------------------------------
 //Module generates Sin and Cos for measurement
 
@@ -330,6 +323,7 @@ always @(posedge Clk_i) begin
 		prngDataBus	[i]<=prngDataBus[i-1];
 	end
 end
+
 //------------------------------------------------
 //Generating needed amount of calculating channels
 generate

+ 8 - 0
S5444_M/src/src/InternalDsp/MeasCtrlModule.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module MeasCtrlModule
 #(	
 	parameter	WindPNumWidth	=	48,
@@ -55,6 +56,8 @@ module MeasCtrlModule
 
 //================================================================================
 //  REG/WIRE
+//================================================================================
+
 	reg	startFpConv;
 
 	reg	[1:0]	startFpConvPipe	[3:0];
@@ -107,8 +110,11 @@ module MeasCtrlModule
 	reg		sampleStrobeGenRst;
 	
 	wire	measWindOr	=	(measWind|measWindR);
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	StartFpConv_o			=	startFpConvPipe	[2];
 	// assign	MeasWind_o				=	measWind;
 	assign	MeasWind_o				=	measWindOr;
@@ -120,8 +126,10 @@ module MeasCtrlModule
 	assign	TukeyCtrl_o				=	tukeyCtrl;
 	assign	WinCtrl_o				=	(pNumCnt<=tukeyFirstCosValuesDiv2+1|pNumCnt>tukeySecondCosValuesDiv2);
 	assign	SampleStrobeGenRst_o	=	sampleStrobeGenRst;
+
 //================================================================================
 //  CODING
+//================================================================================
 	
 	always	@(posedge	Clk_i)	begin
 		if	(!Rst_i)	begin

+ 9 - 1
S5444_M/src/src/InternalDsp/NcoRstGen.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module NcoRstGen	
 (
 	input	Clk_i,
@@ -28,9 +29,11 @@ module NcoRstGen
 	output	NcoRst_o,
 	output	StartMeasEvent_o
 );
+
 //================================================================================
 //  REG/WIRE
 //================================================================================
+
 	reg	[15:0]	startMeasEventReg;
 	reg	[31:0]	ncoPhIncReg;
 	reg	[31:0]	ncoPhIncRegR;
@@ -41,17 +44,22 @@ module NcoRstGen
 	reg	[1:0]	currState;
 	
 	reg	rst;
+
 //================================================================================
 //  PARAMETERS
 //================================================================================
+
 	parameter	[1:0]	IDLE	=	2'd0;
 	parameter	[1:0]	RST		=	2'd1;
 	parameter	[1:0]	DEL		=	2'd2;
+
 //================================================================================
 //  ASSIGNMENTS
-// ================================================================================	
+// ===============================================================================
+
 	assign	NcoRst_o	=	rst;
 	assign	StartMeasEvent_o	=	(currState	==	IDLE)?	StartMeasEvent_i:startMeasEventReg[15];
+	
 //================================================================================
 //  CODING
 //================================================================================	

+ 7 - 0
S5444_M/src/src/InternalDsp/WinParameters.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module WinParameters 
 #(	
 	parameter	WindPhIncWidth		=	48,
@@ -35,24 +36,30 @@ module WinParameters
 	output		[WindPNumWidth-1:0]		WinPointsNum_o,
 	output		[WindPNumWidth-1:0]		AverageNoiseLvl_o
 );
+
 //================================================================================
 //  REG/WIRE
 //================================================================================
+
 	reg [WindPhIncWidth-1:0]	windPhInc;
 	reg	[WindNormCoefWidth-1:0]	winNormCoef;
 	reg	[WindPNumWidth-1:0]		winPointsNum;
 	reg	[WindPNumWidth-1:0]		averageNoiseLvl;
+
 //================================================================================
 //  ASSIGNMENTS
 //================================================================================	
+
 	assign	WinPhInc_o 			=	windPhInc;
 	assign	WinPhIncStart_o		 =	32'h80000000;
 	assign	WinNormCoef_o		=	winNormCoef;
 	assign	WinPointsNum_o		=	winPointsNum;
 	assign	AverageNoiseLvl_o	=	averageNoiseLvl;
+
 //================================================================================
 //  CODING
 //================================================================================	
+
 always	@	(posedge	Clk_i)	begin
 	if	(!Rst_i)	begin
 		case (FilterCmd_i)			

+ 10 - 4
S5444_M/src/src/InternalDsp/Win_calc.v

@@ -6,8 +6,8 @@
 // 
 // Create Date:		15:22:20 12/08/2019 
 // Design Name: 
-// Module Name:		Win_parameters
-// Project Name:	Compact_main
+// Module Name:		
+// Project Name:	
 // Target Devices: 
 // Tool versions: 
 // Description: 	
@@ -19,6 +19,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module Win_calc	(
 	input			clk_i,
 	input	[7:0]	filterCmd_i,
@@ -35,6 +36,7 @@ module Win_calc	(
 //================================================================================
 //  PARAMETERS
 //================================================================================
+
 	localparam	signed	A3_1	=	18'h15584;
 // ????????? ??? ?????????? SIN
 	localparam signed	[17:0]	A1	=	18'h12400;			// a-1
@@ -51,9 +53,11 @@ module Win_calc	(
 	localparam	b5Width				=	CalcWidth*5;
 	
 	localparam [31:0]	testArg	=	32'h12492492;
+
 //================================================================================
 //  REG/WIRE
 //================================================================================
+
 	reg			signed	[17:0]	sinWind;
 	reg			signed	[17:0]	tukeyWind;	
 		
@@ -105,14 +109,16 @@ module Win_calc	(
 	wire	signed	[CalcWidthR-1:0]	approxSin	=	a5b5Cut+a4b4Cut+a3b3Cut+a2b2Cut+a1bCut+bPrevSh;	
 	
 	wire	signed	[CalcWidthR-1:0]	resultSin	=	approxSin[17]?	18'h1ffff:approxSin;
+
 //================================================================================
 //  ASSIGNMENTS
-// ================================================================================	
+// ===============================================================================
 	
 	assign	windMux1	=	(sinFilterFlag)	?	sinWindPow2[34-:18]:tukeyWindOut;
 	assign	windMux2	=	(rectFilterFlag)?	18'h1ffff:windMux1;
 
 	assign	win_o		=	windMux2;
+
 // ================================================================================
 //  CODING
 //================================================================================	
@@ -176,7 +182,6 @@ always	@(*)	begin
 	end
 end
 
-
 always	@(*)	begin
 	if	(!reset_i)	begin
 		if	(!win_type_i)	begin 
@@ -192,4 +197,5 @@ always	@(*)	begin
 		tukeyWind	=	18'h0;
 	end
 end
+
 endmodule

+ 9 - 3
S5444_M/src/src/Math/MultModule.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	MultModule	
 #(	
 	parameter	AdcDataWidth	=	14,
@@ -34,23 +35,28 @@ module	MultModule
 	output	signed	[MultDataWidth-1:0]	AdcCos_o
 );
 
-//================================================================================
-//  LOCALPARAM
-
 //================================================================================
 //  REG/WIRE
+//================================================================================
+
 	reg	signed	[IfNcoOutWidth-1:0]	adcDataCompl;
 	reg	signed	[IfNcoOutWidth-1:0]	sinReg;
 	reg	signed	[IfNcoOutWidth-1:0]	cosReg;
 	
 	reg	signed	[MultDataWidth-1:0]	AdcSinReg;
 	reg	signed	[MultDataWidth-1:0]	AdcCosReg;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	AdcSin_o	=	AdcSinReg;
 	assign	AdcCos_o	=	AdcCosReg;
+
 //================================================================================
 //  CODING
+//================================================================================
+
 	always	@(posedge	Clk_i)	begin
 		if	(!Rst_i)	begin
 			adcDataCompl	<=	{AdcData_i,4'b0};

+ 7 - 2
S5444_M/src/src/Math/MyIntToFp.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	MyIntToFp	
 #(	
 	parameter	InWidth		=	32,
@@ -40,7 +41,9 @@ module	MyIntToFp
 	output	reg	OutDataVal_o;
 	
 //================================================================================
-//  Func
+//  FUNC
+//================================================================================
+
 	function integer Log2;
 	input integer value;
 		begin
@@ -59,7 +62,9 @@ module	MyIntToFp
 	localparam Stages = Log2(InWidth);
 	
 //================================================================================
-//  Coding
+//  CODING
+//================================================================================
+
 	reg		[InWidth-1:0]	inDataR;
 	reg		signR;
 	reg		outValR;

+ 13 - 0
S5444_M/src/src/Math/SimpleMult.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	SimpleMult	
 #(	
 	parameter	FactorAWidth	=	14,
@@ -38,17 +39,28 @@ module	SimpleMult
 
 //================================================================================
 //  LOCALPARAM
+//================================================================================
+
 	localparam	ResultWidth	=	FactorAWidth+FactorBWidth;
+
 //================================================================================
 //  REG/WIRE
+//================================================================================
+
 	reg	[ResultWidth-1:0]	resultReg;
 	reg	resultValReg;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	Result_o	=	(ResultWidth==OutputWidth)?	resultReg:resultReg[ResultWidth-2-:OutputWidth];
 	assign	ResultVal_o	=	resultValReg;
+
 //================================================================================
 //  CODING
+//================================================================================
+
 	always	@(posedge	Clk_i)	begin
 		if	(!Rst_i)	begin
 			if	(Val_i)	begin
@@ -63,4 +75,5 @@ module	SimpleMult
 			resultValReg	<=	1'b0;
 		end
 	end
+	
 endmodule

+ 7 - 3
S5444_M/src/src/Math/SumAcc.v

@@ -14,11 +14,10 @@ module SumAcc
 	output	ResultVal_o
 );
 
-//================================================================================
-//  LOCALPARAMS
-
 //================================================================================
 //  REG/WIRE
+//================================================================================
+
 	reg		[ODataWidth-1:0]	dataAcc;
 	reg		resultVal;
 	wire	[ODataWidth-1:0]	extData	=	{{(ODataWidth - IDataWidth){Data_i[IDataWidth-1]}}, Data_i};	//sign extension
@@ -26,12 +25,17 @@ module SumAcc
 	reg		accZeroing;
 	reg		accZeroingR;
 	reg		accZeroingRR;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	Result_o	=	dataAcc;
 	assign	ResultVal_o	=	resultVal;
+
 //================================================================================
 //  CODING
+//================================================================================
 
 	always	@(posedge	Clk_i)	begin
 		if	(Rst_i)	begin

+ 4 - 0
S5444_M/src/src/MeasDataFifo/FifoController.v

@@ -42,14 +42,18 @@ module FifoController
 	output	reg	WrEn_o,
 	output	RdEn_o
 );
+
 //================================================================================
 //  REG/WIRE
 //================================================================================
+
 	reg	rdEn;
 	reg	[13:0]	wrCnt;
+
 //================================================================================
 //  ASSIGNMENTS
 //================================================================================
+
 	assign	MeasDataVal_o	=	rdEn&(!PpiBusy_i);
 	assign	RdEn_o			=	rdEn&(!PpiBusy_i);
 	

+ 3 - 0
S5444_M/src/src/MeasDataFifo/MeasDataFifoWrapper.v

@@ -19,6 +19,7 @@ module MeasDataFifoWrapper
 	output	[DataWidth*(ChNum*2)-1:0]	MeasDataBus_o,
 	output	MeasDataVal_o
 );
+
 //================================================================================
 //  REG/WIRE
 //================================================================================
@@ -46,9 +47,11 @@ module MeasDataFifoWrapper
 //================================================================================
 //  ASSIGNMENTS
 //================================================================================
+
 	assign	rstOr	=	Rst_i|startMeasDspPos;
 	assign	MeasDataVal_o		=	rdEn;
 	assign	startMeasDspPos		=	(StartMeasDsp_i&(!startMeasDspReg));
+	
 //================================================================================
 //  CODING
 //================================================================================		

+ 5 - 0
S5444_M/src/src/PulseMeas/ActivePortSelector.v

@@ -19,6 +19,7 @@
 //
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	ActivePortSelector	
 #(	
 	parameter	PortsNum	=	4
@@ -35,6 +36,7 @@ module	ActivePortSelector
 //================================================================================
 //  LOCALPARAM
 //================================================================================
+
 	localparam	LutNum		=	2**PortsNum;
 	localparam	PortsNone	=	4'b0000;
 	localparam	Ports_1		=	4'b0001;
@@ -56,6 +58,7 @@ module	ActivePortSelector
 //================================================================================
 //	REG/WIRE
 //================================================================================
+
 	wire		[PortsNum-1:0]	Lut	[LutNum-1:0];
 
 //================================================================================
@@ -80,6 +83,8 @@ module	ActivePortSelector
 
 //================================================================================
 //  CODING
+//================================================================================
+
 always	@(*)	begin
 	if	(!Rst_i)	begin
 		case	(Ctrl_i)

+ 9 - 2
S5444_M/src/src/PulseMeas/MeasStartEventGen.v

@@ -26,6 +26,7 @@
 //
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	MeasStartEventGen	
 #(	
 	parameter	CmdRegWidth	=	32
@@ -42,22 +43,27 @@ module	MeasStartEventGen
 );	
 
 //================================================================================
-//  LOCALPARAM
-
+//  REG/WIRE
 //================================================================================
+
 	reg		startMeasEventVal;
 	reg		startMeasEvent;
 	reg		initTrig;
 	
 	reg		measTrigReg;
 	wire	measTrigPos;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	measTrigPos			=	(!measTrigReg&MeasTrig_i);
 	assign	StartMeasEvent_o	=	startMeasEvent;
 	assign	InitTrig_o			=	initTrig;
+
 //================================================================================
 //  CODING
+//================================================================================
 
 	always	@(posedge	Clk_i)	begin
 		if	(!Rst_i)	begin
@@ -112,6 +118,7 @@ module	MeasStartEventGen
 			initTrig	=	0;
 		end
 	end
+	
 endmodule
 
 

+ 7 - 3
S5444_M/src/src/PulseMeas/Mux.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	Mux	
 #(	
 	parameter	CmdRegWidth		=	24,
@@ -39,19 +40,22 @@ module	Mux
 	output	MuxOut_o
 );	
 
-//================================================================================
-//  LOCALPARAM
-
 //================================================================================
 //	REG/WIRE
+//================================================================================
+
 	reg		muxOut;
 	wire	[PGenNum+TrigPortsNum+5:0]	inputBus	=	{IntTrig2_i,1'b1,1'b0,DspStartCmd_i,DspTrigOut_i,IntTrig_i,ExtPortsBus_i,PulseBus_i};
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
 	assign	MuxOut_o	=	muxOut;
 
 //================================================================================
 //  CODING
+//================================================================================
+
 always	@(*)	begin
 	if	(!Rst_i)	begin
 		muxOut	=	inputBus[MuxCtrl_i];

+ 3 - 3
S5444_M/src/src/PulseMeas/PGenRstGenerator.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	PGenRstGenerator	
 #(	
 	parameter	PgenNum	=	7
@@ -35,6 +36,7 @@ module	PGenRstGenerator
 //================================================================================
 //  LOCALPARAM
 //================================================================================
+
 	localparam	IDLE	=	2'h0;
 	localparam	RST		=	2'h1;
 	localparam	DEL		=	2'h2;
@@ -42,14 +44,12 @@ module	PGenRstGenerator
 //================================================================================
 //  REG/WIRE
 //================================================================================
+
 	reg	[1:0]	currState;
 	
 	reg	[PgenNum-1:0]	pGenRstReg;
 	
 	wire	orPGenRstReg	=	|pGenRstReg;
-//================================================================================
-//  ASSIGNMENTS
-//================================================================================
 
 //================================================================================
 //  CODING

+ 9 - 0
S5444_M/src/src/PulseMeas/PulseGen.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	PulseGen	
 #(	
 	parameter	CmdRegWidth	=	32
@@ -42,6 +43,7 @@ module	PulseGen
 
 //================================================================================
 //  LOCALPARAM
+//================================================================================
 
 	localparam	IDLE	=	2'h0;
 	localparam	DELAY	=	2'h1;
@@ -55,6 +57,9 @@ module	PulseGen
 	localparam	CONTINIOUS	=	8'd5;
 	
 //================================================================================
+//  REG/WIRE
+//================================================================================
+
 	reg		pulse;
 	wire	[31:0]	delArray	[2:0];
 	wire	[31:0]	widthArray	[2:0];
@@ -83,8 +88,11 @@ module	PulseGen
 	
 	wire	enPulse		=	(EnEdge_i)?	enPulseNeg:enPulsePos;
 	wire	enPulseEn	=	(Mode_i	!=	0)?	enPulse:1'b0;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	delArray	[0]	=	P1Del_i;
 	assign	delArray	[1]	=	P2Del_i;
 	assign	delArray	[2]	=	P3Del_i;
@@ -97,6 +105,7 @@ module	PulseGen
 
 //================================================================================
 //  CODING
+//================================================================================
 
 always	@(posedge	Clk_i)	begin
 	if	(!Rst_i)	begin

+ 9 - 0
S5444_M/src/src/PulseMeas/PulseGenNew.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	PulseGenNew	
 #(	
 	parameter	CmdRegWidth	=	32
@@ -42,6 +43,7 @@ module	PulseGenNew
 
 //================================================================================
 //  LOCALPARAM
+//================================================================================
 
 	localparam	IDLE	=	2'h0;
 	localparam	DELAY	=	2'h1;
@@ -55,6 +57,9 @@ module	PulseGenNew
 	localparam	CONTINIOUS	=	8'd5;
 	
 //================================================================================
+//  REG/WIRE
+//================================================================================
+
 	reg		pulse;
 	wire	[31:0]	delArray	[2:0];
 	wire	[31:0]	widthArray	[2:0];
@@ -86,8 +91,11 @@ module	PulseGenNew
 	
 	wire	enPulse		=	(EnEdge_i)?	enPulseNeg:enPulsePos;
 	wire	enPulseEn	=	(Mode_i	!=	0)?	enPulse:1'b0;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	delArray	[0]	=	P1Del_i;
 	assign	delArray	[1]	=	P2Del_i;
 	assign	delArray	[2]	=	P3Del_i;
@@ -100,6 +108,7 @@ module	PulseGenNew
 
 //================================================================================
 //  CODING
+//================================================================================
 
 always	@(*)	begin
 	if	(!Rst_i)	begin

+ 8 - 3
S5444_M/src/src/PulseMeas/SampleStrobeGenRstDemux.v

@@ -18,6 +18,7 @@
 // Additional Comments: 
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module	SampleStrobeGenRstDemux	
 #(	
 	parameter	CmdRegWidth		=	24,
@@ -32,18 +33,21 @@ module	SampleStrobeGenRstDemux
 	output	[PGenNum-1:0]	RstDemuxOut_o
 );	
 
-//================================================================================
-//  LOCALPARAM
-
 //================================================================================
 //	REG/WIRE
+//================================================================================
+
 	reg	[PGenNum-1:0]	demuxOut;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	RstDemuxOut_o	=	demuxOut;
 
 //================================================================================
 //  CODING
+//================================================================================
 
 always	@(*)	begin
 	if	(!Rst_i)	begin
@@ -77,6 +81,7 @@ always	@(*)	begin
 		demuxOut	=	0;
 	end
 end
+
 endmodule
 
 

+ 8 - 3
S5444_M/src/src/PulseMeas/StartAfterGainSel.v

@@ -18,6 +18,7 @@
 // Additional Comments: 16.09.2019 file modified in assotiate with task.
 //
 //////////////////////////////////////////////////////////////////////////////////
+
 module StartAfterGainSel
 #(	
 	parameter	ChNum	=	4
@@ -30,17 +31,21 @@ module StartAfterGainSel
 	output	MeasStart_o
 );
 
-//================================================================================
-//  LOCALPARAMS
-
 //================================================================================
 //  REG/WIRE
+//================================================================================
+
 	reg	measStart;
+
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	MeasStart_o	=	measStart;
+
 //================================================================================
 //  CODING
+//================================================================================
 
 always	@(*)	begin
 	if	(!Rst_i)	begin

+ 7 - 3
S5444_M/src/src/PulseMeas/TrigInt2Mux.v

@@ -17,6 +17,7 @@
 // Revision 0.01 - File Created
 // Additional Comments: 
 //
+
 //////////////////////////////////////////////////////////////////////////////////
 module	TrigInt2Mux	
 #(	
@@ -31,19 +32,22 @@ module	TrigInt2Mux
 	output	MuxOut_o
 );	
 
-//================================================================================
-//  LOCALPARAM
-
 //================================================================================
 //	REG/WIRE
+//================================================================================
+
 	reg		muxOut;
 	
 //================================================================================
 //  ASSIGNMENTS
+//================================================================================
+
 	assign	MuxOut_o	=	muxOut;
 
 //================================================================================
 //  CODING
+//================================================================================
+
 always	@(*)	begin
 	if	(!Rst_i)	begin
 		muxOut	=	PulseBus_i[MuxCtrl_i];

+ 9 - 4
S5444_M/src/src/RegMap/RegMap.v

@@ -16,7 +16,7 @@
 // Revision:
 // Revision 0.01 - File Created
 // Additional Comments:
-// нужно доработать модуль для получения возможности обновления регистров как снаружи (внешний dsp) так и изнутри (информацией из других модулей в системе).
+// 
 //////////////////////////////////////////////////////////////////////////////////
 
 module	RegMap	
@@ -144,9 +144,11 @@ module	RegMap
 	output	[CmdDataRegWith-1:0]	MuxCtrl3Reg_o,
 	output	[CmdDataRegWith-1:0]	MuxCtrl4Reg_o
 );
+
 //================================================================================
 //	LOCALPARAMS
 //================================================================================
+
 	localparam	GainCtrlRegAddr			=	7'h0;
 	localparam	GainLowThreshT1RegAddr	=	7'h1;
 	localparam	GainHighThreshT1RegAddr	=	7'h2;
@@ -259,7 +261,7 @@ module	RegMap
 //================================================================================
 //	REG/WIRE
 //================================================================================
-	// common regs
+	
 	reg	[CmdDataRegWith-1:0]	gainCtrlReg;		//Use the same reg for store gain ctrl lines on both working modes 
 	reg	[CmdDataRegWith-1:0]	gainLowThreshT1Reg;
 	reg	[CmdDataRegWith-1:0]	gainHighThreshT1Reg;
@@ -368,9 +370,11 @@ module	RegMap
 
 	//ans reg
 	reg	[CmdDataRegWith-1:0]	ansReg;
+
 //================================================================================
 //	ASSIGNMENTS
 //================================================================================
+
 	assign	GainCtrlReg_o			=	gainCtrlReg;		
 	assign	GainLowThreshT1Reg_o	=	gainLowThreshT1Reg;
 	assign	GainHighThreshT1Reg_o	=	gainHighThreshT1Reg;		
@@ -479,9 +483,11 @@ module	RegMap
 	assign	MuxCtrl4Reg_o		=	muxCtrl4Reg;
 	
 	assign	AnsDataReg_o		=	ansReg;
+
 //================================================================================
 //	CODING
 //================================================================================
+
 	always	@(posedge	Clk_i)	begin
 		if	(!Rst_i)	begin
 			if	(Val_i)	begin
@@ -867,8 +873,7 @@ module	RegMap
 			pGMode1Reg			<=	{CmdDataRegWith{1'b0}};	
 		end
 	end
-	
-	
+
 	always	@(posedge	Clk_i)	begin
 		if	(!Rst_i)	begin
 			if	(Val_i)	begin

+ 17 - 17
S5444_M/src/src/Sim/S5443TopPulseProfileTb.v

@@ -290,28 +290,28 @@ S5443Top MasterFpga
     .Adc1FclkP_i		(),		
     .Adc1FclkN_i		(),		
 
-    .Adc1DataDa0P_i		(Adc1DataDa0P),
-	.Adc1DataDa0N_i		(~Adc1DataDa0P),		
-    .Adc1DataDa1P_i		(Adc1DataDa1P),
-    .Adc1DataDa1N_i		(~Adc1DataDa1P),
-
-	.Adc1DataDb0P_i		(Adc1DataDa0P),
-    .Adc1DataDb0N_i		(~Adc1DataDa0P),		
-    .Adc1DataDb1P_i		(Adc1DataDa1P),
-    .Adc1DataDb1N_i		(~Adc1DataDa1P),
+    .Adc1DataDa0P_i		(),
+	.Adc1DataDa0N_i		(),		
+    .Adc1DataDa1P_i		(),
+    .Adc1DataDa1N_i		(),
+
+	.Adc1DataDb0P_i		(),
+    .Adc1DataDb0N_i		(),		
+    .Adc1DataDb1P_i		(),
+    .Adc1DataDb1N_i		(),
 //------------------------------------------	
     .Adc2FclkP_i		(),		
     .Adc2FclkN_i		(),		
 
-    .Adc2DataDa0P_i		(1'b1),
-    .Adc2DataDa0N_i		(1'b0),		
-    .Adc2DataDa1P_i		(1'b1),
-    .Adc2DataDa1N_i		(1'b0),
+    .Adc2DataDa0P_i		(),
+    .Adc2DataDa0N_i		(),		
+    .Adc2DataDa1P_i		(),
+    .Adc2DataDa1N_i		(),
   
-	.Adc2DataDb0P_i		(1'b1),
-    .Adc2DataDb0N_i		(1'b0),		
-    .Adc2DataDb1P_i		(1'b1),
-    .Adc2DataDb1N_i		(1'b0),
+	.Adc2DataDb0P_i		(),
+    .Adc2DataDb0N_i		(),		
+    .Adc2DataDb1P_i		(),
+    .Adc2DataDb1N_i		(),
 //------------------------------------------
 	.AdcInitMosi_o		(),
 	.AdcInitClk_o		(),			

+ 33 - 35
S5444_M/src/src/Top/S5443Top.v

@@ -22,12 +22,9 @@
 //
 //Spi clock for ADC initialization is 15Mhz.
 //Spi clock for RegMap work is 41Mhz.
-//Нужно сделать процедуру сброса для импульсных измерений, такую же как для обычных, тоесть по детектированию спадающего фронта StartMeas.
-//Забрать из команды настройки измерения, биты управления ключем и замкнуть на выходы.
 //////////////////////////////////////////////////////////////////////////////////
 
-//  xc7s25-2csga225
-// new feature added
+
 
 module	S5443Top
 #(	
@@ -146,10 +143,11 @@ module	S5443Top
 	///test port for testbench
 	input	[AdcDataWidth-1:0]	AdcData_i
 );
+
 //================================================================================
 //  reg/wire
 //================================================================================	
-	//captured data
+
 	wire	[AdcDataWidth-1:0]	adc1ChT1Data;
 	wire	[AdcDataWidth-1:0]	adc1ChR1Data;
 	wire	[AdcDataWidth-1:0]	adc2ChR2Data;
@@ -401,6 +399,9 @@ module	S5443Top
 	reg		dspReadyForRxRegRR;
 	
 	wire	sampleStrobeGenRst;
+
+	integer m;
+
 //================================================================================
 //  assignments
 //================================================================================	
@@ -565,10 +566,10 @@ module	S5443Top
 	
 	assign	DspReadyForRxToFpgaS_o	=	dspReadyForRxRegR;
 	assign	StartMeasDsp_o	=	startMeasSyncR;
+
 //================================================================================
 //  CODING
 //================================================================================
-integer m;
 
 always	@(posedge	gclk)	begin	//stretching pulse
 	stopMeasR	<=	stopMeas;
@@ -1177,35 +1178,11 @@ PulseGenMux
 	.MuxOut_o		(pgMuxedOut[j])
 );	
 
-// PulseGen
-// #(	
-	// .CmdRegWidth	(CmdRegWidth)
-// )
-// PulseGenerator
-// (
-	// .Rst_i			(initRst|pGenRst[j]|pGenMeasRst[j]),
-	// .Rst_i			(initRst|pGenMeasRst[j]),
-	// .Clk_i			(gclk),
-	// .EnPulse_i		(pgMuxedOut[j]),
-	
-	// .PulsePol_i		(pgPulsePolArray[j]),
-	// .EnEdge_i		(pgEnEdgeArray[j]),
-	// .Mode_i			(pgModeArray[j]),
-	// .P1Del_i		(pgP1DelArray[j]),
-	// .P2Del_i		(pgP2DelArray[j]),
-	// .P3Del_i		(pgP3DelArray[j]),
-	// .P1Width_i		(pgP1WidthArray[j]),
-	// .P2Width_i		(pgP2WidthArray[j]),
-	// .P3Width_i		(pgP3WidthArray[j]),
-	
-	// .Pulse_o		(pulseBus[j])
-// );	
-
-PulseGenNew
+PulseGen
 #(	
 	.CmdRegWidth	(CmdRegWidth)
 )
-TestPgen
+PulseGenerator
 (
 	.Rst_i			(initRst|pGenRst[j]|pGenMeasRst[j]),
 	.Clk_i			(gclk),
@@ -1222,13 +1199,34 @@ TestPgen
 	.P3Width_i		(pgP3WidthArray[j]),
 	
 	.Pulse_o		(pulseBus[j])
-);
+);	
+
+// PulseGenNew
+// #(	
+// 	.CmdRegWidth	(CmdRegWidth)
+// )
+// TestPgen
+// (
+// 	.Rst_i			(initRst|pGenRst[j]|pGenMeasRst[j]),
+// 	.Clk_i			(gclk),
+// 	.EnPulse_i		(pgMuxedOut[j]),
+	
+// 	.PulsePol_i		(pgPulsePolArray[j]),
+// 	.EnEdge_i		(pgEnEdgeArray[j]),
+// 	.Mode_i			(pgModeArray[j]),
+// 	.P1Del_i		(pgP1DelArray[j]),
+// 	.P2Del_i		(pgP2DelArray[j]),
+// 	.P3Del_i		(pgP3DelArray[j]),
+// 	.P1Width_i		(pgP1WidthArray[j]),
+// 	.P2Width_i		(pgP2WidthArray[j]),
+// 	.P3Width_i		(pgP3WidthArray[j]),
+	
+// 	.Pulse_o		(pulseBus[j])
+// );
 
 end
 endgenerate
 
-
-
 //--------------------------------------------------------------------------------
 //	External ports mux 
 //--------------------------------------------------------------------------------