Time-Varying Pseudorandom Disturbed Pattern Generation Algorithm for Track Circuit Equipment Testing

To improve the test accuracy and fault coverage of high-speed railway-related equipment boards, a time-varying pseudorandom disturbance algorithm based on the automatic test pattern generation technology in chip testing is proposed. The algorithm combines the pseudorandom pattern generation algorithm with the deterministic pattern generation D algorithm. The existing pseudorandom number generation method usually requires random seeds to generate a series of pseudorandom numbers. In this algorithm, the system timer is used as the random seed to design a pseudorandom pattern generation method of time-varying seed to improve the randomness of pseudorandom pattern generation. In addition, in combination with the D algorithm, this work proposes a new switching logic between two algorithms by counting invalid pattern proportions. When the algorithm is applied to track a circuit netlist, the fault coverage can reach near 100%. However, the large-scale circuit fault coverage cannot easily reach 100%. The test results for the standard circuits of different sizes show that at the same time, compared with the independent pattern generation methods, the proposed algorithm can improve fault coverage by more than 50% and 30% and significantly improve the pattern generation efficiency. Therefore, it can be used perfectly in the subsequent construction of high-speed railway equipment test platforms.


Introduction
Transportation is the lifeblood of the national economy and social development, and high-speed railways have been playing an important role in the comprehensive transportation system. The performance, safety testing, and verification of high-speed railway equipment are directly related to the safe operation of high-speed railway systems. Therefore, improving the test accuracy and fault coverage of related equipment boards and developing the corresponding test platform has become an urgent issue to be solved.
A test case is an effective solution to the traditional board test. CEDEX Interoperability Railways Laboratory established the Eurocab test platform for semi-automatic tests and realized the analysis and evaluation of European railway equipment through a test case [1]. Wu et al. proposed a test generation technique based on a colored Petri net model for an advanced satellite-based train control system to generate more complete test cases. The number of test cases increased by 23% after improving the model [2]. For the Chinese Train Control System 3, Zhou et al. optimized test cases through unified modeling language (UML) model diagrams using static and dynamic modeling mechanisms of the UML technology, effectively improving the generation efficiency and quality of cases [3]. Li et al. proposed the timed automata mutation test to simulate most types of system fault models, modeled the radio block center switching process, and improved the mutation score by approximately 11.8% through a mutation analysis. New test cases were generated to improve its integrity [4].
Although the aforementioned test case method has made great progress, it still needs to be improved in edge detection, system stability under limiting conditions, and test accuracy. The chip contains millions of logic gates. In its design process, many methods and EDA tools can verify its function, including automatic test pattern generation (ATPG) technology [5]. If the high-speed railway equipment or board is described as a circuit model, the method used in the integrated circuit design [6] thus had a reference significance to the system level test of the high-speed railway equipment.
The D algorithm is the first widely used deterministic test pattern generation algorithm in the ATPG technology. With the continuous improvement of chip complexity, the limitations of the D algorithm, which has a large number of backtracking and invalid choices, are constantly emerging [7]. Path-oriented decision-making (PODEM) is an improvement of the D algorithm, which reduces the backtracking times and blind trials of the D algorithm [8]. The fanout-oriented algorithm (FAN) is an improvement on PODEM, which significantly improves the generation efficiency by limiting the search space of ATPG to reduce the generation time and accelerate backtracking [9]. In addition, there are many other popular algorithms such as HITEC and Socrates. HITEC presented a targeted D element technique, which greatly increases the number of possible mandatory assignments and reduces the over-specification of state variables which can sometimes result when using a standard PODEM algorithm [10]. Socrates, based upon the sophisticated strategies of the FAN algorithm, led to a considerable reduction of the number of backtrackings and earlier recognition of conflicts and redundancies [11], but the generation process is still complicated.
Among the non-deterministic pattern generation methods for reducing the pattern generation time, pseudorandom pattern generation based on the linear feedback shift register (LFSR) is one of the most typical methods of creating a test pattern. It uses a pseudorandom number generator to generate test patterns and calculates the fault coverage of the generated patterns through fault simulations [12]. Compared with the deterministic pattern generation method, the pseudorandom generation method is simple, but it is more difficult to achieve a higher fault coverage. Moreover, the random seed of this method is single, and the randomness is limited. Souza et al. proposed a method combining the LFSR and deterministic generation algorithm [13]. However, there is still room for improvement in its randomness and generation efficiency.
Based on the combined generation algorithm, in this work, a time-varying pseudorandom disturbance ATPG algorithm, combining the pseudorandom pattern generation algorithm with the deterministic pattern generation D algorithm, is proposed. The existing pseudorandom number generation method usually requires random seeds to generate a series of pseudorandom numbers. In this algorithm, the system timer is used as the random seed to design a pseudorandom pattern generation method of time-varying seeds to improve the randomness of pseudorandom pattern generation. In addition, in combination with the D algorithm, here, a new switching logic between two algorithms by counting the invalid pattern proportion is proposed. The algorithm is applied to the transmitter and receiver board system of the ZPW-2000A track circuit, and the pattern generation of its golden model [14] circuit netlist is performed. Then, the efficiency of the algorithm is tested by comparing the circuits S713, S1423, and S9234.

