Difference between import and `include - muneeb-mbytes/computerArchitectureCourse GitHub Wiki

`include:

  • Includes all the mentioned files.

  • When you `include a file, it is basically saying that take the contents of that file and paste it at the location of the include statement.

    Syntax: `include "file.name"

import:

  • Adding pre-defined compiled files hence no need of compiling.

  • It tells the compiler to go and search the file that is already compiled and get information from that.

  • Doesn't copy but rather makes the existing package declarations visible in the current file.

    Syntax: import pkg::*;