Escape scope names starting with dollar sign in smtio.py
authorClifford Wolf <clifford@clifford.at>
Wed, 26 Jun 2019 08:58:39 +0000 (10:58 +0200)
committerClifford Wolf <clifford@clifford.at>
Wed, 26 Jun 2019 08:58:39 +0000 (10:58 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
backends/smt2/smtio.py

index cea0fc56c67d78abf6e0554bd3f594c459b5db9a..ae7968a1b80b92e68277355037c976bfc4f62433 100644 (file)
@@ -1043,7 +1043,10 @@ class MkVcd:
                         scope = scope[:-1]
 
                     while uipath[:-1] != scope:
-                        print("$scope module %s $end" % uipath[len(scope)], file=self.f)
+                        scopename = uipath[len(scope)]
+                        if scopename.startswith("$"):
+                            scopename = "\\" + scopename
+                        print("$scope module %s $end" % scopename, file=self.f)
                         scope.append(uipath[len(scope)])
 
                     if path in self.clocks and self.clocks[path][1] == "event":