Time-Varying Pseudorandom Disturbance ATPG Algorithm
The ATPG algorithm uses the gate-level netlist of a circuit as the input file and uses it to create a fault list to complete the pattern generation process. The fault list contains all possible fault types in the circuit, including the typical stuck-at fault, stuck-open fault, bridging fault, and some atypical faults. In this work, only the most common and effective stuck-at fault is considered, which represents the situation in which one line of the circuit is fixed to logic 1 or logic 0 and is represented as s-a-1 or s-a-0, respectively [15]. Netlist files are obtained through a logical synthesis of the register-transfer level code designed by Verilog.

A. Deterministic Pattern Generation Algorithm Based on the D Algorithm
The D algorithm is the most widely used deterministic pattern generation algorithm. It is based on path sensitization at the logic gate level [16] and uses a five-valued logic (0, 1, X, D, D) to describe the states of each lead in the circuit under the failure condition. The principle is shown in Figure 1. files are obtained through a logical synthesis of the register-transfer level code desi by Verilog.

A. Deterministic Pattern Generation Algorithm Based on the D Algorithm
The D algorithm is the most widely used deterministic pattern generation algori It is based on path sensitization at the logic gate level [16] and uses a five-valued log 1, X, D, D -) to describe the states of each lead in the circuit under the failure condition principle is shown in Figure 1. "0" indicates the signal with a normal value of 0 and fault value of 0. "1" indi that the normal value is 1, and the fault value is also 1. "D" represents the signal w normal value of 1 and fault value of 0, which can be recorded as 1/0. "D -" represe signal with a normal value of 0 and fault value of 1, which can be recorded as 0/1 indicates that the value is undetermined. The D algorithm is also implemented in C guage and consists of three steps: (a) Fault sensitization (backward): The influence of the fault can be reflected by dri the signal to be the opposite logical value of the fault. That is, activating the s-a-0 makes the input value of the line set to 1, whereas activating the s-a-1 fault make input value of the line set to 0. Thus, the logic value that the input can activate fault is obtained through a further inverse calculation [17]. (b) Fault propagation (forward): The D signal is propagated to the output end o circuit through one or more paths by setting the input node value of the relevant gates outside the fault point, so that it can be detected from the output end, and inverse to improve the test pattern based on the hypothesis [18]. (c) Line confirmation: The undetermined signal value in the circuit is obtained usin existing node value until a set of non-contradictory values of the original inpu of the circuit is obtained, which is a set of test patterns. When the selected value 1 is inconsistent with the previously assigned value of this node, it is necessary back to the previous node and select again [19].
Compared with a random generation, the D algorithm has a higher fault cove makes it easier to find undetectable faults, and uses fewer patterns. However, the c lation process is complex, requires more resources, and takes a long time to generate

