From: Luke Kenneth Casson Leighton Date: Sun, 26 Dec 2021 13:35:30 +0000 (+0000) Subject: a few extra things discovered needing c syntax not python syntax X-Git-Tag: sv_maxu_works-initial~598 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e5d4975cf6a55642670a3f93ca0eb1893af1c95;p=openpower-isa.git a few extra things discovered needing c syntax not python syntax in crtl --- diff --git a/src/openpower/decoder/test/_pyrtl.py b/src/openpower/decoder/test/_pyrtl.py index a9e7749c..366c7367 100644 --- a/src/openpower/decoder/test/_pyrtl.py +++ b/src/openpower/decoder/test/_pyrtl.py @@ -347,7 +347,7 @@ class _StatementCompiler(StatementVisitor, _Compiler): for stmt in stmts: self(stmt) if not stmts: - self.emitter.append("pass") + self.emitter.append("/* pass */;") def on_Assign(self, stmt): gen_rhs = f"({(1 << len(stmt.rhs)) - 1} & {self.rhs(stmt.rhs)})" @@ -361,7 +361,7 @@ class _StatementCompiler(StatementVisitor, _Compiler): for index, (patterns, stmts) in enumerate(stmt.cases.items()): gen_checks = [] if not patterns: - gen_checks.append(f"True") + gen_checks.append(f"1 /* True */") else: for pattern in patterns: if "-" in pattern: @@ -372,9 +372,9 @@ class _StatementCompiler(StatementVisitor, _Compiler): value = int(pattern, 2) gen_checks.append(f"{value} == {gen_test}") if index == 0: - self.emitter.if_(f"{' or '.join(gen_checks)}") + self.emitter.if_(f"{' || '.join(gen_checks)}") else: - self.emitter.else_if(f"{' or '.join(gen_checks)}") + self.emitter.else_if(f"{' || '.join(gen_checks)}") with self.emitter.nest(): self(stmts)