Generative model training method and device, mask generation method and device, equipment and storage medium

By introducing a mask generation model with conditional injection and simulation-driven training into photolithography, the problem of large deviation between mask generation and actual photolithography results in existing technologies has been solved, achieving high-precision and stable mask generation and improving the imaging quality of photolithography processes.

CN121834339APending Publication Date: 2026-04-10HUBEI YANGTZE PILOT-LINE SERVICES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing photolithography technologies, rule-based OPC methods have poor applicability at technology nodes smaller than 130 nanometers, while MB-OPC methods have high computational costs and poor manufacturability of the generated masks. Existing AI-based generation algorithms suffer from insufficient physical planning and mapping, resulting in significant deviations between the generated masks and the actual photolithography results.

Method used

By introducing a conditional injection mechanism and simulation-driven training, a mask generation model based on a conditional denoising diffusion probability model is constructed. Combined with lithography physical parameters and a lithography simulator, a closed-loop optimization mechanism is formed to improve the accuracy and stability of mask generation.

Benefits of technology

It significantly improves the imaging quality in the photolithography process, enhances the physical rationality and stability of mask generation, and improves the consistency and precision of the photolithography effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121834339A_ABST
    Figure CN121834339A_ABST
Patent Text Reader

Abstract

The invention provides a generative model training method and device, a mask generation method and device, equipment and a storage medium. The method comprises the steps of obtaining multiple pieces of sample data; carrying out iterative training by utilizing a plurality of sample data and the initial mask generation model to obtain a target mask generation model, wherein the steps comprise: fusing a first target layout and a first photoetching physical parameter corresponding to a certain sample data to form a first fusion condition; inputting the first known mask and the first fusion condition into the initial mask generation model for prediction to obtain a first predicted mask, and calculating a first loss; performing photoetching simulation on the first prediction mask to obtain a first prediction wafer graph, and calculating second loss; obtaining joint loss according to the first loss and the second loss, and updating parameters of the initial mask generation model by using the joint loss; and repeating the above steps to carry out iterative training until convergence or reaching a first preset number of iterations, and obtaining a target mask generation model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of semiconductor manufacturing and photolithography technology, and particularly relates to a model training method, a mask generation method, a device, equipment and a storage medium. BACKGROUND

[0002] Photolithography is one of the core processes in semiconductor manufacturing, which is used to accurately transfer the patterns on a layout to a wafer. With the continuous miniaturization of integrated circuit process nodes, the optical proximity effect (OPE) becomes increasingly significant, resulting in serious distortion between the mask pattern and the wafer imaging image. In order to solve the pattern distortion caused by the proximity effect, the current optical proximity effect correction (OPC) mainly adopts a rule-based OPC (RB-OPC) method and a model-based OPC (MB-OPC) method. However, in the RB-OPC method, the requirement for the rule library design is to include all the correction schemes required for the original layout. After the technology node is reduced to 130 nanometers (nm), it is very difficult to determine the rules, and at this time, the applicability of the rule-based OPC method is poor, and the precision cannot meet the requirements. In the MB-OPC method, the calculation cost increases exponentially with the accuracy requirement of the model. For example, at the 10 nm technology node, the running calculation time of 1 square millimeter (mm 2 ) circuit layout is about 15 days, and a 7 nm chip may need up to 100 layers of masks, and each layer of mask data needs to be run on a server with tens of thousands of cores using an electronic design automation (EDA) tool for hundreds of thousands of core times, and the calculation period is counted in months. In addition, with the development of advanced processes, the mask pattern has high freedom and small adjustable parameters, and the search space is huge, and traditional strict numerical calculation cannot meet the design cycle and yield requirements. However, the existing artificial intelligence (AI) based generation algorithm has the problems of insufficient physical planning mapping and poor manufacturability of the generated mask, or still needs physical photolithography simulation for optimization, which is time-consuming. SUMMARY

[0003] This application provides a generative model training method, a mask generation method, an apparatus, a device, and a storage medium, which can improve the interpretability and stability of the generated mask, thereby effectively solving the problem of large deviation between the generated mask and the actual photolithography results in the prior art.

[0004] The technical solution of this application embodiment is implemented as follows: This application provides a mask generation model training method, the method comprising: acquiring multiple sample data, wherein each sample data includes a first target layout, a first lithographic physical parameter corresponding to the first target layout, and a first known mask corresponding to the first target layout; and iteratively training the multiple sample data and a pre-constructed initial mask generation model to obtain a target mask generation model; wherein the training steps include: step 1, fusing the first target layout and the first lithographic physical parameter corresponding to a certain sample data to form a first fusion condition; step 2, inputting the first known mask and the first fusion condition into the training model. Step 1: The initial mask generation model is used to predict and obtain a first predicted mask corresponding to the first target layout, and a first loss is calculated; Step 2: The first predicted mask is subjected to photolithography simulation to obtain a first predicted wafer image, and a second loss is obtained based on the first target layout and the first predicted wafer image; Step 3: A joint loss is obtained based on the first loss and the second loss, and the parameters of the initial mask generation model are updated using the joint loss; Steps 1 to 4 are repeated for iterative training until the trained mask generation model converges or reaches a first preset number of iterations, and the finally trained mask generation model is used as the target mask generation model.

[0005] This application also provides a mask generation method, the method comprising: acquiring a second target layout and second lithographic physical parameters corresponding to the second target layout, or acquiring the second target layout, the second lithographic physical parameters, and at least one second reference mask; inputting the second target layout and the second lithographic physical parameters into a target mask generation model as described above for prediction to obtain a second predicted mask corresponding to the second target layout, or inputting the second target layout, the second lithographic physical parameters, and the at least one second reference mask into the target mask generation model for prediction to obtain the second predicted mask; performing lithographic simulation on the second predicted mask to obtain a second predicted wafer image, and comparing the second predicted wafer image with the second target layout; if the first comparison result is that the error between the second predicted wafer image and the second target layout is greater than or equal to a preset threshold, obtaining a first hotspot map corresponding to the second target layout; the first hotspot map is used to reflect the degree of difference between the second predicted wafer image and the second target layout; optimizing the second predicted mask using the first hotspot map to obtain a target predicted mask corresponding to the second target layout.

[0006] This application provides a training device for a mask generation model. The training device includes: a first data acquisition module for acquiring multiple sample data, wherein each sample data includes a first target layout, a first lithographic physical parameter corresponding to the first target layout, and a first known mask corresponding to the first target layout; and a model training module for iteratively training the multiple sample data and a pre-constructed initial mask generation model to obtain a target mask generation model. The training steps include: Step 1, fusing the first target layout and the first lithographic physical parameter corresponding to a certain sample data to form a first fusion condition; Step 2, using the first known mask... The first fusion condition is input into the initial mask generation model for prediction to obtain a first predicted mask corresponding to the first target layout, and a first loss is calculated; Step 3, the first predicted mask is subjected to photolithography simulation to obtain a first predicted wafer image, and a second loss is obtained based on the first target layout and the first predicted wafer image; Step 4, a joint loss is obtained based on the first loss and the second loss, and the parameters of the initial mask generation model are updated using the joint loss; Steps 1 to 4 above are repeated for iterative training until the trained mask generation model converges or reaches a first preset number of iterations, and the finally trained mask generation model is used as the target mask generation model.

