Simple support for %l format specifier
authorZachary Snow <zach@zachjs.com>
Sat, 29 Aug 2020 17:33:31 +0000 (13:33 -0400)
committerZachary Snow <zach@zachjs.com>
Sat, 29 Aug 2020 17:33:31 +0000 (13:33 -0400)
Yosys doesn't support libraries, so this provides the same behavior as
%m, as some other tools have opted to do.

frontends/ast/simplify.cc

index 7f9795d297ff371f3baa9e80f97f459453d9c2f3..e50ebff3ae9d2953aed9bb8dac3f32b9bfcadaf3 100644 (file)
@@ -110,6 +110,12 @@ std::string AstNode::process_format_str(const std::string &sformat, int next_arg
                                                goto unsupported_format;
                                        break;
 
+                               case 'l':
+                               case 'L':
+                                       if (got_len)
+                                               goto unsupported_format;
+                                       break;
+
                                default:
                                unsupported_format:
                                        log_file_error(filename, location.first_line, "System task `%s' called with invalid/unsupported format specifier.\n", str.c_str());
@@ -155,6 +161,11 @@ std::string AstNode::process_format_str(const std::string &sformat, int next_arg
                                        sout += log_id(current_module->name);
                                        break;
 
+                               case 'l':
+                               case 'L':
+                                       sout += log_id(current_module->name);
+                                       break;
+
                                default:
                                        log_abort();
                        }