Because of the deficiencies in Verilog or the tools, I often have to write Perl to generate Verilog. Examples of these deficiencies include:
- Port list is not parameterizable without use of `defines
- Many synthesizers don't understand preprocessing constant functions
- Generate function in Verilog has limitations
Rather than write Perl to generate Verilog modules, which is a cumbersome flow, it would be nice to have a Perl preprocessor. What I am thinking of is something that would look through your HDL, find formatted comments, parse parameters and `ifdefs, and then execute Perl and insert the results there. It would see something like this: . . . parameter NUM_UNITS=2; `define PARAM2 2 // Perl Start // for ($j=0;$j