B. Time-Varying Seed Pseudorandom Pattern Generation Algorithm
Pseudorandom pattern generation in integrated circuits is often used in a bu self-test (BIST). As a common testability design method, it can significantly improv testability of random logic in circuits. The BIST often uses LFSR to constitute a pseudo dom sequence generation circuit [21], which has the advantages of a simple gener process and high coverage in a short time. The external exclusive-OR (XOR) LFSR s ture with a conventional length of L is shown in Figure 2. "0" indicates the signal with a normal value of 0 and fault value of 0. "1" indicates that the normal value is 1, and the fault value is also 1. "D" represents the signal with a normal value of 1 and fault value of 0, which can be recorded as 1/0. "D" represents a signal with a normal value of 0 and fault value of 1, which can be recorded as 0/1. "X" indicates that the value is undetermined. The D algorithm is also implemented in C language and consists of three steps: (a) Fault sensitization (backward): The influence of the fault can be reflected by driving the signal to be the opposite logical value of the fault. That is, activating the s-a-0 fault makes the input value of the line set to 1, whereas activating the s-a-1 fault makes the input value of the line set to 0. Thus, the logic value that the input can activate this fault is obtained through a further inverse calculation [17]. (b) Fault propagation (forward): The D signal is propagated to the output end of the circuit through one or more paths by setting the input node value of the relevant logic gates outside the fault point, so that it can be detected from the output end, and then inverse to improve the test pattern based on the hypothesis [18]. (c) Line confirmation: The undetermined signal value in the circuit is obtained using the existing node value until a set of non-contradictory values of the original input end of the circuit is obtained, which is a set of test patterns. When the selected value 0 or 1 is inconsistent with the previously assigned value of this node, it is necessary to go back to the previous node and select again [19].
Compared with a random generation, the D algorithm has a higher fault coverage, makes it easier to find undetectable faults, and uses fewer patterns. However, the calculation process is complex, requires more resources, and takes a long time to generate [20].

B. Time-Varying Seed Pseudorandom Pattern Generation Algorithm
Pseudorandom pattern generation in integrated circuits is often used in a built-in self-test (BIST). As a common testability design method, it can significantly improve the testability of random logic in circuits. The BIST often uses LFSR to constitute a pseudorandom sequence generation circuit [21], which has the advantages of a simple generation process and high coverage in a short time. The external exclusive-OR (XOR) LFSR structure with a conventional length of L is shown in Figure 2.
back constant CL is 0 or 1, and a single seed can generate a maximum of 2 patterns. To generate other patterns, the random seed or feedback constant needs to be changed, and the randomness has a certain space for improvement. This work uses C language to realize the algorithm flow. The algorithm generates a pseudorandom sequence as a test pattern and then conducts fault simulation on each pattern to identify all faults that can be detected. After the detected faults are deleted from the fault list, the next test pattern is generated to repeat the process.
Because the random seed of the pseudorandom pattern generation method based on LFSR cannot be easily changed, the randomness needs to be improved. The algorithm uses the value of the system timer/counter to set the random seed so that the seed can change at any time and ensure that each pattern is generated by a different seed. By generating random numbers from 0 to 100 and judging whether they are greater than 50, 0/1 can be randomly generated by bits according to the required pattern length. Compared with LFSR in [13], the correlation between patterns is reduced, and the algorithm's randomness is enhanced. The algorithm flow is as follows: then seed ← time(((long *) NULL)) 3: else seed ← rand()% seed 4: srand (seed) 5: for K = 0 to max do 6: if rand()% 100 > 50 7: However, the generation of a pseudorandom pattern still has some problems, such as difficulty in finding undetectable faults, a long time to reach the target fault coverage, and a large number of required patterns, so the generation efficiency still has a large space to improve.

C. Time-Varying Pseudorandom Disturbance ATPG Algorithm
Based on the time advantage of the pseudorandom pattern generation algorithm and coverage advantage of the D algorithm, a time-varying pseudorandom disturbance ATPG algorithm is proposed in this work to improve the generation efficiency of the algorithm from two important evaluation indexes, i.e., fault coverage and generation time. Figure 3a shows the comparison of the variation trend of the fault coverage with the generation time between the pseudorandom generation algorithm and the D algorithm [24]. In Figure 2, a set of initial assignment values between (L−1) and 0 is called a set of random seeds. At present, the quantum random number generators (QRNGs) have been used to achieve complete random-number generation [22], but it is too complicated for ATPG technology. The simpler pseudorandom number generation method usually requires random seeds to generate a series of fixed pseudorandom numbers [23]. The feedback constant C L is 0 or 1, and a single seed can generate a maximum of 2 L patterns. To generate other patterns, the random seed or feedback constant needs to be changed, and the randomness has a certain space for improvement. This work uses C language to realize the algorithm flow. The algorithm generates a pseudorandom sequence as a test pattern and then conducts fault simulation on each pattern to identify all faults that can be detected. After the detected faults are deleted from the fault list, the next test pattern is generated to repeat the process.
Because the random seed of the pseudorandom pattern generation method based on LFSR cannot be easily changed, the randomness needs to be improved. The algorithm uses the value of the system timer/counter to set the random seed so that the seed can change at any time and ensure that each pattern is generated by a different seed. By generating random numbers from 0 to 100 and judging whether they are greater than 50, 0/1 can be randomly generated by bits according to the required pattern length. Compared with LFSR in [13], the correlation between patterns is reduced, and the algorithm's randomness is enhanced. The generating flow is as Algorithms 1:

