[Libre-soc-bugs] [Bug 731] potential design oversight in Partitioned SimdSignal Cat/Assign/etc lhs/rhs

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Oct 21 15:07:19 BST 2021


--- Comment #14 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
this "works" and does not cause "damage".  i did however have to
fix one of the unit tests where an assumption had been made
("ok to copy output of SimdSignal Cat onto a Signal") which
does "work" (due to UserValue downcasting).


commit ad925fc12563d9097dd1b93df0e0f3dc033b00ad (HEAD -> master)
Author: Luke Kenneth Casson Leighton <lkcl at lkcl.net>
Date:   Thu Oct 21 15:04:33 2021 +0100

    continue truly awful hack which, in SimdSignal.__Assign__, detects the
    back-link to the submodule (PartitionedCat) in its return result,
    and calls set_lhs_mode(True) or (False) on LHS and RHS as appropriate.

    the default value is *NOT* set in the PartitionedCat constructor very very
    deliberately so as to show up any bugs.  it is particularly fortunate that
    this was chosen to be done because there was, in fact, a bug in the
    TestCatMod unit test, which assumed that it was ok to splat a Cat() result
    of a pair of SimdSignals directly onto a Signal().

    it *is* in fact "technically allowed" by nmigen due to automatic casting
    of UserValue, but should not strictly have been done.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list