[0007] This application embodiment also provides a photolithography mask generation apparatus, the generation apparatus comprising: a second data acquisition module, configured to: acquire a second target layout and second photolithography physical parameters corresponding to the second target layout, or acquire the second target layout, the second photolithography physical parameters, and at least one second reference mask; and a mask generation module, configured to: input the second target layout and the second photolithography physical parameters into the aforementioned target mask generation model for prediction, to obtain a second predicted mask corresponding to the second target layout, or input the second target layout, the second photolithography physical parameters, and the at least one second reference mask. The data is input into the target mask generation model for prediction to obtain the second predicted mask; photolithography simulation is performed on the second predicted mask to obtain the second predicted wafer image, and the second predicted wafer image is compared with the second target layout; if the error between the second predicted wafer image and the second target layout is greater than or equal to a preset threshold in the first comparison result, a first hotspot map corresponding to the second target layout is obtained; the first hotspot map is used to reflect the degree of difference between the second predicted wafer image and the second target layout; the second predicted mask is optimized using the first hotspot map to obtain the target predicted mask corresponding to the second target layout.

[0008] This application provides a training device for a mask generation model. The model training device includes: a first memory for storing computer-executable instructions or computer programs; and a second processor for executing the computer-executable instructions or computer programs stored in the memory to implement the training method provided in this application.

[0009] This application also provides a photomask generation apparatus, the generation apparatus comprising: a second memory for storing computer-executable instructions or computer programs; and a second processor for executing the computer-executable instructions or computer programs stored in the memory to implement the generation method provided in this application.

[0010] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions, which are used to implement the training method provided in this application when executed by a processor, or to implement the generation method provided in this application when executed by a user.

[0011] This application provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implement the method provided in this application.

[0012] The embodiments of this application have the following beneficial effects: First, by fusing the target layout and lithography physical parameters to generate guidance information, the generation process of the target mask generation model is guided, thereby improving the physical rationality of the generated mask; Second, during the model training process, not only is reconstruction loss introduced, but simulation loss generated by the lithography simulator is also combined to drive model optimization in a joint loss manner, so that the model can take into account both the accuracy of the mask structure and the consistency of the actual lithography effect. Attached Figure Description

[0013] Figure 1 This is an exemplary flowchart of a mask generation model training method provided in an embodiment of this application. Figure 1 ; Figure 2 This is an exemplary flowchart of a mask generation model training method provided in an embodiment of this application. Figure 2 ; Figure 3 This is an exemplary flowchart of a mask generation method provided in an embodiment of this application. Figure 1 ; Figure 4 This is an exemplary flowchart of a mask generation method provided in an embodiment of this application. Figure 2 ; Figure 5 This is an exemplary flowchart of a mask generation method provided in an embodiment of this application. Figure 3 ; Figure 6 and Figure 7 This is a schematic diagram illustrating the training principle of the mask generation model provided in this application embodiment; Figure 8 This is a schematic diagram illustrating an exemplary implementation of the mask generation method provided in this application embodiment; Figure 9 This is an exemplary structural diagram of a training device for a mask generation model provided in an embodiment of this application; Figure 10 This is an exemplary structural diagram of a photomask generation apparatus provided in an embodiment of this application; Figure 11 This is an exemplary structural diagram of a training device for a mask generation model provided in an embodiment of this application; Figure 12 This is an exemplary structural diagram of a photomask generation device provided in an embodiment of this application.

[0014] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0016] The following will introduce the key concepts and terms involved in this application in order to provide a clearer understanding of the technical solution of this application.

[0017] 1) Optical Proximity Effect: During photolithography, due to the diffraction and interference of light waves, a difference in morphology occurs between the actual image and the design layout. This phenomenon is called the optical proximity effect. OPC aims to adjust the mask pattern to make the wafer image formed after photolithography closer to the design layout. The design layout can be a binary image.

[0018] 2) Conditional injection: This refers to embedding external guidance information such as the target design layout (hereinafter referred to as the target layout) and lithographic physical parameters into the trained mask generation model during the model training process. This serves as an important guiding factor for mask generation, thereby enhancing the physical rationality and consistency of the generated results.

[0019] 3) Simulation-driven training: This refers to the process in which, during the model training phase, not only is the reconstruction loss used to measure the difference between the generated mask (i.e., the mask predicted by the model) and the known mask, but the generated mask is also simulated using a fast lithography simulator to calculate the difference between the corresponding wafer image and the target layout. This difference is then incorporated into the joint loss function as the simulation loss, thereby achieving end-to-end optimization of the model.

[0020] 4) Closed-loop reasoning: This refers to the process of using a trained target mask generation model. If the predicted mask obtained by the target mask generation model fails to meet the imaging quality requirements, the simulation results (such as heat maps), the corresponding target layout, and the corresponding lithography physical parameters are used as new fusion conditions and input into the target mask generation model again to optimize the predicted mask, forming an iterative feedback closed-loop process to gradually approach the optimal solution.

[0021] 5) Joint Loss: The total loss, composed of a weighted combination of multiple sub-losses, is used to comprehensively evaluate the performance of the trained mask generation model in different aspects. In this application, the joint loss includes reconstruction loss and simulation loss, which correspond to the degree of matching between the predicted mask and the real mask, and the consistency between the predicted wafer map based on the predicted mask and the target layout, respectively.

[0022] To address the challenge that traditional OPC methods in existing technologies struggle to adapt to complex and variable layouts and lithography conditions, resulting in poor matching between the generated mask (i.e., the predicted mask) and the target layout, thus affecting lithography performance, this application proposes a mask generation model training method based on Denoising Diffusion Probabilistic Models (DDPM). By introducing a conditional injection mechanism and simulation-driven training, a physically aware deep learning model is constructed, thereby improving the accuracy and stability of mask generation and significantly enhancing imaging quality in lithography processes. Specifically, this application integrates the target layout and lithography physical parameters as input conditions for model training, guiding the trained model to generate masks with high physical consistency. Simultaneously, a fast lithography simulator is used to verify the predicted mask, and the simulation results are fed back into the model training process, forming a closed-loop optimization mechanism to further improve the model's generalization ability and prediction accuracy. Furthermore, during training, auxiliary guidance information provided by a retrieval module can be combined to guide the trained model to generate masks with even higher physical consistency.

[0023] The mask generation model training methods provided in the embodiments of this application can be executed by electronic devices, which may be computers, servers, or dedicated training systems. Figure 1 This is a schematic diagram of an optional flowchart of the mask generation model training method provided in the embodiments of this application. The following will combine... Figure 1 The steps shown are explained. For example... Figure 1 As shown, the training process includes the following steps 101 to 102.

[0024] Step 101: Acquire multiple sample data, wherein each sample data includes a first target layout, a first photolithography physical parameter corresponding to the first target layout, and a first known mask corresponding to the first target layout.

