Bug 709 - PartitionedSignal eq needs to be more sophisticated
Summary: PartitionedSignal eq needs to be more sophisticated
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: Other Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL: https://libre-soc.org/3d_gpu/architec...
Depends on:
Blocks: 132
  Show dependency treegraph
Reported: 2021-09-24 11:29 BST by Luke Kenneth Casson Leighton
Modified: 2022-06-16 15:48 BST (History)
2 users (show)

See Also:
NLnet milestone: NLnet.2019.02.012
total budget (EUR) for completion of task and all subtasks: 300
budget (EUR) for this task, excluding subtasks' budget: 300
parent task for budget allocation: 132
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:
[lkcl] amount = 300 submitted = 2021-12-09 paid = 2021-12-09


Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2021-09-24 11:29:37 BST
copying from non-Partitioned sources to Partitioned sources needs to be

there are twelve permutations needing entirely different behaviour:

* Scalar or Partitioned source
* signed or unsigned destination
* source length is less, equal, or greater than destination.

Comment 1 Luke Kenneth Casson Leighton 2021-09-27 13:20:56 BST

idea regarding assign, an override of __Assign__, with a private
"collection list" of predicated partition conditions, that comes through
from Switch.

if __Assign__ understands that, and only assigns things based on a Condition
in each partition, it makes Switch's job a lot easier.

if the Condition defaults to a Const 0b111111 but is
overridden if Switch tells it to change that, the complexity
of trying to use temporary Signals is gone.
Comment 2 Luke Kenneth Casson Leighton 2021-09-29 19:28:20 BST

implemented... probably all 6 cases for parallel signal.  untested.
should work. uses nmutil.extend.ext as the underlying "detector".
scalar signal should be a reasonably easy adaptation.
Comment 3 Luke Kenneth Casson Leighton 2021-09-29 19:29:04 BST

turned out to be very easy.  integration into PartitionedSignal is next.
Comment 4 Luke Kenneth Casson Leighton 2021-09-30 15:48:54 BST
preliminary unit test for PartitionedSignal.eq()


first cut found "whoops" errors, now sorted (bit of a scary moment there
in the design): returning a single (lowered) eq which copies over the
output from the on-demand-created Module, by copying its *lowered*
output (to Value) works (thank goodness)

next is to add unit tests for the other 11 permutations.
Comment 5 Luke Kenneth Casson Leighton 2021-09-30 19:13:22 BST

that completes the set of 12 permutations needed:

        for out_width in [16, 24, 8]:
            for sign in [True, False]:
                for scalar in [True, False]:
                    self.run_tst(16, out_width, sign, scalar)

about the only other useful thing to try there is perhaps
inputting other types (scalar Const for example)