ZHCAB53B December   2020  – February 2024 DP83TG720R-Q1 , DP83TG720S-Q1

 

  1.   1
  2.   摘要
  3.   商标
  4. 引言
  5. 硬件配置
    1. 2.1 原理图
  6. 软件配置
  7. 测试 PMA
    1. 4.1 PMA 测试步骤
  8. 测试 IOP:链路建立和链路断开
    1. 5.1 IOP 测试步骤
  9. 测试 SQI
    1. 6.1 SQI 测试步骤
    2. 6.2 SQI 与链路质量的对应关系
  10. 测试 TDR
    1. 7.1 TDR 测试步骤
  11. 测试 EMC/EMI
  12. 10修订历史记录

SQI 测试步骤

GUID-189F9C03-7FC0-4EC6-B2BC-4AE8C1A28888-low.gif图 6-1 额外迟滞的 SQI 过程

额外迟滞的示例代码:

cyg_uint8 TI_DP83TG720::GetSQI() {
	static cyg_uint16 first_time = 1;
	static cyg_uint16 prevSQI = 0;
    cyg_uint16 regValue;
	cyg_uint16 reg_link;
	cyg_uint16 mse_lock;
	cyg_uint16 currSQI;
	cyg_uint16 result;
	static cyg_uint32 mse_iir = 0;
	cyg_uint16 mse_out;

    reg_link = ReadRegister(0x1F, 0x0180);
	regValue = ReadRegister(0x1F, 0x0875);
	mse_lock = (regValue & 0x3FF);

	if (first_time == 1) {
		mse_iir = mse_lock << 8;
	}
	else {
		mse_iir = mse_lock + mse_iir - ((mse_iir + 128) >> 8);
	}
	mse_out = (mse_iir + 128) >> 8;	

//comparison without hysterisis	
	
	if ((first_time == 1) && ((reg_link & 0x3007) == 0x3007)){
		if (mse_out >= 0x5E) {
			currSQI = 0x1; }
		else if (mse_out >= 0x4E) {
			currSQI = 0x2; }
		else if (mse_out >= 0x3E) {
			currSQI = 0x3; }
		else if (mse_out >= 0x2B) {
			currSQI = 0x4; }
		else if (mse_out >= 0x1E) {
			currSQI = 0x5; }
		else if (mse_out >= 0xD) {
			currSQI = 0x6; }
		else {
			currSQI = 0x7; }
		first_time = 0;
	}

//comparison with hysterisis

	else if ((first_time == 0) && ((reg_link & 0x3007) == 0x3007)){
		if (prevSQI == 0x1) {
			if (mse_out < 0x5E) 		//threshold1_down
					    {
				currSQI = 0x2; }
			else {
				currSQI = 0x1; } }
		else if (prevSQI == 0x2) {
			if (mse_out < 0x4E) 	        //threshold2_down
					     {
				currSQI = 0x3; }
			else if (mse_out > 0x67)        //threshold2_up  
					      {
				currSQI = 0x1; } 
			else {
				currSQI = 0x2; } }
		else if (prevSQI == 0x3) {
			if (mse_out < 0x3E) 		//threshold3_down
					     {
				currSQI = 0x4; }
			else if (mse_out > 0x56)        //threshold3_up
					     {
				currSQI = 0x2; }
			else {
				currSQI = 0x3; } }
		else if (prevSQI == 0x4) {
			if (mse_out < 0x2B) 		//threshold4_down
					     {
				currSQI = 0x5; }
			else if (mse_out > 0x46)	//threshold4_up
					     {
				currSQI = 0x3; }
			else {
				currSQI = 0x4; } }
		else if (prevSQI == 0x5) {
			if (mse_out < 0x1E) 		//threshold5_down
					    {
				currSQI = 0x6; }
			else if (mse_out > 0x36)	//threshold5_up
					     {
				currSQI = 0x4; }
			else {
				currSQI = 0x5; } }
		else if (prevSQI == 0x6) {
			if (mse_out < 0xD) 		//threshold6_down
					     {
				currSQI = 0x7; }
			else if (mse_out > 0x26)	//threshold6_up
					     {
				currSQI = 0x5; }
			else {
				currSQI = 0x6; } }
		else if (prevSQI == 0x7) {
			if (mse_out > 0x16) 		//threshold7_up
					    {
				currSQI = 0x6; }
			else {
				currSQI = 0x7; } }
		else {
			currSQI = prevSQI; }
	}

//sqi at link-loss

	else {
		first_time = 1;
		currSQI = 0x0;
	}

	result = currSQI;
	prevSQI = result;
	return static_cast<cyg_uint8>(result);
}