From 9a9db43f4cecf0a43e1390a4fb8fd6746776f433 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 21 Oct 2021 14:31:36 +0100 Subject: [PATCH] add back-link in the return result of PartitionedCat to allow access to the submodule. PartitionedAssign can then detect this and alter the conditions to LHS *before* PartitionedCat.elaborate() is called it was already established in commit 494757caa1f that the elaborates are all called later --- src/ieee754/part_cat/pcat.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ieee754/part_cat/pcat.py b/src/ieee754/part_cat/pcat.py index 6b4630de..a3b9c8c3 100644 --- a/src/ieee754/part_cat/pcat.py +++ b/src/ieee754/part_cat/pcat.py @@ -10,4 +10,7 @@ def PCat(m, arglist, ctx): modcount += 1 pc = PartitionedCat(arglist, ctx) setattr(m.submodules, "pcat%d" % modcount, pc) + # add terrible hack back-link to be able to access PartitionedCat + # in PartitionedAssign https://bugs.libre-soc.org/show_bug.cgi?id=731#c13 + pc.output.__hack_submodule = pc # blegh! return pc.output -- 2.30.2