liletian
Community Member
Offline
Posts: 97
MD
|
Hi all
I wrote the following code (comparator.v and test_module.v), test_module is fairly simple. It just try to include comparator.v.
However, when I try to compile the test_module.v, it reports the following errors. Can anyone help on the issue? Basically I am trying to include sub module using command "include", but I seems to have trouble on it.
Thank you very much.
ncverilog(64): 15.20-s022: (c) Copyright 1995-2017 Cadence Design Systems, Inc. file: test_module.v module comparator(stag,ptag,tag_equal); | ncvlog: *E,EXPENM (comparator.v,1|5): expecting the keyword 'endmodule' [12.1(IEEE)]. (`include file: comparator.v line 1, file: test_module.v line 2) module worklib.test_module:v errors: 1, warnings: 0 endmodule // test_module | ncvlog: *E,EXPMPA (test_module.v,3|8): expecting the keyword 'module', 'macromodule' or 'primitive'[A.1]. Total errors/warnings found outside modules and primitives: errors: 1, warnings: 0 ncverilog: *E,VLGERR: An error occurred during parsing. Review the log file for errors with the code *E and fix those identified problems to proceed. Exiting with code (status 1).
test_module.v
module test_module(); `include "comparator.v" endmodule // test_module
comparator.v
module comparator(stag,ptag,tag_equal); parameter n=16; input [n-1:0] stag,ptag; output tag_equal;
reg tag_equal; integer i;
// initial begin // tag_equal<=1'b1; // end always @(stag or ptag) tag_equal=!(stag^ptag);
endmodule
|