mirror of
https://github.com/verilator/verilator.git
synced 2025-04-16 01:26:54 +00:00
Add VERILATOR_TIMING define (#3684)
This commit is contained in:
parent
5c65e0cfa1
commit
22ce36012e
@ -151,6 +151,13 @@ or "`ifdef`"'s may break other tools.
|
||||
Take remaining text up to the next :option:`\`verilog` mode switch and
|
||||
treat it as Verilator configuration commands. See :ref:`Configuration Files`.
|
||||
|
||||
.. option:: `VERILATOR_TIMING
|
||||
|
||||
The VERILATOR_TIMING define is set when :vlopt:`--timing` is used to
|
||||
allow an "\`ifdef" of code dependent on this feature. Note this define
|
||||
is not affected by the :option:`timing_off` configuration file option
|
||||
nor timing metacomments.
|
||||
|
||||
.. option:: `verilog
|
||||
|
||||
Switch back to processing Verilog code after a
|
||||
|
@ -833,6 +833,9 @@ void V3Options::notify() {
|
||||
if (!m_dumpLevel.count("tree") && m_dumpLevel.count("tree-dot")) {
|
||||
m_dumpLevel["tree"] = m_dumpLevel["tree-dot"];
|
||||
}
|
||||
|
||||
// Preprocessor defines based on options used
|
||||
if (timing().isSetTrue()) V3PreShell::defineCmdLine("VERILATOR_TIMING", "1");
|
||||
}
|
||||
|
||||
//######################################################################
|
||||
|
@ -26,3 +26,7 @@ module t;
|
||||
initial #1 ->e;
|
||||
initial #2 $stop; // timeout
|
||||
endmodule
|
||||
|
||||
`ifdef VERILATOR_TIMING
|
||||
`error "VERILATOR_TIMING should not be defined with --no-timing"
|
||||
`endif
|
||||
|
@ -30,3 +30,7 @@ module t;
|
||||
|
||||
initial #21 $stop; // timeout
|
||||
endmodule
|
||||
|
||||
`ifndef VERILATOR_TIMING
|
||||
`error "VERILATOR_TIMING should have been defined as have --timing"
|
||||
`endif
|
||||
|
Loading…
Reference in New Issue
Block a user