reading a book`include Compiler Directive


Directs the compiler to compile the contents of a text file as if they had been inserted directly in the source code at the same place as the `include directive.

Syntax ( Key to Notation )

`include "FileName"

Where

Anywhere. The file contents must make sense when included.

Rules

Tips

Put shared parameter or `define declarations in a separate file, and include wherever they are required.

Example

module FSM (Clock, Reset,...);
  input Clock, Reset...;

  `include "definitions.v"  // Parameters ResetState
                            // StartState etc.

  reg [3:0] State;

  always @(posedge Clock)
    if (!Reset)
      State <= ResetState;
    else
      case (State)
        ResetState : ...;
        StartState : ...;
        ...
      endcase

endmodule

See Also

`define


reference cardVerilog Quick Reference
teaching pointerDoulos Training Courses
reading a bookBack to the Verilog Golden Reference Guide


riverDoulos Home Page

Copyright 1995-1997 Doulos
This page was last updated 16th June 1996

mail iconWe welcome your e-mail comments. Please contact us at: webmaster@doulos.co.uk