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.

[verilog] how can I include different file in a same module

Status
Not open for further replies.

blacksmith_vlsi

Newbie level 6
Joined
Nov 29, 2006
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,346
HI ALL,

here are some simplified code of my question:
/////////
module test();
...
`include "xxx.v"
...
endmodule

module top();
...
test t0();
test t1();
test t2();
...
endmodule
/////////

what i wanna ask is that can we include different files in instant t0,t1,t2 ?
if yes, how should we set those file names as parameter of define?

THANKS IN ADVANCE~!
 

Re: [verilog] how can I include different file in a same mod

Using Pure verilog you cant do this because pure verilog has very poor
preprocessing capability. You can search net for verilog preprocessors if
you want to do this! OR you need to use macro language m4 to do this!
This will add one more step to ur verilog flow viz code generation!
Hope this helps!
 

Re: [verilog] how can I include different file in a same mod

hi
can u briefly explain abt these macro language m4 ...iam really hearing this for the first time
 

Re: [verilog] how can I include different file in a same mod

In Verilog a module has to be uniquely defined. What exactly differs across your t0,t1,t2? Can you elaborate?

One practical approach is to use parameters inside module test and override them for different instanes.

Code:
module test();
  parameter P1 = 4;
  initial $display ("Param is %d", P1);
endmodule

module top;
  test t0; // Param is 4
  test #(10) t1; // Param is 10
  test #(100) t2; // Param is 100
endmodule

HTH
Ajeetha, CVC
www.noveldv.com
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top