[0025] In actual training, sample data forms the basis of the training model. Each sample data represents a lithography scenario within the lithography process. For example, a lithography scenario might involve the Cth exposure at position B on silicon wafer A. The corresponding first target layout (or target pattern), the required first lithography physical parameters, and the required first known mask constitute a sample data. The first target layout can refer to the layout of an integrated circuit, a graphic used to guide the final desired wafer pattern; it can be a binary image. The first lithography physical parameters can include at least one of numerical aperture (NA), exposure wavelength, illumination mode, and coherence factor. Numerical aperture is a parameter describing the light-gathering ability of an optical system; a larger numerical aperture value results in stronger system resolution. The size of the numerical aperture directly affects the minimum resolvable line width in the lithography process. For example, in modern lithography equipment, the numerical aperture typically ranges from 0.25 to 1.35, with different numerical apertures suitable for different process nodes. The exposure wavelength refers to the wavelength of light used by the light source in the photolithography process. Common wavelengths include deep ultraviolet (DUV) such as 248nm and 193nm, and extreme ultraviolet (EUV) such as 13.5nm. The exposure wavelength determines the resolution limit of the light source used in the photolithography process; the shorter the wavelength, the finer the pattern that the light source can achieve. The illumination mode describes how the light source illuminates the mask during the photolithography process. Illumination modes include uniform illumination, ring illumination, quadrupole illumination, etc. The illumination mode affects the light propagation path and interference effects, and thus affects the final image quality. The coherence factor is a parameter that measures the spatial coherence of the light source, usually represented by σ, and its value ranges from 0 to 1. σ=1 indicates complete coherence, and σ=0 indicates complete incoherence. The choice of coherence factor affects the diffraction behavior of light and image contrast, and is of great significance for the design of certain specific structures. These parameters determine the imaging capability in the photolithography process.

[0026] In this embodiment, the first known mask can refer to high-quality, realistic mask data that has been corrected and has a small error between the wafer image formed by it and the first target layout. The sample data can be obtained from public datasets or self-built datasets, and has been validated by physical simulation data or traditional OPC tools.

[0027] In some embodiments, before training using the plurality of sample data, the training method may further include: normalizing the first lithographic physical parameters contained in each sample data and enhancing the first target layout contained in each sample data, wherein the enhancement process may include at least one of cropping, scaling, rotating and flipping, and extracting edge information from the first target layout.

[0028] It should be noted that the normalization process can be used to map data of different dimensions or scales to a unified data range, typically [0, 1] or [-1, 1]. In this embodiment, the lithography physical parameters (such as numerical aperture, exposure wavelength, etc.) in each sample data are normalized to eliminate the order-of-magnitude differences between these parameters, thereby making the model training process more stable and efficient. Specifically, the value range of each lithography physical parameter is first predefined according to the process design conditions or historical data, for example, numerical aperture NA: [NAmin, NAmax], exposure wavelength λ: [λmin, λmax], coherence factor σ: [σmin, σmax], etc. Then, each lithography physical parameter P is normalized using the following formula (1).

[0029] (1).

[0030] Finally, after normalizing all the lithography physical parameters P, a vector Pnorm=[NAnorm, λnorm, σ_norm, ...] is formed and used as a condition input to the initial mask generation model or the intermediate trained mask generation model.

[0031] In this embodiment, the augmentation process refers to performing various transformation operations on the original image to increase the diversity and robustness of the dataset. Augmentation includes the following methods: Cropping: Extracting a portion of the original image as a new training sample, which helps the model learn local features. Scaling: Proportionally enlarging or reducing the image size to simulate size changes that may occur under different processes. Rotation and Flipping: This method rotates or flips the image horizontally / vertically, thereby increasing image diversity. Edge Extraction refers to using edge detection algorithms (such as Sobel, Canny, etc.) to process the image to extract contour information and highlight key geometric features. This augmentation process not only increases the size of the dataset but also improves the adaptability of the trained target mask generation model to mask image generation under various input conditions. It can effectively improve the model's generalization performance, enabling the trained target mask generation model to better cope with complex and varied real-world lithography scenarios, further accelerating convergence and improving prediction accuracy.

[0032] In this embodiment, by introducing normalization processing of lithography physical parameters and enhancement processing of target layout, the training efficiency and stability of the generative model can be improved, thereby enabling the generative model to generate mask images that are closer to the actual process requirements, and ultimately achieving a significant improvement in the overall quality and reliability of lithography mask generation.

[0033] Step 102: Iteratively train the target mask generation model using the multiple sample data and the pre-built initial mask generation model; wherein the training steps include: Step 1, fusing the first target layout and the first lithographic physical parameters corresponding to a certain sample data to form a first fusion condition; Step 2, inputting the first known mask and the first fusion condition into the initial mask generation model for prediction to obtain a first predicted mask corresponding to the first target layout, and calculating a first loss; Step 3, performing lithographic simulation on the first predicted mask to obtain a first predicted wafer image, and obtaining a second loss based on the first target layout and the first predicted wafer image; Step 4, obtaining a joint loss based on the first loss and the second loss, and using the joint loss to update the parameters of the initial mask generation model; repeating the above steps 1 to 4 for iterative training until the trained mask generation model converges or reaches a first preset number of iterations, and using the finally trained mask generation model as the target mask generation model.

[0034] It should be noted that step 102 above is the specific training process of the mask generation model.

[0035] In this embodiment, the first fusion condition can refer to combining the first target layout and the first lithographic physical parameters to form a unified input condition, serving as guiding information for the initial mask generation model. During the training process, the image features of the first target layout and the first lithographic physical parameters included in the first fusion condition can be embedded into the same space through attention mechanisms, affine transformations, or other methods, enabling the initial mask generation model to perceive the correlation between the first target layout and the first lithographic physical parameters. Specifically, in this embodiment, a cross-attention layer can be used to interact the first target layout and the first lithographic physical parameters, thereby extracting richer contextual information and guiding the initial mask generation model to generate a predictive mask. This allows the initial mask generation model to better understand the physical constraints in the lithography process, improving the physical rationality and imaging quality of the generated mask, and thus more accurately meeting actual lithography requirements.

[0036] The initial mask generation model can employ a Denoising Diffusion Probability Model (DDPM) framework, with a U-net as the main denoising network. This model can include forward and backward processes. DDPM can be a Markov chain-based generative model implemented through forward denoising and backward denoising. In the forward process, the initial mask generation model progressively adds Gaussian noise to the input image (e.g., the first known mask), gradually degrading the input image to a state of pure noise. Simultaneously, it records the temporal embedding of each noise addition (i.e., each step). This temporal embedding represents the current noise level, helping the initial mask generation model understand which stage it is currently processing. In the backward process, the initial mask generation model uses the U-net to construct a progressively denoised image, restoring a clear image. The U-net includes an encoder and a decoder, with skip connections in between, which helps preserve image details.

[0037] Based on the preceding description of the initial mask generation model, in this embodiment of the application, step 2 above, which involves inputting the first known mask and the first fusion condition into the initial mask generation model for prediction to obtain a first predicted mask corresponding to the first target layout, may include: in the forward process, gradually adding Gaussian noise to the first known mask to obtain a noise image and a time-step embedding; in the reverse process, inputting the noise image, the time-step embedding, and the first fusion condition into the U network to obtain the first predicted mask.