Algorithms 1: Pseudorandom pattern generation.
1: if seed < 1000 2: then seed ← time(((long *) NULL)) 3: else seed ← rand()% seed 4: srand (seed) 5: for K = 0 to max do 6: if rand()% 100 > 50 7: then input[K] ← '1' 8: else input[K] ← '0' 9: end However, the generation of a pseudorandom pattern still has some problems, such as difficulty in finding undetectable faults, a long time to reach the target fault coverage, and a large number of required patterns, so the generation efficiency still has a large space to improve.

C. Time-Varying Pseudorandom Disturbance ATPG Algorithm
Based on the time advantage of the pseudorandom pattern generation algorithm and coverage advantage of the D algorithm, a time-varying pseudorandom disturbance ATPG algorithm is proposed in this work to improve the generation efficiency of the algorithm from two important evaluation indexes, i.e., fault coverage and generation time. Figure 3a shows the comparison of the variation trend of the fault coverage with the generation time between the pseudorandom generation algorithm and the D algorithm [24].  The early random patterns gradually slow down, which cannot be significantly improved even after a long time. However, the D algorithm always maintains a certain rate of coverage improvement, which is significantly higher than the generation of a pseudorandom pattern. This finding indicates that the algorithm can deal with many undetectable faults that cannot be found by the pseudorandom pattern.
Based on the generation characteristics of the two kinds of pattern generation methods, the time-varying pseudorandom disturbance ATPG algorithm is designed. The variation trend of the algorithm fault coverage with the generation time is shown in Figure  3b. The generation algorithm adopts the pseudorandom method first and then the D algorithm. First, the pseudorandom pattern generation is used to achieve a high fault coverage in 5 s. After the curve slows down, the D algorithm deals with the remaining undetectable faults in the fault list. Thus, considerable fault coverage can be achieved in a short time, and the generation efficiency can be significantly improved. Parameters M, L, and S represent the running time of the two algorithms. When the same coverage is achieved, the improved algorithm in Figure 3b can make the total generation time of the algorithm represented by L + S smaller than the time M in Figure 3a [13].
In the pseudorandom pattern generation process, when a generated pattern cannot detect any fault in the fault list, it is regarded as an invalid pattern. Variable α is used to count the invalid pattern ratio to achieve the control of the algorithm switching timing, adjust the ratio occupied by the two methods, and improve the generation efficiency. When α ≥ n, the generation of the pseudorandom pattern ends, and the D algorithm is used to continue the generation process. The specific control mode is shown as follows: Algorithms 2: 1: while α < n do 2: Generate a random pattern 3: Simulate the pattern 4: if faults_count = 0 5: then P++ 6: α←P/Q 7: else Mark the fault as detected 8: end 9: Generate test patterns deterministically P represents the number of generated invalid patterns, and Q represents the total number of generated patterns. α is used as an invalid pattern ratio counter and represents the proportion of generated invalid patterns to the total number of generated patterns. Standard circuits S713, S1423, and S9234 are used for pseudorandom pattern generation, and the change in the fault coverage with n values is shown in Figure 4. It can be used to select the algorithm switching timing. The early random patterns gradually slow down, which cannot be significantly improved even after a long time. However, the D algorithm always maintains a certain rate of coverage improvement, which is significantly higher than the generation of a pseudorandom pattern. This finding indicates that the algorithm can deal with many undetectable faults that cannot be found by the pseudorandom pattern.
Based on the generation characteristics of the two kinds of pattern generation methods, the time-varying pseudorandom disturbance ATPG algorithm is designed. The variation trend of the algorithm fault coverage with the generation time is shown in Figure 3b. The generation algorithm adopts the pseudorandom method first and then the D algorithm. First, the pseudorandom pattern generation is used to achieve a high fault coverage in 5 s. After the curve slows down, the D algorithm deals with the remaining undetectable faults in the fault list. Thus, considerable fault coverage can be achieved in a short time, and the generation efficiency can be significantly improved. Parameters M, L, and S represent the running time of the two algorithms. When the same coverage is achieved, the improved algorithm in Figure 3b can make the total generation time of the algorithm represented by L + S smaller than the time M in Figure 3a [13].
In the pseudorandom pattern generation process, when a generated pattern cannot detect any fault in the fault list, it is regarded as an invalid pattern. Variable α is used to count the invalid pattern ratio to achieve the control of the algorithm switching timing, adjust the ratio occupied by the two methods, and improve the generation efficiency. When α ≥ n, the generation of the pseudorandom pattern ends, and the D algorithm is used to continue the generation process. The specific control mode is shown as Algorithms 2: Algorithms 2: The control mode of the algorithm switching timing.
1: while α < n do 2: Generate a random pattern 3: Simulate the pattern 4: if faults_count = 0 5: then P++ 6: α←P/Q 7: else Mark the fault as detected 8: end 9: Generate test patterns deterministically P represents the number of generated invalid patterns, and Q represents the total number of generated patterns. α is used as an invalid pattern ratio counter and represents the proportion of generated invalid patterns to the total number of generated patterns. Standard circuits S713, S1423, and S9234 are used for pseudorandom pattern generation, and the change in the fault coverage with n values is shown in Figure 4. It can be used to select the algorithm switching timing.  In this curve, it went smoothly and showed saturation, such that its derivative gra ually approaches 0. For n = 10%, the rate of derivative decrease significantly slows dow and the fault coverage of pseudorandom patterns has basically reached the highest a does not change significantly with n. It is difficult to effectively improve the fault covera by increasing the n value and has a limited influence on the overall coverage of the alg rithm. To balance the fault coverage and generation time and ensure that the highest fa coverage can be achieved within the shortest time, n = 30% was selected as the algorith switching point in this work. Compared with the switching logic of using timers to cont the generation time of pseudorandom patterns adopted in [13], this work achieved a r sonable control of specific switching timing by using the same variable n in view of actual pattern generation of different circuits. This method reduces blindness and mak the fault coverage of different circuits as consistent as possible at a certain switch po with the variation trend of variable n.

