0

I'm trying to include a Verilog file (alu.v) in my main file (cpu.v). Both files are in the same directory.

'include "alu.v"

 module cpu();
 ...
 ...
 endmodule

When I try to compile it, I get the following error.

cpu.v:1 syntax error
I give up

I don't see how the include statement is wrong. I'm sure my syntax is correct like shown here.

1 Answer 1

4

Don't be so sure! Proof you mess with something, it does not work.

The preprocessor directives in Verilog begin with a back-tick (`) not an apostrophe (').

Try:

`include "alu.v"

Instead of:

'include "alu.v"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.