From ba350a46860654464853df07e6583f22d052132d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 8 Dec 2021 12:46:16 +0000 Subject: [PATCH] found a way to print out the names of the signals will be useful to see what the heck is going on in the auto-generated c --- src/openpower/decoder/test/_pyrtl.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/test/_pyrtl.py b/src/openpower/decoder/test/_pyrtl.py index cdf22006..b6c3ff1f 100644 --- a/src/openpower/decoder/test/_pyrtl.py +++ b/src/openpower/decoder/test/_pyrtl.py @@ -278,11 +278,19 @@ class _LHSValueCompiler(_ValueCompiler): def gen(arg): value_mask = (1 << len(value)) - 1 + name = '' + # TODO: useful trick, actually put the name into the c code + # but this has to be done consistently right across the board. + # all occurrences of next_{....} have to use the same trick + # but at least then the names in the auto-generated c-code + # are readable... + #if hasattr(value, "name") and value.name is not None: + # name = value.name if value.shape().signed: value_sign = f"sign({value_mask} & {arg}, {-1 << (len(value) - 1)})" else: # unsigned value_sign = f"{value_mask} & {arg}" - self.emitter.append(f"next_{self.state.get_signal(value)} = {value_sign};") + self.emitter.append(f"next_{name}{self.state.get_signal(value)} = {value_sign};") return gen def on_Operator(self, value): -- 2.30.2