Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1261

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

Added by Alex Solomatnikov about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
TranslationError
% Done:

0%


Description

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};
                                                                                                                                            ^

History

#1 Updated by Wilson Snyder about 1 year ago

  • Category set to TranslationError
  • Status changed from New to Resolved
  • Assignee set to Wilson Snyder

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

#2 Updated by Wilson Snyder about 1 year ago

  • Status changed from Resolved to Closed

In 3.920.

Also available in: Atom