@@ -122,21 +122,11 @@ As ordering of verilog modules in single or across multiple files is not preknow
1221221 . Parse modules, ports and parameters. Ignore instances and connectivity. Construct all interfaces.
1231232 . Reparse. Ignore ports and parameters. Parse instances and nets. Construct connectivity.
124124
125- ### Preprocessing output
126-
127- You can generate preprocessed Verilog text (similar to ` gcc -E ` ) through ` VerilogConstructor ` :
128-
129- ``` c++
130- VerilogConstructor constructor;
131- // Write to a file.
132- constructor.preprocessToPath(" input.v" , " output.pre.v" );
133- // Or get the text directly.
134- std::string preprocessed = constructor.preprocessToString(" input.v" );
135- ```
125+ ### Preprocessing
136126
137127The parser pipeline now runs a lightweight preprocessor that supports the following directives:
138- ` define, ` undef, ` ifdef, ` ifndef, ` elsif, ` else, ` endif, ` include, and `timescale
139- (note: `timescale is consumed but not emitted to keep the parser output compatible).
128+ ` define ` , ` undef ` , ` ifdef ` , ` ifndef ` , ` elsif ` , ` else ` , ` endif ` , ` include ` , and ` timescale `
129+ (note: ` timescale ` is consumed but not emitted to keep the parser output compatible).
140130
141131Preprocessing is disabled by default. Enable it when needed, or disable it to compare performance:
142132
@@ -150,6 +140,18 @@ constructor.setPreprocessEnabled(false);
150140constructor.parse(" input.v" );
151141```
152142
143+ #### Preprocessing output
144+
145+ You can generate preprocessed Verilog text (similar to ` gcc -E ` ) through ` VerilogConstructor ` :
146+
147+ ``` c++
148+ VerilogConstructor constructor;
149+ // Write to a file.
150+ constructor.preprocessToPath(" input.v" , " output.pre.v" );
151+ // Or get the text directly.
152+ std::string preprocessed = constructor.preprocessToString(" input.v" );
153+ ```
154+
153155<div align =" right " >[ <a href =" #naja-verilog " >↑ Back to top ↑</a > ]</div >
154156
155157## Callbacks
0 commit comments