Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Problem with `include in verilog

Status
Not open for further replies.

kjm

Junior Member level 1
Joined
May 22, 2012
Messages
16
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,283
Location
India
Activity points
1,389
Hi,
I am trying to include "tasks.v" file in my testbench file "tb_data.v" . after reg,wire and parameter declarations, I have include this file ('include "tasks.v"). But it is giving error (expecting the keyword 'module', 'macromodule' or 'primitive'[A.1].).

the tasks.v file looks like this:
task prep_req;
begin
request <= 1'b1;
@(posedge i_SymbolClk)
request <= 1'b0;
end

endtask // prep_req

There are other similar tasks like this in "tasks.v" file. Both the files (testbench + tasks) are in same folder. Please help.
Thanks
 

Maybe, you need include this task between the module / endmodule (not outside of it).
module a ();

input
output
wire
reg

`include "task.v"

endmodule

And when you compile your RTL codes, you can't include task.v in the file list (the compile tool will merge it into "module a" automatic).
 
  • Like
Reactions: kjm

    kjm

    Points: 2
    Helpful Answer Positive Rating
Maybe, you need include this task between the module / endmodule (not outside of it).
module a ();

input
output
wire
reg

`include "task.v"

endmodule

And when you compile your RTL codes, you can't include task.v in the file list (the compile tool will merge it into "module a" automatic).


I included the task between module/endmodule. But I was including it in the file list during compilation. That's why I was getting error...
SOLVED.

Thanks a lot
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top