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

AUTOINST problem for module containing clocking block #1313

Open
veripoolbot opened this issue May 29, 2018 · 4 comments
Open

AUTOINST problem for module containing clocking block #1313

veripoolbot opened this issue May 29, 2018 · 4 comments
Labels

Comments

@veripoolbot
Copy link
Collaborator


Author Name: David Rogoff
Original Redmine Issue: 1313 from https://www.veripool.org


I just created a simple clock/reset module to instantiate in my testbench. The module contains a clocking block:

    default clocking tb_cb @(posedge clk);
      default input #1step output #2ps;
      output      rst;
    endclocking // tb_cb

When I instantiated the module and expanded it, it added

    i_clk_rst_gen
      (/*AUTOINST*/
       // Outputs
       .clk						    (clk),
       .rst						    (rst),
       .2ps						    (2ps),
       // Inputs
       .1step						    (1step));

Looks like the input and output keywords in the default line are confusing AUTOINST.

Easy fix?

Thanks,

David

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-05-30T10:38:16Z


There is some code in place to skip over the clocking. Can you attach a self-contained test? Thanks.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: David Rogoff
Original Date: 2018-05-30T18:14:36Z


Before expansion:

module clk_rst_gen
  (output logic clk, rst);

    default clocking tb_cb @(posedge clk);
    default input #1step output #2ps;
    output      rst;
endclocking // tb_cb

    initial begin : clk_gen
       clk  = 0;
       forever
         #5  clk = ~clk;
    end : clk_gen

    initial begin : rst_gen
       rst  = 1;
       repeat (5) @tb_cb;
       rst <= 0;
    end : rst_gen
endmodule : clk_rst_gen

module tb;
    /*AUTOLOGIC*/

    clk_rst_gen  i_clk_rst_gen
      (/*AUTOINST*/);
endmodule : tb

After expansion:

module tb;
    /*AUTOLOGIC*/
    // Beginning of automatic wires (for undeclared instantiated-module outputs)
    logic		clk;			// From i_clk_rst_gen of clk_rst_gen.v
    logic		rst;			// From i_clk_rst_gen of clk_rst_gen.v
    // End of automatics

    clk_rst_gen  i_clk_rst_gen
      (/*AUTOINST*/
       // Outputs
       .clk						    (clk),
       .rst						    (rst),
       .2ps						    (2ps),
       // Inputs
       .1step						    (1step));
endmodule : tb

Also, note that the indentation is messed up for the clocking block.

David

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-06-01T12:24:46Z


I made a stab at this but it needs more time as broke clocking modports.

Basically the parser needs to change to understand "default clocking foo;" does not start a declaration, but "default clocking foo @(...);" does.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: David Rogoff
Original Date: 2019-07-15T19:07:46Z


Hi Wilson.

I just hit this problem again and wondered if there's been any activity on it during the past year.

Thanks,

David

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