I have implemented a Verilog code that normally works at high clock speed. My design consists of multiple modules, separated in multiple files. For simulation purposes I need to lower the clock a bit, so I am using the compiler directive
- Code: Select all
`define
- Code: Select all
`define DEBUG
- Code: Select all
`ifdef DEBUG
// some code
`else
// some code
`endif
The code works fine so far, but I have to go through many files and to change DEBUG / NO_DEBUG every time when I need to simulate.
My question is: Is it possible to declare the `define directive only in the top level module and then to access it from some inner modules? I have tried this, but unsuccessfully. And one more thing: I know that Verilog can read the <include ...> statement. Can you give me some example of using <include ...>. Is it suitable for synthesis? Preferably, I am using Verilog 2001 and 2005.
Thank you
Yassen