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: Auto Param #677

Closed
veripoolbot opened this issue Oct 1, 2013 · 8 comments
Closed

Question: Auto Param #677

veripoolbot opened this issue Oct 1, 2013 · 8 comments
Labels

Comments

@veripoolbot
Copy link
Collaborator


Author Name: micky harris
Original Redmine Message: 1253 from https://www.veripool.org


Is it possible to have an /AutoParam/ with similar behavior as /AutoInput/?

Example of what I would like to type.

 module  my_top #(/*AutoParam*/)
 (
 /*AutoOutput*/
 /*AutoInput*/
 );
 
 my_sub #(/*AutoInstParam*/)
 I0 (/*AutoInst*/);
 
 endmodule
 
 module my_sub#(parameter c = 3)
 (input a,
 output reg [c-1:0] b);
 endmodule

Would be expanded to the following

 module  my_top #(
 //Beginning of automatic parameters
 parameter c=3
 // End of automatics
 )(
 /*AutoOutput*/
 // Beginning of automatic outputs (from unused autoinst outputs)
 output [c-1:0]		b,			// From I0 of my_sub.v
 // End of automatics
 /*AutoInput*/
 // Beginning of automatic inputs (from unused autoinst inputs)
 input			a			// To I0 of my_sub.v
 // End of automatics
 );
 
 my_sub #(/*AutoInstParam*/
 // Parameters
 .c				(c))
 I0 (/*AutoInst*/
 // Outputs
 .b				(b[c-1:0]),
 // Inputs
 .a				(a));
 endmodule

Is this possible with the current code & I am just missing something? I just want to make sure that all the parameters are propogated to the top level module.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2013-10-01T11:38:46Z


AUTOINOUTPARAM

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: micky harris
Original Date: 2013-10-01T16:02:12Z


Thanks, but that is not the behavior I am looking for. The idea is that it would copy all parameters from all sub modules that have been left as a symbolic.

//parameters
.a(5),
.b(b)

In this example b would be copied and set to the default from the submodule. Parameter a and would be left in side the module since it was set to a value this would end the passing of the parameters.

In using the copy from command /AutoParamInOut/, one issue is that the parameter is not set to anything which gives a syntax error. If I manually edit the paramater and set it equal to something it is just wiped out by auto verilog on the next run.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2013-10-01T22:30:05Z


I can add something to do what you are looking for, but it's going to be subject to the same issue as you see with AUTOINSTPARAM; it will require a SystemVerilog 2012 compatible simulator that accepts parameters without default values.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: micky harris
Original Date: 2013-10-10T06:27:58Z


Maybe an option to set all parameters to 0 would be a way around the error.

Thanks For Considering this.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Sathappan Palaniappan
Original Date: 2013-12-04T19:32:36Z


Wilson Snyder,

Is this done? Which version of verilog-mode.el got AUTOPARAM feature?

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Sathappan Palaniappan
Original Date: 2014-06-17T00:20:48Z


Nowadays, I frequently encounter SystemVerilog 2012 code. Did you get a chance to introduce AUTOPARAM feature?

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Daniel Becker
Original Date: 2017-01-30T21:55:30Z


Any updates on this? AUTOINOUTPARAM doesn't really solve the problem, as (unlike AUTOINPUT/AUTOOUTPUT/AUTOWIRE) it can't just automatically look at all instantiated child modules and doesn't respect parameter assignment/renaming (either manual or via AUTO_TEMPLATE rule).

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-02-09T03:24:21Z


I see the value of this, but at present the parser could only easily support making

module my_top #(
//Beginning of automatic parameters
parameter c
// End of automatics
)

which I doubt is very often useful as the module above usually will want a default value for C.

Someday it'll parse the parameter default values so it can propagate them.

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