Skip to content

Commit 6fb37c2

Browse files
covanamrostedt
authored andcommitted
verification/rvgen: Generate each variable definition only once
If a variable appears multiple times in the specification, ltl2k generates multiple variable definitions. This fails the build. Make sure each variable is only defined once. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Gabriele Monaco <gmonaco@redhat.com> Link: https://lore.kernel.org/107dcf0d0aa8482d5fbe0314c3138f61cd284e91.1752850449.git.namcao@linutronix.de Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 8cfcf9b commit 6fb37c2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tools/verification/rvgen/rvgen/ltl2k.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,16 @@ def _fill_atom_values(self):
112112
if node.op.is_temporal():
113113
continue
114114

115-
if isinstance(node.op, ltl2ba.Variable):
116-
buf.append("\tbool %s = test_bit(LTL_%s, mon->atoms);" % (node, node.op.name))
117-
elif isinstance(node.op, ltl2ba.AndOp):
115+
if isinstance(node.op, ltl2ba.AndOp):
118116
buf.append("\tbool %s = %s && %s;" % (node, node.op.left, node.op.right))
119117
elif isinstance(node.op, ltl2ba.OrOp):
120118
buf.append("\tbool %s = %s || %s;" % (node, node.op.left, node.op.right))
121119
elif isinstance(node.op, ltl2ba.NotOp):
122120
buf.append("\tbool %s = !%s;" % (node, node.op.child))
121+
122+
for atom in self.atoms:
123+
buf.append("\tbool %s = test_bit(LTL_%s, mon->atoms);" % (atom.lower(), atom))
124+
123125
buf.reverse()
124126

125127
buf2 = []

0 commit comments

Comments
 (0)