The invention relates to a method for achieving automatic adjustment of parameters of the
Ethernet based on a PRBS, and the method comprises the steps: enabling
PHY chips of a receiving end and a transmitting end to start a function of PRBS, and enabling the code patterns of the PRBS of the two
PHY chips to remain the same; enabling the transmitting end to transmit a PRBS code
stream to the receiving end; reading the error rate of the PRBS of the receiving end, and generating an error rate graph; analyzing the generated error rate graph, and selecting an optimal parameter; and enabling the optimal parameter to be stored and written in a register. The method can achieve the parameter adjustment of an
Ethernet port in different application situations, and the function of parameter adjustment can be integrated in
application layer software. Moreover, there is no need for other testing tools. The parameter selection of all ports can be achieved through the built-in PRBS transmitters and receivers in the
PHY chips. In addition, the method is simple in operation, and the whole process of parameter selection can be completed through one instruction or key. Therefore, the method is flexible and convenient, is simple in
software design logic, is convenient to transplant, is high in applicability, and is wider in application range.