Results and Discussion
The logic of the algorithm testing is described in Figure 5. The application of AT to high-speed railway equipment requires the design of a corresponding golden mod The golden model is designed according to the equipment system, and it can be used obtain the netlist after a logical synthesis and inputted into the ATPG algorithm to gen ate patterns. The transmitter and receiver of the high-speed railway ZPW-2000A track circuit w designed to realize the modulation and demodulation functions of frequency-shifted F signals, respectively.
First, the designed golden model netlist was used for the pattern generation (11 ga for the transmitter and 20 gates for the receiver), and the fault coverage can reach n 100% using the algorithm. As the large-scale circuit fault coverage cannot easily rea 100%, the medium-scale circuits S713 (393 gates) and S1423 (657 gates), and large-sc In this curve, it went smoothly and showed saturation, such that its derivative gradually approaches 0. For n = 10%, the rate of derivative decrease significantly slows down, and the fault coverage of pseudorandom patterns has basically reached the highest and does not change significantly with n. It is difficult to effectively improve the fault coverage by increasing the n value and has a limited influence on the overall coverage of the algorithm. To balance the fault coverage and generation time and ensure that the highest fault coverage can be achieved within the shortest time, n = 30% was selected as the algorithm switching point in this work. Compared with the switching logic of using timers to control the generation time of pseudorandom patterns adopted in [13], this work achieved a reasonable control of specific switching timing by using the same variable n in view of the actual pattern generation of different circuits. This method reduces blindness and makes the fault coverage of different circuits as consistent as possible at a certain switch point with the variation trend of variable n.

