syedshan
Advanced Member level 1
- Joined
- Feb 27, 2012
- Messages
- 463
- Helped
- 27
- Reputation
- 54
- Reaction score
- 26
- Trophy points
- 1,308
- Location
- Jeonju, South Korea
- Activity points
- 5,134
Hello all
I am including a file into verilog code.
I am using Xilinx ISE .The rtl code is just fine after I add the include path in synthesis option and did the following...
then my top level module is following
^^^^^^^^^^^^^^^^
using <include file>.<module> it completely works fine.
But the same thing when simulating, posts an error...
Although still in the test bench I am adding the include file path to the option as well `include "icnd.v" as well in beginning of simulation file
The error is as follows
:HDLCompiler:687 - "icnd.v" Line 3: Illegal redeclaration of module <icnd>.
Kindly help me how to simulate this type of code ( in which the file is included externally, though RTL is working fine)
I am including a file into verilog code.
I am using Xilinx ISE .The rtl code is just fine after I add the include path in synthesis option and did the following...
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 module icnd(); parameter zero = 0; parameter one = 1'b1; task increament; input clk,rst; output [3:0] count; begin if(rst) count <= zero; else count <= count + one; end endtask endmodule
then my top level module is following
^^^^^^^^^^^^^^^^
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 include "icnd.v" module count( input clk,rst output reg [3:0] count ); always@(posedge clk) begin icnd.increament(clk,rst,count); end endmodule
using <include file>.<module> it completely works fine.
But the same thing when simulating, posts an error...
Although still in the test bench I am adding the include file path to the option as well `include "icnd.v" as well in beginning of simulation file
The error is as follows
:HDLCompiler:687 - "icnd.v" Line 3: Illegal redeclaration of module <icnd>.
Kindly help me how to simulate this type of code ( in which the file is included externally, though RTL is working fine)
Last edited by a moderator: