veripool / verilog-mode

Verilog-Mode for Emacs with Indentation, Hightlighting and AUTOs. Master repository for pushing to GNU, verilog.com and veripool.org.
http://veripool.org/verilog-mode
GNU General Public License v3.0
247 stars 90 forks source link

AUTOINSTPARAM not printing parameters for all modules #1763

Closed juanyo810 closed 2 years ago

juanyo810 commented 2 years ago

Hi Wilson,

I am using verilog AUTOs at my current job and I am having some issues with AUTOINSTPARAM not printing the module's parameters for some modules, and for others, it does print the parameters. It is very strange. Something like this:

/* ReverseBits AUTO_TEMPLATE (
            .DATA_SIZE(32),
            .data_in   (data_in[]),
            .data_out  (data_revbit_mode64[]),
    );

   */
   ReverseBits  #(/*AUTOINSTPARAM*/
                  // Parameters
                  .DATA_SIZE            (32))                    // Templated
        reverseBitMode64 (/*AUTOINST*/
                          // Outputs
                          .data_out             (data_revbit_mode64[31:0]), // Templated
                          // Inputs
                          .data_in              (data_in[31:0])); // Templated

   // =-=-=-=-=-=-=-=-=-=-=- Reverse Byte 16-bit halfwords (REV16) - BOTH MODES =-=-=-=-=-=-=-=-=-
   /* ReverseBits AUTO_TEMPLATE (
            .DATA_SIZE(80),
            .data_in   (data_in[]),
            .data_out  (data_revbit_mode64[]),
    );

   */
   ReverseBytes  #(/*AUTOINSTPARAM*/)
        reverseBitModeTest (/*AUTOINST*/
                            // Outputs
                            .data_out           (data_revbit_mode32[63:0]), // Templated
                            // Inputs
                            .data_in            (data_in[31:0]), // Templated
                            .sf_mode            (sf_mode));

Every time I run AUTOs, the module ReverseBits is correctly expanded, but ReverseBytes is not. The files are almost identical, the only difference is the extra parameter. I tried removing one of the parameters, and the issue persists. I also added another parameter to "ReverseBits" and it expands it with no problem. Do you have any idea what may be causing this strnage problem?

Thanks for taking a look!

juanyo810 commented 2 years ago

Sorry, correct code snippet below with the same issue:

/* ReverseBits AUTO_TEMPLATE (
            .DATA_SIZE(32),
            .data_in   (data_in[]),
            .data_out  (data_revbit_mode64[]),
    );

   */
   ReverseBits  #(/*AUTOINSTPARAM*/
                  // Parameters
                  .DATA_SIZE            (32))                    // Templated
        reverseBitMode64 (/*AUTOINST*/
                          // Outputs
                          .data_out             (data_revbit_mode64[31:0]), // Templated
                          // Inputs
                          .data_in              (data_in[31:0])); // Templated

   // =-=-=-=-=-=-=-=-=-=-=- Reverse Byte 16-bit halfwords (REV16) - BOTH MODES =-=-=-=-=-=-=-=-=-
   /* ReverseBytes AUTO_TEMPLATE (
            .DATA_SIZE(80),
            .data_in   (data_in[]),
            .data_out  (data_revbit_mode64[]),
    );

   */
   ReverseBytes  #(/*AUTOINSTPARAM*/)
        reverseBitModeTest (/*AUTOINST*/
                            // Outputs
                            .data_out           (data_revbit_mode64[63:0]), // Templated
                            // Inputs
                            .data_in            (data_in[63:0]), // Templated
                            .sf_mode            (sf_mode));
juanyo810 commented 2 years ago

Apologies, dumb mistake on my end. Closing the issue.