To protect all modules in the specified source file automatically, you can use the xmprotect -autoprotect command (which you can use for Verilog-AMS, Verilog [digital], VHDL-AMS, and VHDL [digital] code and Verilog-A code but not for Spectre code). This option is particularly useful for protecting libraries that contain a large number of files with many modules.
You do not need to insert the protect begin and protect end protection pragmas in any source description that you plan to compile with -autoprotect. If these pragmas already exist in your source file, the xmprotect -autoprotect command ignores them.
