Bug 709 - PartitionedSignal eq needs to be more sophisticated
Summary: PartitionedSignal eq needs to be more sophisticated
Status: RESOLVED FIXED
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


Attachments

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
supported.

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.


https://git.libre-soc.org/?p=ieee754fpu.git;a=blob;f=src/ieee754/part/partsig.py;hb=HEAD
Comment 1 Luke Kenneth Casson Leighton 2021-09-27 13:20:56 BST
https://bugs.libre-soc.org/show_bug.cgi?id=458#c10

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
https://git.libre-soc.org/?p=ieee754fpu.git;a=commitdiff;h=74b34919e7dea7dd1f9ecd4a238c6244ee8dbe02

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
https://git.libre-soc.org/?p=ieee754fpu.git;a=commitdiff;h=359537564b3fcc1e9f0f900decde588cd28079d7

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()

https://git.libre-soc.org/?p=ieee754fpu.git;a=commitdiff;h=00f1c370f584d8a7987f96e9e5aa2a813f639711

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
https://git.libre-soc.org/?p=ieee754fpu.git;a=commitdiff;h=b02c7687fd922c8af6a85c7bd9f8ed9aa0574f1c

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)