[0038] While obtaining the first predicted mask, a first loss (also known as reconstruction loss) is calculated. This first loss measures the difference between the first predicted mask and the first known mask, and can be calculated using methods such as mean squared error (MSE), mean absolute error loss (also known as L1 loss), or structural similarity index measure loss (SSIM). A smaller first loss indicates that the first predicted mask is closer to the first known mask.

[0039] Subsequently, in some embodiments, the step 3 of performing photolithographic simulation on the first predictive mask to obtain the first predictive wafer image may include: performing photolithographic simulation on the first predictive mask using a frozen photolithography simulator to obtain the first predictive wafer image.

[0040] It should be noted that the lithography simulation can be a technique for simulating the lithography process, capable of predicting the image formed on the wafer after the first predictive mask has been exposed. In this embodiment, the frozen lithography simulator refers to a lithography simulation model that has been trained, has fixed parameters, and is no longer updated. It can be based on physical principles and optical propagation algorithms, capable of simulating the imaging process of the mask pattern on the wafer in the lithography process, generating a high-precision predicted wafer image. In implementation, the frozen lithography simulator can be built based on fast lithography simulation techniques (such as proximity effect correction (PEC) or simulation methods based on convolutional neural networks), enabling the frozen lithography simulator to maintain high physical accuracy while ensuring computational efficiency. Here, "frozen" means that the frozen lithography simulator is only used in the inference stage and does not participate in gradient backpropagation or parameter updates during the training process.

[0041] In this embodiment, obtaining the first predicted wafer image in step 3 may include the following process: First, the first predicted mask is simulated using the frozen lithography simulator to obtain the first predicted wafer image. Then, the first predicted wafer image is compared with the first target layout, and a second loss is calculated. Here, the second loss can also be called the simulation loss, which reflects the degree of difference between the first predicted wafer image and the first target layout in the lithographic imaging. The smaller the second loss, the closer the first predicted wafer image is to the first target layout. The second loss can be obtained by calculating the sum of squares of the morphological differences or edge placement errors (EPE) between the first predicted wafer image and the first target layout. In this embodiment, by introducing the second loss, the trained target mask generation model not only focuses on the shape of the first predicted mask itself, but also on the imaging effect of the first predicted mask in the actual lithography process. This helps to improve the physical consistency of the trained target mask generation model, making the target mask generation model more valuable.

[0042] In some embodiments, obtaining the joint loss based on the first loss and the second loss in step 4 may include: determining the product between the hyperparameter and the second loss; and determining the sum of the product and the first loss as the joint loss.

[0043] It should be noted that the hyperparameters can refer to parameters that can be manually set during model training to control the influence weights between different loss terms. In this embodiment, the hyperparameters are used to adjust the relative importance of the second loss in the joint loss. Based on this, the calculation of the joint loss can be expressed by the following formula (2).

[0044] (2).

[0045] in, For joint losses; This is the first loss; For hyperparameters; This is the second loss.

[0046] After calculating the joint loss, the parameters of the initial mask generation model are updated according to the calculated joint loss, thus completing the first round of training. Subsequently, for each sample data, steps 1 to 4 are repeated iteratively until the trained mask generation model converges or reaches a first preset number of iterations. The final trained mask generation model is then used as the target mask generation model. Iterative training is an indispensable part of the model training process. By continuously adjusting the model parameters, the model can gradually approach the optimal solution, improving the quality of the first predicted mask. When the model no longer significantly improves in several consecutive iterations, or reaches the preset maximum number of iterations (e.g., the first preset number of iterations), the training process ends, and the final target mask generation model can be used for practical applications. In actual implementation, the termination condition for iterative training can be flexibly set according to factors such as model performance, training time, and hardware resources. A reasonable training strategy helps to obtain the best model performance within a limited time.

[0047] In summary, the mask generation model training method provided in this application constructs a physically-aware deep learning model by introducing conditional injection of lithography physical parameters and simulation-driven training. This physically-aware deep learning model can effectively generate a high-precision first predicted mask pattern, thereby significantly improving the imaging quality in the lithography process and providing an efficient, flexible, and physically-aware solution for optical proximity effect correction.

[0048] In some embodiments, such as Figure 2 As shown, in step 102, before step 2, the steps include: obtaining at least one first reference mask from the mask reference library based on the first target layout; fusing the at least one first reference mask with the first fusion condition to form a second fusion condition; then step 2 is: inputting the first known mask and the second fusion condition into the initial mask generation model for prediction to obtain the first predicted mask.

[0049] It should be noted that the mask reference library can be a database storing a large number of historical target layouts, lithography physical parameters, and high-quality real masks. These high-quality real masks can be generated based on actual usage in previous lithography processes or regularized samples, reflecting optimal mask morphologies under different lithography conditions. The data in the mask reference data can be obtained through actual lithography tests or generated using the RB-OPC method. It can provide reliable mask layouts to assist in the generation of the current mask, thereby improving the physical rationality and stability of the generated results.

[0050] In this embodiment, the fusion of at least one first reference mask with the first fusion condition can refer to combining the first reference mask with the first fusion condition to generate a new fusion condition, denoted as the second fusion condition. In this case, step 2 can be described as inputting the first known mask and the second fusion condition into the initial mask generation model for prediction to obtain the first predicted mask. That is, when a second fusion condition exists that provides more guidance information than the first fusion condition, the second fusion condition is directly used as guidance information during model training to guide the model's training. This setup, by introducing a mask reference library and constructing the second fusion condition, and inputting the second fusion condition into the initial mask generation model for prediction, reduces the risk of the initial mask generation model generating an unreasonable mask, thereby improving the quality and consistency of the generated mask and significantly optimizing the overall performance of the lithography process.

[0051] In some embodiments, obtaining at least one first reference mask from the mask reference library based on the first target layout may include: encoding the first target layout to generate a query vector, or encoding the first target layout and the first lithographic physical parameters to generate the query vector; and selecting at least one first reference mask from the mask reference library that ranks highly in similarity to the first known mask based on the query vector.

[0052] In practical implementation, the first target layout is first encoded using the U-net encoder, or the first target layout and the first lithographic physical parameters are encoded to generate a query vector. Then, a K-nearest neighbor search is performed in the mask reference library, returning the top K stored masks with the highest similarity to the first known mask as at least one first reference mask, where K is greater than or equal to 1. It should be noted that in the reference mask library, if a mapping relationship exists between a reference mask and the target layout, the query vector formed by the encoding of the first target layout is used as an index to search for the first reference mask. If a mapping relationship exists between a reference mask, the target layout, and the lithographic physical parameters, the query vector formed by the encoding of the first target layout and the first lithographic physical parameters is used as an index to search for the first reference mask. In other words, there are two types of mapping relationships in the reference mask library: one that includes lithographic physical parameters and one that does not, and the choice of how to use them depends on the specific circumstances.

[0053] After obtaining at least one first reference mask, the at least one first reference mask is fused with a first fusion condition to form a second fusion condition. Based on this, step 2 above, which inputs the first known mask and the second fusion condition into the initial mask generation model for prediction to obtain the first predicted mask, may include: in the forward process, Gaussian noise is gradually added to the first known mask to obtain the noise image and the time step embedding; in the reverse process, the noise image, the time step embedding, and the second fusion condition are input into the U network to obtain the first predicted mask.

