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 #1411

# comments support in .mem files

Added by Frederic Requin 28 days ago. Updated 27 days ago.

Status:
Resolved
Priority:
Low
Category:
Usage
% Done:

100%

Estimated time:
0.00 h

Description

Hello, I am using the excellent tool SRecord v1.64 (http://srecord.sourceforge.net/) to generate .mem files when compiling C for Nios II, LM32 or RISC-V CPUs. This tool adds comments starting with '#' in the .mem file. It generates a runtime error while loading the .mem file. A small change in "verilated.cpp" fixed the issue :

--- a/include/verilated.cpp
+++ b/include/verilated.cpp
@@ -1493,6 +1493,7 @@ void VL_READMEM_N(
         } else if (!ignore_to_eol && !ignore_to_cmt) {
             if (lastc=='/' && c=='*') { ignore_to_cmt = true; }
             else if (lastc=='/' && c=='/') { ignore_to_eol = true; }
+            else if (c=='#') { ignore_to_eol = true; }
             else if (c=='/') {}  // Part of /* or //
             else if (c=='_') {}
             else if (c=='@') { reading_addr = true; innum=false; needinc=false; }

Best regards,

Frederic

History

#1 Updated by Wilson Snyder 27 days ago

  • Description updated (diff)
  • Status changed from New to Resolved

Makes sense, love getting patches with requests!

Fixed in git towards 4.013.

Also available in: Atom