Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: parameter array parsing issue #1240

Closed
veripoolbot opened this issue Nov 14, 2017 · 5 comments
Closed

Question: parameter array parsing issue #1240

veripoolbot opened this issue Nov 14, 2017 · 5 comments
Labels

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Moshe M
Original Redmine Message: 2417 from https://www.veripool.org


Hi,
Having the following BUG

in the module, there is the following definition of the parameter

parameter integer NUM_MEM_INST_PER_FIR [NUM_MFU_FIRS] = '{32,15,8,5,4,4},

In the Auto template there is the following use of the paramter (to connecot to a sub module paramter )

.NUM_MEM_INSANCE (NUM_MEM_INST_PER_FIR[0]),@

result in the instanced module is great!

.mem_en (mem_en[(NUM_MEM_INST_PER_FIR[0])-1:0]),

But port is wrong (0:0)

output [0:0] mem_en, // From fir0_7_taps_04_mem_inst of glb_cfg_ram_arb_mult_mem.v

seem that only the Zero 0 was parsed from "NUM_MEM_INST_PER_FIR[0]"
because when i try with NUM_MEM_INST_PER_FIR[1] i receive 1:1
looks like a parsing issue

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-11-15T00:22:27Z


I'm not sure what output you are referring to. Can you please attach a complete self-contained example?

p.s. you probably want to spell it INSTANCE not INSANCE :)

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Moshe M
Original Date: 2017-11-15T12:55:32Z


attached a complete example

module top #(
  parameter  NOF_TEST        = 6,
  parameter integer TEST  [NOF_TEST] = '{10,20,30,40,50,60}
)

(
    /*AUTOINPUT*/
    /*AUTOOUTPUT*/
    // Beginning of automatic outputs (from unused autoinst outputs)
    output [1:1]         x                       // From inst of submod.v
    // End of automatics
    );
    

/*submod  AUTO_TEMPLATE (
    .NUM_MEM        (TEST[1]),

);
*/

    submod #( /*AUTOINSTPARAM*/
             // Parameters
             .NUM_MEM                    (TEST[1]))               // Templated
  inst 
      (/*AUTOINST*/
       // Outputs
       .x                                (x[(TEST[1])-1:0]));
    
endmodule

module submod #(
  parameter  NUM_MEM        = 6
)
  (output [NUM_MEM-1:0] x);
endmodule

// Local Variables:
// verilog-auto-inst-param-value:t
// End:

</code>

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-11-15T23:24:35Z


The workaround is to add the output yourself.

The extra close brackets is confusing it. When I fix that, this is no longer something that it parses, and what it does for that is not add anything to AUTOOUTPUT, so you'll need to do that yourself. Which will also match the workaround. Make sense?

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-11-18T15:00:40Z


I figured out a way to make this work, though it's a bit more sensitive to syntax then I would prefer. Fixed in git and verilog-mode-2017-11-18-6075bf2-vpo.el.gz

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Moshe M
Original Date: 2017-11-19T08:49:15Z


Looks great!!!
Thanks for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant