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

verilator generates bad C++ with --public for real module parameters #1261

Closed
veripoolbot opened this issue Jan 13, 2018 · 2 comments
Closed
Assignees
Labels
resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Alex Solomatnikov
Original Redmine Issue: 1261 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


Verilog:

module ClockSkew ( clkin, clkout );
  timeunit 1ns;
  timeprecision 1ps;

  parameter DELAY_RTL = 0.0;
  parameter DELAY_GL = 0.0;

  input clkin;
  output clkout;

  reg clkskew;

  always @(*) begin
`ifdef GATE_LEVEL
     if (DELAY_GL > 0) clkskew = #DELAY_GL clkin ;
`else
     if (DELAY_RTL > 0) clkskew = #DELAY_RTL clkin ;
`endif
     else clkskew = clkin ;
  end

  assign clkout = clkskew ;

endmodule

...

ClockSkew #(.DELAY_RTL(0.0), .DELAY_GL(0.2)) ClockSkew (
  .clkout(ClockSkew_clkout),
  .clkin(ClockSkew_clkin))

C++ error:

In file included from /scratch/mikeyang/federation.gamma04/csrc/verilator-main.cpp:7:0:
./VTestDriver.h:337476:142: error: enumerator value for TestDriver__DOT__testHarness__DOT__ClockSkew__DOT__DELAY_RTL�� is not an integer constant
      enum _QDataTestDriver__DOT__testHarness__DOT__ClockSkew__DOT__DELAY_RTL { TestDriver__DOT__testHarness__DOT__ClockSkew__DOT__DELAY_RTL = 0.0};
                                                                                                                                               ^
./VTestDriver.h:337477:140: error: enumerator value for ��TestDriver__DOT__testHarness__DOT__ClockSkew__DOT__DELAY_GL�� is not an integer constant
      enum _QDataTestDriver__DOT__testHarness__DOT__ClockSkew__DOT__DELAY_GL { TestDriver__DOT__testHarness__DOT__ClockSkew__DOT__DELAY_GL = 2.00000000000000011e-01};
                                                                                                                                             ^

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-01-17T00:56:05Z


This is fixed in git towards 3.920, but simply by not putting out real parameters.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-02-02T01:17:00Z


In 3.920.

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

No branches or pull requests

2 participants