Results and Discussion
The logic of the algorithm testing is described in Figure 5. The application of ATPG to high-speed railway equipment requires the design of a corresponding golden model. The golden model is designed according to the equipment system, and it can be used to obtain the netlist after a logical synthesis and inputted into the ATPG algorithm to generate patterns.  In this curve, it went smoothly and showed saturation, such that its derivative grad ually approaches 0. For n = 10%, the rate of derivative decrease significantly slows down and the fault coverage of pseudorandom patterns has basically reached the highest an does not change significantly with n. It is difficult to effectively improve the fault coverag by increasing the n value and has a limited influence on the overall coverage of the algo rithm. To balance the fault coverage and generation time and ensure that the highest fau coverage can be achieved within the shortest time, n = 30% was selected as the algorithm switching point in this work. Compared with the switching logic of using timers to contro the generation time of pseudorandom patterns adopted in [13], this work achieved a rea sonable control of specific switching timing by using the same variable n in view of th actual pattern generation of different circuits. This method reduces blindness and make the fault coverage of different circuits as consistent as possible at a certain switch poin with the variation trend of variable n.

Results and Discussion
The logic of the algorithm testing is described in Figure 5. The application of ATP to high-speed railway equipment requires the design of a corresponding golden mode The golden model is designed according to the equipment system, and it can be used t obtain the netlist after a logical synthesis and inputted into the ATPG algorithm to gene ate patterns.  The transmitter and receiver of the high-speed railway ZPW-2000A track circuit wer designed to realize the modulation and demodulation functions of frequency-shifted FS signals, respectively.
First, the designed golden model netlist was used for the pattern generation (11 gate for the transmitter and 20 gates for the receiver), and the fault coverage can reach nea 100% using the algorithm. As the large-scale circuit fault coverage cannot easily reac 100%, the medium-scale circuits S713 (393 gates) and S1423 (657 gates), and large-scal circuit S9234 (5597 gates) were tested. In the same base generation time, the algorithm using the pseudorandom pattern generation and D algorithm alone were compared wit The transmitter and receiver of the high-speed railway ZPW-2000A track circuit were designed to realize the modulation and demodulation functions of frequency-shifted FSK signals, respectively.
First, the designed golden model netlist was used for the pattern generation (11 gates for the transmitter and 20 gates for the receiver), and the fault coverage can reach near 100% using the algorithm. As the large-scale circuit fault coverage cannot easily reach 100%, the medium-scale circuits S713 (393 gates) and S1423 (657 gates), and large-scale circuit S9234 (5597 gates) were tested. In the same base generation time, the algorithms using the pseudorandom pattern generation and D algorithm alone were compared with the disturbance algorithm. Due to the randomness in the algorithm, the fault coverage results generated by the algorithm are different each time. Take the multiple generation results of circuit S713 as an example, as shown in Figure 6.
Micromachines 2022, 13, x 7 of 9 the disturbance algorithm. Due to the randomness in the algorithm, the fault coverage results generated by the algorithm are different each time. Take the multiple generation results of circuit S713 as an example, as shown in Figure 6.  Figure 6. Results of multiple tests against the disturbance algorithm using S713.
As can be seen from the figure, the results of multiple tests for the disturbance algorithm using S713 fluctuate within a certain range. Thus, five groups of repeated experiments were required to take the average value, and the number of generated patterns, detected faults, and fault coverage of each algorithm were counted, as shown in Table 1 and Figure 7.  Figure 6. Results of multiple tests against the disturbance algorithm using S713.
As can be seen from the figure, the results of multiple tests for the disturbance algorithm using S713 fluctuate within a certain range. Thus, five groups of repeated experiments were required to take the average value, and the number of generated patterns, detected faults, and fault coverage of each algorithm were counted, as shown in Table 1 and Figure 7.  The generation results in Figure 7 show that in the same generation time, compared with the D algorithm, the pseudorandom pattern generation has the lowest fault coverage and requires more patterns. The number of detected faults and fault coverage reached the highest level after the combination of the two methods. The fault coverage increased by more than 50% and 30% compared with the independent method, so the efficiency of the algorithm was significantly improved. The generation results in Figure 7 show that in the same generation time, compared with the D algorithm, the pseudorandom pattern generation has the lowest fault coverage and requires more patterns. The number of detected faults and fault coverage reached the