sv_analysis: fix single-line binutils comments
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Tue, 30 Nov 2021 13:41:19 +0000 (13:41 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Tue, 30 Nov 2021 20:34:15 +0000 (20:34 +0000)
src/openpower/sv/sv_analysis.py

index edd4b9d60283916429817a9599ba51a14f282217..013ba8ab89883cfff6d507fffc936679f5776657 100644 (file)
@@ -181,9 +181,13 @@ class Format(enum.Enum):
 
     def wrap_comment(self, lines):
         def wrap_comment_binutils(lines):
-            yield "/*"
-            yield from map(lambda line: f" * {line}", lines)
-            yield "*/"
+            lines = tuple(lines)
+            if len(lines) == 1:
+                yield f"/* {lines[0]} */"
+            else:
+                yield "/*"
+                yield from map(lambda line: f" * {line}", lines)
+                yield " */"
 
         def wrap_comment_vhdl(lines):
             yield from map(lambda line: f"-- {line}", lines)