The present invention aims to increase an encoding efficiency when the occurrence probability of LPS is low. The semiconductor device includes an insulating film over a conductive film and an oxide semiconductor film over the insulating film. An input device monitors use of the tool along with a given operator, wherein a cycle counter monitors use of the tool by the operator for an elapsed time. The controller is configured to selectively allow the scanning process to proceed when an output of the light source is less than about 80% of the maximum output. A system for automatic design and production of die-unique patterns is also shown.