[0054] Based on the aforementioned training, a target mask generation model is obtained, such as... Figure 3 As shown, this application embodiment also provides a mask generation method that may include the following steps 301 to 305.

[0055] Step 301: Obtain the second target layout and the second lithography physical parameters corresponding to the second target layout, or obtain the second target layout, the second lithography physical parameters, and at least one second reference mask.

[0056] Step 302: Input the second target layout and the second photolithography physical parameters into the target mask generation model for prediction to obtain a second prediction mask corresponding to the second target layout; or, input the second target layout, the second photolithography physical parameters, and the at least one second reference mask into the target mask generation model for prediction to obtain the second prediction mask.

[0057] Step 303: Perform photolithography simulation on the second prediction mask to obtain the second prediction wafer image, and compare the second prediction wafer image with the second target layout.

[0058] Step 304: If the error between the second predicted wafer image and the second target layout is greater than or equal to a preset threshold in the first comparison result, a first hotspot map corresponding to the second target layout is obtained; the first hotspot map is used to reflect the degree of difference between the second predicted wafer image and the second target layout.

[0059] Step 305: Optimize the second prediction mask using the first heat map to obtain a target prediction mask corresponding to the second target layout.

[0060] It should be noted that steps 301 to 305 above can be the process of using the target mask generation model trained in steps 101 to 102 above to predict the newly obtained target layout and the corresponding photolithography physical parameters to obtain a predicted mask, and optimizing the predicted mask when the obtained predicted mask does not meet the imaging quality requirements.

[0061] The second target layout is the newly designed target layout used to generate the photomask. It can be drawn by integrated circuit designers and includes circuit layout information such as metal layers, vias, and device structures. The second target layout serves as one of the input conditions to guide the target mask generation model in generating a mask pattern that meets the actual process requirements. The second photolithography physical parameters refer to the process parameters affecting imaging quality during the wafer image generation process (i.e., the photolithography process) based on the second target layout. They have the same meaning as the aforementioned first photolithography physical parameters, but the values ​​of the parameters they contain can be the same or different.

