How the compiler divides compilation units


I have some doubts about how to define a compilation unit. Is it an sv file or a package or something else?


In reply to jianfeng.he:

The lrm section 3.12.1 has the following information:

compilation unit: A collection of one or more SystemVerilog source files compiled together. The exact mechanism for defining which files constitute a compilation unit is tool-specific. However, compliant tools shall provide use models that allow both of the following cases:
a) All files on a given compilation command line make a single compilation unit (in which case the declarations within those files are accessible following normal visibility rules throughout the entire set of files).
b) Each file is a separate compilation unit (in which case the declarations in each compilation-unit scope are accessible only within its corresponding file).