The invention relates to the technical field of programmable logic arrays, and discloses a method and
system for achieving
automatic testing of a
programmable logic array by using an ATPG tool, and the method comprises the steps: inserting a virtual
scan chain,
combinational logic composed of a plurality of programmable points in the
programmable logic array and a real
scan chain into the ATPG tool, wherein a plurality of outputs of the virtual
scan chain are respectively in one-to-one correspondence with a plurality of programmable points and are respectively connected to the
combinational logic; using an ATPG tool to generate a
test vector; analyzing a
test vector generated by the ATPG tool, extracting a
test vector corresponding to the virtual scan chain, and adding the test vector into a partial download code
stream of the
programmable logic array corresponding to the plurality of programmable points; enabling the real scan chain, and inputting a test vector corresponding to the real scan chain into the real scan chain; closing the real scan chain, and capturing the output value of the
combinational logic to the real scan chain; and enabling the real scan chain, extracting an output value of the real scan chain, and judging whether the combinational logic has a functional fault according to the output value of the real scan chain. According to the method, the
algorithm advantages of the ATPG tool are used, and the complete test vector is generated, so that the automatic test of the programmable logic array is realized.