[0062] In some embodiments, step 302 may include: first, embedding the second target layout and second lithographic physical parameters, or embedding the second target layout, second lithographic physical parameters, and a second reference mask into the aforementioned trained target mask generation model for prediction, through cross-attention or radial transformation, to obtain a second predicted mask; then, performing lithographic simulation on the second predicted mask using the aforementioned frozen lithography simulator to obtain a second predicted wafer image; then, comparing the second predicted wafer image with the second target layout, and when the first comparison result is that the error between the second predicted wafer image and the second target layout (such as the aforementioned morphological difference (also called pattern fidelity error) or maximum / average edge placement error) is greater than or equal to a preset threshold, obtaining a first hotspot map corresponding to the second target layout, wherein the hotspot map (hotspot A heatmap (or similar image) displays the differences, defects, and their severity between a lithographic simulation image (e.g., a second predicted wafer image) and an ideal target layout. Specifically, this heatmap can be an image with the same resolution as the target layout, where the value of each pixel reflects information such as whether there is an error, the type of error, and the magnitude of the error between that pixel and pixels at the same location in the target layout. This heatmap can be a binary defect map, a continuous value EPE map, or a multi-channel heatmap. The predicted wafer image (Wafer_i) is logically XORed with the target layout (T): I_h = T. The binary image obtained by `Wafer_i` (logical XOR) is the heatmap, where white areas mark the locations of defects due to graphic mismatch. The signed distance between the outline of the predicted wafer image and the outline of the target layout is calculated, generating a continuous distance transform map as the heatmap. The magnitude and sign of the pixel values ​​represent the severity and correction direction of the edge placement error, respectively. For multi-channel heatmaps, for example, the first channel (R) encodes defects such as thinning or breakage of lines (insufficient width), the second channel (G) encodes line bridging defects, and the third channel (B) encodes edge offset intensity. This format provides the richest information on defect types for the model. In this embodiment, the first heatmap reflects the degree of difference between each pixel of the second predicted wafer image and the second target layout. After obtaining the first heatmap, the second prediction mask can be optimized using the first heatmap to obtain a target prediction mask corresponding to the second target layout.

[0063] The specific optimization process, such as Figure 4 As shown, step 305 may include steps 401 to 405.

[0064] Step 401: Fuse the first heat map, the second target layout, and the second photolithography physical parameters to form a third fusion condition; or fuse the first heat map, the second target layout, the second photolithography physical parameters, and at least one second reference mask to form a third fusion condition.

[0065] Step 402: Input the third fusion condition into the target mask generation model for prediction to obtain the third prediction mask.

[0066] Step 403: Perform photolithography simulation on the third prediction mask to obtain the third prediction wafer image.

[0067] Step 404: Compare the third predicted wafer pattern with the second target layout.

[0068] Step 405: If the error between the third predicted wafer map and the second target layout is greater than or equal to the preset threshold in the second comparison result, a second hotspot map corresponding to the second target layout is obtained.

[0069] Step 406: Based on the second heat map, repeat the above optimization steps 401 to 405 step by step until the error between the obtained predicted wafer map and the second target layout is less than the preset threshold or the second maximum number of iterations is reached, and use the finally optimized prediction mask as the target prediction mask.

[0070] It should be noted that the above steps constitute a closed-loop optimization phase. Each optimization uses the latest second hotspot map, second target layout, second lithography physical parameters, and at least one second reference mask as new input conditions to generate a new mask, and then performs lithography simulation and comparison again. If the error between the predicted wafer image calculated after multiple consecutive optimizations and the second target layout is less than a set threshold, or if the preset second maximum number of iterations (e.g., a second set number of iterations) is reached, the optimization process stops, and the current optimal mask is output as the target predicted mask. This setup ensures continuous improvement of the mask design during the iterative optimization process, avoids local optima, and improves overall imaging quality. Furthermore, the number of iterations and the threshold can be dynamically adjusted according to different process requirements, enhancing the system's flexibility and adaptability.

[0071] In the embodiments of this application, by fusing the first heat map, the second target layout, the second lithography physical parameters, or at least one second reference mask into a unified input condition and driving the optimization process of the target mask generation model, the synergistic optimization of mask design and lithography process can be achieved, thereby improving the imaging fidelity and manufacturability of the mask, and further significantly reducing the defect rate and debugging cost in actual production.

[0072] In some embodiments, such as Figure 5 As shown, the mask generation model training method provided in this application embodiment further includes step 306: if the error between the second predicted wafer image and the second target layout is less than the preset threshold in the first comparison result, the second predicted mask is used as the target predicted mask.

[0073] In other words, if the first comparison result shows that the error between the second predicted wafer image and the second target layout is less than the preset threshold, then multiple optimizations are not required, and the second predicted mask is the target predicted mask that meets the requirements.

[0074] This application provides a mask generation model training method based on conditional denoising diffusion probability and lithographic simulation feedback. By introducing lithographic physical parameters, a first reference mask, and a closed-loop optimization mechanism, the physical interpretability and imaging quality of the generated target mask generation model are significantly improved. For understanding the technical solution of this application, please refer to... Figure 6 to Figure 8 . Figure 6 This is a schematic diagram illustrating the training principle of the mask generation model provided in the embodiments of this application. Figure 7 This is a schematic diagram illustrating the training process of your mask generation model provided in this application embodiment. Figure 8 This is a schematic diagram of the process of generating a high-quality mask using a trained target mask generation model, as provided in an embodiment of this application.

[0075] exist Figure 6The training principle can be roughly divided into two steps: First, acquiring sample data. This mainly includes data preparation, collecting historical OPC cases, high-fidelity simulation data, etc., to form an initial sample library. Each sample data can contain: a target layout T (a binary image), corresponding lithographic physical parameters P (e.g., NA=1.35, λ=193nm, σ=0.8), and a verified high-quality mask M_g (i.e., the aforementioned known mask). Feature encoding uses a pre-trained convolutional encoder network E to map the target layout T and the normalized lithographic physical parameters P together into a fixed-dimensional feature vector v=E(T, P). The feature vectors {v_i} of all sample data are stored in a vector database (e.g., FAISS). Optionally, online retrieval can also be used. When OPC is needed for a new query (T_new, P_new), the same encoder E is used to generate a query vector v_q. Then, a K-nearest neighbor search is performed in the vector database to return the Top-K most similar sample data. Extract the reference masks {M_r1, M_r2, ..., M_rK} corresponding to these K sample data, concatenate them along the channel dimension to form the retrieval context tensor M_r, which serves as an additional condition for the subsequent diffusion model (corresponding to...). Figure 2 The steps are shown below. The second step is model training, which mainly includes: forward and inverse processes. The forward process involves progressively adding Gaussian noise ε to the real mask M_g to obtain a noisy image x_t and a time-step embedding t. In the inverse process, the model (U-Net) aims to predict the added Gaussian noise ε, with inputs including the noisy image x_t, the time-step embedding t, and the fused condition Condition=fuse(I_c, P_norm, M_r), where fuse is the feature fusion layer. Joint loss calculation involves calculating the reconstruction loss and the simulation loss. The denoising result predicted by the model (from which the predicted mask M_pred can be derived) is input into a frozen, pre-trained lithography simulator S to obtain the predicted wafer image Wafer_i=S(M_pred). For example, the edge placement error between Wafer_i and the target layout T is calculated as the simulation loss L_per. The joint loss is: L_total=L_rec+λ. L_per updates the parameters θ of the initial mask generation model through backpropagation, and repeats the above steps to obtain the target mask generation model.

[0076] exist Figure 7The diagram illustrates the specific training process: a diffusion model is constructed based on the UNet network structure. Convolutional layers or multi-head self-attention layers can be used to embed the target layout and lithographic physical parameters P into each level of the U-Net network through cross-attention or affine transformation. A retrieval module based on lithographic rules is introduced, including feature extraction (HOG / FFT / CNN, etc.), similarity calculation, and result ranking. Clustering and other methods can be used for retrieval optimization. Top-K samples retrieved from the reference mask library are used as auxiliary control conditions for the generative model through cross-attention layers. This mask reference library can be expanded through methods such as target application scenario collection and rule-based OPC rule generation (corresponding to...). Figure 2 (The steps shown are as follows); then, the joint loss is calculated, the parameters of the mask generation model are updated, and the process is repeated iteratively to obtain the target mask generation model. Figure 7 In the context of querying reference masks, dashed lines indicate that the lithography physical parameters are optional. That is, you can query using the target layout and lithography physical parameters, or you can query using only the target layout. The specific choice depends on the actual situation.

[0077] exist Figure 8 Specifically, the closed-loop reasoning and optimization process can be as follows: Initial generation: For a new target layout and physical parameters P, or a new target layout, physical parameters P, and at least one retrieved reference mask M_r, a target mask generation model is used to predict and generate an initial mask, resulting in M_initial (e.g., the second predicted mask); Simulation judgment: M_initial is input into the simulator for lithography simulation and the imaging quality is evaluated. If the threshold is met (e.g., a preset known threshold), it is directly output; Iterative feedback optimization: If the threshold is not met, the obtained heat map I_h, the target layout, lithography physical parameters P, or at least one reference mask are used as conditions to input the diffusion model again to obtain the optimized Mask; Loop iteration: The steps are repeated until the simulation verification is passed or the maximum number of iterations is reached, and the final result is output.

[0078] See Figure 9As shown, this application embodiment also provides a training device 900 for a mask generation model, which may include: a first data acquisition module 901 and a model training module 902, wherein the first data acquisition module 901 can be used to: acquire multiple sample data, wherein each sample data includes a first target layout, a first lithographic physical parameter corresponding to the first target layout, and a first known mask corresponding to the first target layout; and the model training module 902 can be used to: perform iterative training using the multiple sample data and a pre-constructed initial mask generation model to obtain a target mask generation model; wherein the training steps include: step 1, fusing the first target layout and the first lithographic physical parameter corresponding to a certain sample data to form First fusion condition; Step 2, input the first known mask and the first fusion condition into the initial mask generation model for prediction to obtain a first predicted mask corresponding to the first target layout, and calculate a first loss; Step 3, perform photolithography simulation on the first predicted mask to obtain a first predicted wafer image, and obtain a second loss based on the first target layout and the first predicted wafer image; Step 4, obtain a joint loss based on the first loss and the second loss, and use the joint loss to update the parameters of the initial mask generation model; Repeat steps 1 to 4 above for iterative training until the trained mask generation model converges or reaches a first preset number of iterations, and use the finally trained mask generation model as the target mask generation model.

[0079] In some embodiments, the first data acquisition module 901 can also be used to: obtain at least one first reference mask from the mask reference library according to the first target layout; the model training module 902 can also be used to: fuse the at least one first reference mask with the first fusion condition to form a second fusion condition; input the first known mask and the second fusion condition into the initial mask generation model for prediction to obtain the first predicted mask.

[0080] In some embodiments, the first data acquisition module 901 may also be used to: encode the first target map to generate a query vector; and select at least one first reference mask from the mask reference library that ranks highly in similarity to the first known mask based on the query vector.

[0081] In some embodiments, the initial mask generation model adopts a denoising diffusion probability model framework, with a U-network as the main denoising network, including a forward process and a reverse process; the model training module 902 can also be used to: in the forward process, progressively add Gaussian noise to the first known mask to obtain a noisy image and a time-step embedding; in the reverse process, input the noisy image, the time-step embedding, and the first fusion condition into the U-network to obtain the first predicted mask; or, in the forward process, progressively add Gaussian noise to the first known mask to obtain the noisy image and the time-step embedding; in the reverse process, input the noisy image, the time-step embedding, and the second fusion condition into the U-network to obtain the first predicted mask.

[0082] In some embodiments, the first lithography physical parameters include at least one of numerical aperture, exposure wavelength, illumination mode, and coherence factor; the first data acquisition module 901 can also be used to: normalize the first lithography physical parameters contained in each sample data and enhance the first target layout contained in each sample data before iteratively training the multiple sample data and the pre-built initial mask generation model to obtain the target mask generation model, wherein the enhancement processing includes at least one of cropping, scaling, rotating and flipping, and extracting edge information of the first target layout.

[0083] In some embodiments, the model training module 902 can also be used to: obtain a second target layout and second lithography physical parameters corresponding to the second target layout; input the second target layout and the second lithography physical parameters into the target mask generation model for prediction to obtain a second prediction mask corresponding to the second target layout, and perform lithography simulation on the second prediction mask to obtain a second prediction wafer image; compare the second prediction wafer image with the second target layout; if the first comparison result is that the error between the second prediction wafer image and the second target layout is greater than or equal to a preset threshold, obtain a first hotspot map corresponding to the second target layout; the first hotspot map is used to reflect the degree of difference between the second prediction wafer image and the second target layout; optimize the second prediction mask using the first hotspot map to obtain a target prediction mask corresponding to the second target layout.

[0084] In some embodiments, the model training module 902 can also be used to: fuse the first heat map, the second target layout, and the second lithography physical parameters to form a third fusion condition; input the third fusion condition into the target mask generation model for prediction to obtain a third prediction mask; perform lithography simulation on the third prediction mask to obtain a third prediction wafer image; compare the third prediction wafer image with the second target layout; if the second comparison result is that the error between the third prediction wafer image and the second target layout is greater than or equal to the preset threshold, obtain a second heat map corresponding to the second target layout; based on the second heat map, gradually repeat the above optimization steps until the error between the obtained prediction wafer image and the second target layout is less than the preset threshold or the second maximum number of iterations is reached, and use the finally optimized prediction mask as the target prediction mask.

[0085] In some embodiments, the model training module 902 can also be used to: use the second prediction mask as the target prediction mask when the first comparison result shows that the error between the second predicted wafer image and the second target layout is less than the preset threshold.

[0086] In some embodiments, the model training module 902 can also be used to: perform photolithography simulation on the first prediction mask using a frozen photolithography simulator to obtain the first prediction wafer image.

[0087] In some embodiments, the model training module 902 can also be used to: determine the product between the hyperparameters and the second loss; and determine the sum of the product and the first loss as the joint loss.

[0088] It should be noted that the training device for the mask generation model provided in this application embodiment is used to implement the aforementioned mask generation model training method. The technical features it contains are the same as those in the mask generation model training method. Each technical feature has been described in detail above and can be referred to the previous description, so it will not be repeated here.

[0089] like Figure 10As shown in the illustration, this application embodiment also provides a photomask generation apparatus 1000, including: a second data acquisition module 1001 and a mask generation module 1002, wherein the second data acquisition module 1001 is used to: acquire a second target layout and second photolithographic physical parameters corresponding to the second target layout, or acquire the second target layout, the second photolithographic physical parameters, and at least one second reference mask; and the mask generation module 1002 is used to: input the second target layout and the second photolithographic physical parameters into the target mask generation model as described above for prediction, to obtain a second predicted mask corresponding to the second target layout, or ..., to obtain a second predicted mask corresponding to the second target layout, or input the second target layout and The physical parameters and at least one second reference mask are input into the target mask generation model for prediction to obtain the second predicted mask; photolithography simulation is performed on the second predicted mask to obtain a second predicted wafer image, and the second predicted wafer image is compared with the second target layout; if the error between the second predicted wafer image and the second target layout is greater than or equal to a preset threshold in the first comparison result, a first hotspot map corresponding to the second target layout is obtained; the first hotspot map is used to reflect the degree of difference between the second predicted wafer image and the second target layout; the second predicted mask is optimized using the first hotspot map to obtain a target predicted mask corresponding to the second target layout.

[0090] In some embodiments, the mask generation module 1002 is further configured to: fuse the first heat map, the second target layout, and the second lithography physical parameters to form a third fusion condition, or fuse the first heat map, the second target layout, the second lithography physical parameters, and at least one second reference mask to form a third fusion condition; input the third fusion condition into the target mask generation model for prediction to obtain a third predicted mask; perform lithography simulation on the third predicted mask to obtain a third predicted wafer image; compare the third predicted wafer image with the second target layout; if the second comparison result is that the error between the third predicted wafer image and the second target layout is greater than or equal to the preset threshold, obtain a second heat map corresponding to the second target layout; repeat the above optimization steps step by step based on the second heat map until the error between the obtained predicted wafer image and the second target layout is less than the preset threshold or the second maximum number of iterations is reached, and use the finally optimized predicted mask as the target predicted mask.

[0091] In some embodiments, the mask generation module 1002 is further configured to: use the second prediction mask as the target prediction mask if the first comparison result shows that the error between the second predicted wafer image and the second target layout is less than the preset threshold.

[0092] It should be noted that the photomask generation apparatus provided in this application embodiment is used to implement the aforementioned mask generation method. It contains the same technical features as the mask generation method. Each technical feature has been described in detail above and can be referred to the previous description. It will not be repeated here.

[0093] like Figure 11 As shown in the illustration, this application embodiment also provides a training device 1100 for a mask generation model, which may include: a first memory 1101 for storing computer-executable instructions or computer programs; and a first processor 1102 for executing the computer-executable instructions or computer programs stored in the first memory 1101 to implement the training method provided in this application embodiment. The first processor 1102 may be, but is not limited to, a central processing unit (CPU). The first memory 1101 may be a read-only memory (ROM), random access memory (RAM), flash memory, etc.

[0094] like Figure 12 As shown in the illustration, this application embodiment also provides a photomask generation apparatus 1200, which may include: a second memory 1201 for storing computer-executable instructions or computer programs; and a second processor 1202 for executing the computer-executable instructions or computer programs stored in the second memory 1201 to implement the generation method provided in this application embodiment. The second processor 1202 may be, but is not limited to, a central processing unit (CPU). The second memory 1201 may be a read-only memory (ROM), random access memory (RAM), flash memory, etc.

[0095] In some embodiments, this application also provides a computer-readable storage medium storing a computer program or computer-executable instructions thereon, which, when executed by a processor, implements the training method or the generation method provided in this application.

[0096] It should be noted that the descriptions of the storage media, apparatus, and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage media, apparatus, and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0097] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A method for training a mask generation model, characterized in that, The method includes: Acquire multiple sample data, wherein each sample data includes a first target layout, a first photolithography physical parameter corresponding to the first target layout, and a first known mask corresponding to the first target layout; The target mask generation model is obtained by iteratively training using the multiple sample data and a pre-built initial mask generation model; wherein the training steps include: Step 1: Fuse the first target layout and the first photolithography physical parameters corresponding to a certain sample data to form the first fusion condition; Step 2: Input the first known mask and the first fusion condition into the initial mask generation model for prediction to obtain the first predicted mask corresponding to the first target layout, and calculate the first loss; Step 3: Perform photolithography simulation on the first prediction mask to obtain the first prediction wafer image, and obtain the second loss based on the first target layout and the first prediction wafer image; Step 4: Obtain the joint loss based on the first loss and the second loss, and update the parameters of the initial mask generation model using the joint loss; Repeat steps 1 to 4 above for iterative training until the trained mask generation model converges or reaches the first preset number of iterations. The final trained mask generation model is then used as the target mask generation model.

