From: Gabriele Monaco <gmonaco@redhat.com>
To: Nam Cao <namcao@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Wander Lairson Costa <wander@redhat.com>,
linux-trace-kernel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 05/13] verification/rvgen: Convert __fill_setup_invariants_func() to Lark
Date: Tue, 09 Jun 2026 14:39:16 +0200 [thread overview]
Message-ID: <ded9af4b0cdde4696c0a295e0c622a9d39c445ee.camel@redhat.com> (raw)
In-Reply-To: <e5f62eab0210df74ba5dea5c99e218b39d331274.1780908661.git.namcao@linutronix.de>
On Mon, 2026-06-08 at 10:57 +0200, Nam Cao wrote:
> + def __parse_invariant(self, inv):
> + # by default assume the timer has ns expiration
> + clock_type = "ns"
> + if inv.unit == "j":
> + clock_type = "jiffy"
> +
> + env = inv.env + self.enum_suffix
> + val = inv.val.replace("()", "(ha_mon)")
> +
> + match inv.unit:
> + case "us":
> + val *= 10**3
> + case "ms":
> + val *= 10**6
> + case "s":
> + val *= 10**9
> +
I need to add a test case for this.. You can check by using something like 5 us
in stall.dot in place of threshold_jiffies.
val is a string, doing val * 1000 repeats the string 1000 times in python!
We need to convert it like we do in __adjust_value(). Something like:
diff --git a/tools/verification/rvgen/rvgen/dot2k.py b/tools/verification/rvgen/rvgen/dot2k.py
index a080b92334..4d39f229c9 100644
--- a/tools/verification/rvgen/rvgen/dot2k.py
+++ b/tools/verification/rvgen/rvgen/dot2k.py
@@ -244,7 +244,11 @@ class ha2k(dot2k):
clock_type = "jiffy"
env = inv.env + self.enum_suffix
- val = inv.val.replace("()", "(ha_mon)")
+ try:
+ val = int(inv.val)
+ except ValueError:
+ # it's a constant, a parameter or a function
+ val = inv.val.replace("()", "(ha_mon)")
match inv.unit:
case "us":
Thanks,
Gabriele
next prev parent reply other threads:[~2026-06-09 12:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 8:56 [PATCH v3 00/13] rv: Convert rvgen " Nam Cao
2026-06-08 8:56 ` [PATCH v3 01/13] verification/rvgen: Switch LTL parser " Nam Cao
2026-06-08 8:56 ` [PATCH v3 02/13] verification/rvgen: Introduce a parse tree for automata using Lark Nam Cao
2026-06-08 8:56 ` [PATCH v3 03/13] verification/rvgen: Implement state and transition parser based on Lark Nam Cao
2026-06-09 12:54 ` Gabriele Monaco
2026-06-09 13:23 ` Gabriele Monaco
2026-06-08 8:57 ` [PATCH v3 04/13] verification/rvgen: Convert __fill_verify_invariants_func() to Lark Nam Cao
2026-06-08 8:57 ` [PATCH v3 05/13] verification/rvgen: Convert __fill_setup_invariants_func() " Nam Cao
2026-06-09 12:39 ` Gabriele Monaco [this message]
2026-06-16 9:00 ` Nam Cao
2026-06-08 8:57 ` [PATCH v3 06/13] verification/rvgen: Convert __fill_verify_guards_func() " Nam Cao
2026-06-08 8:57 ` [PATCH v3 07/13] rv: Simplify hybrid automata monitors's clock variables Nam Cao
2026-06-08 8:57 ` [PATCH v3 08/13] verification/rvgen: Simplify the generation for " Nam Cao
2026-06-11 8:39 ` Gabriele Monaco
2026-06-08 8:57 ` [PATCH v3 09/13] verification/rvgen: Delete __parse_constraint() Nam Cao
2026-06-10 15:04 ` Gabriele Monaco
2026-06-17 9:59 ` Nam Cao
2026-06-18 8:13 ` Gabriele Monaco
2026-06-18 13:24 ` Nam Cao
2026-06-08 8:57 ` [PATCH v3 10/13] verification/rvgen: Switch __get_event_variables() to Lark Nam Cao
2026-06-10 15:04 ` Gabriele Monaco
2026-06-08 8:57 ` [PATCH v3 11/13] verification/rvgen: Switch __create_matrix() " Nam Cao
2026-06-10 15:05 ` Gabriele Monaco
2026-06-08 8:57 ` [PATCH v3 12/13] verification/rvgen: Remove the old state variables Nam Cao
2026-06-10 15:06 ` Gabriele Monaco
2026-06-08 8:57 ` [PATCH v3 13/13] verification/rvgen: Remove dead code Nam Cao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ded9af4b0cdde4696c0a295e0c622a9d39c445ee.camel@redhat.com \
--to=gmonaco@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=namcao@linutronix.de \
--cc=rostedt@goodmis.org \
--cc=wander@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®