My work invovles browsing through long verilog codes which incorporates `ifdef blocks. My primary editor is emacs. Following is a typical example:
module Foo(
...
...
);
// Inputs, Outputs
...
`ifdef CONDITION_1
...
...
`else // CONDITION_1
...
...
`ifdef CONDITION_2
...
...
`endif //CONDITION_2
...
...
foo <= 1'b1;
...
...
`endif // CONDITION_1
As you can see foo <= 1'b1;
is in the else block of ifdef CONDITION_1 Assuming that my point is on the line foo <= 1'b1;
is there any way by which I could directly move to the line ifdef CONDITION_1 or fold the code so that I can see CONDITION1? I tried using backward incremental search but in that case I end up at ifdef CONDITION_2
i tried using the hide-ifdef-mode but it identifies #ifdef instead of `ifdef. These blocks do not use parenthesis. And so using C-M-u doesn't help