2. The training method according to claim 1, characterized in that, Before step 2, the method further includes: obtaining at least one first reference mask from a mask reference library based on the first target layout; and fusing the at least one first reference mask with the first fusion condition to form a second fusion condition. Then step 2 is: inputting the first known mask and the second fusion condition into the initial mask generation model for prediction to obtain the first predicted mask.

3. The training method according to claim 2, characterized in that, Obtaining at least one first reference mask from the mask reference library based on the first target layout includes: The first target layout is encoded to generate a query vector, or the first target layout and the first lithographic physical parameters are encoded to generate the query vector; Based on the query vector, at least one first reference mask that ranks highly in similarity to the first known mask is selected from the mask reference library.

4. The training method according to claim 2, characterized in that, The initial mask generation model adopts a denoising diffusion probability model framework, with a U-network as the main denoising network, and includes a forward process and a reverse process. The step of inputting the first known mask and the first fusion condition into the initial mask generation model for prediction to obtain a first predicted mask corresponding to the first target map includes: in the forward process, progressively adding Gaussian noise to the first known mask to obtain a noisy image and a time-step embedding; in the reverse process, inputting the noisy image, the time-step embedding, and the first fusion condition into the U-network to obtain the first predicted mask. Alternatively, the first known mask and the second fusion condition are input into the initial mask generation model for prediction to obtain the first predicted mask, including: in the forward process, Gaussian noise is gradually added to the first known mask to obtain the noise image and the time step embedding; in the reverse process, the noise image, the time step embedding, and the second fusion condition are input into the U network to obtain the first predicted mask.

5. The training method according to claim 2, characterized in that, The first photolithography physical parameters include at least one of numerical aperture, exposure wavelength, illumination mode, and coherence factor; the method further includes: Before obtaining the target mask generation model through iterative training using the multiple sample data and the pre-built initial mask generation model, the first lithographic physical parameters contained in each sample data are normalized and the first target layout contained in each sample data is enhanced. The enhancement process includes at least one of cropping, scaling, rotating and flipping, and extracting edge information from the first target layout.

6. The training method according to claim 1, characterized in that, The step of performing photolithography simulation on the first prediction mask to obtain the first prediction wafer image includes: performing photolithography simulation on the first prediction mask using a freeze photolithography simulator to obtain the first prediction wafer image.

7. The training method according to claim 1, characterized in that, The step of obtaining the joint loss based on the first loss and the second loss includes: determining the product between the hyperparameter and the second loss; and determining the sum of the product and the first loss as the joint loss.

8. A mask generation method, characterized in that, The method includes: Obtain a second target layout and the second lithography physical parameters corresponding to the second target layout, or obtain the second target layout, the second lithography physical parameters, and at least one second reference mask; The second target layout and the second lithographic physical parameters are input into the target mask generation model as described in any one of claims 1 to 5 for prediction to obtain a second predicted mask corresponding to the second target layout; or, the second target layout, the second lithographic physical parameters, and the at least one second reference mask are input into the target mask generation model for prediction to obtain the second predicted mask. Photolithography simulation is performed on the second prediction mask to obtain a second prediction wafer image, and the second prediction wafer image is compared with the second target layout. If the error between the second predicted wafer image and the second target layout is greater than or equal to a preset threshold in the first comparison result, a first hotspot map corresponding to the second target layout is obtained; the first hotspot map is used to reflect the degree of difference between the second predicted wafer image and the second target layout; The second prediction mask is optimized using the first heatmap to obtain a target prediction mask corresponding to the second target layout.

9. The generation method according to claim 8, characterized in that, The step of optimizing the second prediction mask using the first heatmap to obtain a target prediction mask corresponding to the second target map includes: The first heat map, the second target layout, and the second photolithography physical parameters are fused to form a third fusion condition; or the first heat map, the second target layout, the second photolithography physical parameters, and at least one second reference mask are fused to form a third fusion condition. The third fusion condition is input into the target mask generation model for prediction to obtain the third predicted mask; The third prediction mask is subjected to photolithography simulation to obtain the third prediction wafer image; Compare the third predicted wafer pattern with the second target layout; If the error between the third predicted wafer map and the second target layout is greater than or equal to the preset threshold in the second comparison result, a second hotspot map corresponding to the second target layout is obtained. Based on the second heat map, the above optimization steps are repeated step by step until the error between the obtained predicted wafer map and the second target layout is less than the preset threshold or the second maximum number of iterations is reached. The final optimized predicted mask is then used as the target predicted mask.

10. The generation method according to claim 8, characterized in that, The method further includes: If the error between the second predicted wafer image and the second target layout is less than the preset threshold in the first comparison result, the second predicted mask is used as the target predicted mask.

11. A training device for a mask generation model, characterized in that, The training device includes: The first data acquisition module is used to acquire multiple sample data, wherein each sample data includes a first target layout, a first photolithography physical parameter corresponding to the first target layout, and a first known mask corresponding to the first target layout; The system includes a model training module for iteratively training a target mask generation model using the multiple sample data and a pre-built initial mask generation model. The training steps include: Step 1, fusing the first target layout and the first lithographic physical parameters corresponding to a sample data to form a first fusion condition; Step 2, inputting the first known mask and the first fusion condition into the initial mask generation model for prediction to obtain a first predicted mask corresponding to the first target layout, and calculating a first loss; Step 3, performing lithographic simulation on the first predicted mask to obtain a first predicted wafer image, and obtaining a second loss based on the first target layout and the first predicted wafer image; Step 4, obtaining a joint loss based on the first loss and the second loss, and updating the parameters of the initial mask generation model using the joint loss; repeating steps 1 to 4 for iterative training until the trained mask generation model converges or reaches a first preset number of iterations, and using the finally trained mask generation model as the target mask generation model.

12. An apparatus for generating a photolithographic mask, characterized in that, The generating apparatus includes: The second data acquisition module is used to: acquire a second target layout and second lithographic physical parameters corresponding to the second target layout, or acquire the second target layout, the second lithographic physical parameters and at least one second reference mask; The system also includes a mask generation module, configured to: input the second target layout and the second lithographic physical parameters into the target mask generation model as described in any one of claims 1 to 5 for prediction, to obtain a second predicted mask corresponding to the second target layout; or input the second target layout, the second lithographic physical parameters, and the at least one second reference mask into the target mask generation model for prediction, to obtain the second predicted mask; perform lithographic simulation on the second predicted mask to obtain a second predicted wafer image, and compare the second predicted wafer image with the second target layout; if the first comparison result is that the error between the second predicted wafer image and the second target layout is greater than or equal to a preset threshold, obtain a first hotspot map corresponding to the second target layout; the first hotspot map is used to reflect the degree of difference between the second predicted wafer image and the second target layout; and optimize the second predicted mask using the first hotspot map to obtain a target predicted mask corresponding to the second target layout.

13. A training device for a mask generation model, characterized in that, The model training device includes: The first memory is used to store computer-executable instructions or computer programs; The first processor, when executing computer-executable instructions or computer programs stored in the memory, implements the training method according to any one of claims 1 to 7.

14. An apparatus for generating a photolithographic mask, characterized in that, The generating device includes: Secondary memory is used to store computer-executable instructions or computer programs; The second processor, when executing computer-executable instructions or computer programs stored in the memory, implements the mask generation method according to any one of claims 8 to 10.

15. A computer-readable storage medium, characterized in that, It stores computer-executable instructions or computer programs for implementing the training method of any one of claims 1 to 7 or the generation method of any one of claims 8 to 10 when executed by a processor.