Jacob Lifshay [Thu, 28 Oct 2021 04:06:15 +0000 (21:06 -0700)]
add initial SimdShape.__add__
Jacob Lifshay [Thu, 28 Oct 2021 03:58:46 +0000 (20:58 -0700)]
add initial SimdShape.__mul__
Jacob Lifshay [Thu, 28 Oct 2021 03:57:29 +0000 (20:57 -0700)]
format code
Jacob Lifshay [Thu, 28 Oct 2021 03:41:34 +0000 (20:41 -0700)]
remove SimdScope.get() and friends
Jacob Lifshay [Thu, 28 Oct 2021 03:36:51 +0000 (20:36 -0700)]
format code
Jacob Lifshay [Wed, 27 Oct 2021 09:11:14 +0000 (02:11 -0700)]
add tests for SimdMap and friends
Jacob Lifshay [Wed, 27 Oct 2021 09:10:24 +0000 (02:10 -0700)]
add SimdWHintMap to support tracking width_hint for XLEN
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 17:52:48 +0000 (18:52 +0100)]
hooray, convert PartitionedCat over to new PartType API, using
get_num_elements and get_el_range
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 17:30:53 +0000 (18:30 +0100)]
add two new functions to PartType: get_num_elements and get_el_range
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 13:36:55 +0000 (14:36 +0100)]
remove fixed_width parameter from SimdScope.Signal
after working out how to explicitly use a SimdShape
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 13:35:57 +0000 (14:35 +0100)]
use explicit SimdShape for minitest example rather than
fixed_width parameter
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 13:28:55 +0000 (14:28 +0100)]
had to add fixed_width parameter temporarily to confirm that the
minitest, test_partsig_scope.py, worked (which it did).
now can work out how to remove it
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 13:19:02 +0000 (14:19 +0100)]
debugging of initial test_partsig_scope.py mini-test
scope and shape need to be stored in SimdSignal in order to get at them
later
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 12:29:51 +0000 (13:29 +0100)]
adapt/debug SimdSignal when using ElwidPartType
example mini-test with test_partsig_scope.py working through issues
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 12:29:06 +0000 (13:29 +0100)]
remove unnecessary imports
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 12:14:06 +0000 (13:14 +0100)]
remove unnecessary code which creates complications from SimdScope
constructor.
elwid is mandatory, vec_el_counts is mandatory. no need for complicated
types, complicated adaptation, complicated interlocking conditional
behaviour.
pass in elwid (Signal)
pass in vec_el_counts.
done.
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 11:19:04 +0000 (12:19 +0100)]
rename the arguments to SimdShape() so as to match up with Shape() params
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 11:10:46 +0000 (12:10 +0100)]
add SimdScope.Shape redirector which switches from scalar to simd behaviour
depending on context.
for compatibility with nmigen Shape() the width parameter is passed
through to widths_at_elwid in SimdShape, allowing the layout() function
the opportunity to turn a scalar width into fixed element widths at
all elwids.
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 10:33:51 +0000 (11:33 +0100)]
start filling in ElwidPartType switch/case and other info
needed to get it functional and a drop-in replacement for the old
PartitionedSignal PartType behaviour
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 10:25:03 +0000 (11:25 +0100)]
create a SimdShape class and begin to investigate how to tie it in
to ElwidPartType.
Luke Kenneth Casson Leighton [Mon, 25 Oct 2021 09:47:08 +0000 (10:47 +0100)]
add more code-comments
Luke Kenneth Casson Leighton [Sun, 24 Oct 2021 18:32:01 +0000 (19:32 +0100)]
return layout points from layout()
Luke Kenneth Casson Leighton [Sun, 24 Oct 2021 18:26:47 +0000 (19:26 +0100)]
spelling corrections after typing on a phone
Luke Kenneth Casson Leighton [Sun, 24 Oct 2021 16:14:43 +0000 (17:14 +0100)]
add dictionary of list of layout points, start-end
ElwidPartType it looks like it needs to know where each element
starts and ends, therefore provide that info at the point it was
created
Luke Kenneth Casson Leighton [Sun, 24 Oct 2021 10:13:56 +0000 (11:13 +0100)]
add docstrings for additional necessary context-aware versions of
Signal.like and Shape in SimdScope.
Luke Kenneth Casson Leighton [Fri, 22 Oct 2021 16:41:20 +0000 (17:41 +0100)]
from mobile reslly bad spelling comment why layout should remain a fn
Luke Kenneth Casson Leighton [Fri, 22 Oct 2021 14:29:18 +0000 (15:29 +0100)]
add back-link to why SimdScope has to get the hell out the way when
scalar=True
Luke Kenneth Casson Leighton [Fri, 22 Oct 2021 14:21:51 +0000 (15:21 +0100)]
add in code-comments
noticed a lot of weird code (including the hint that there might be
an intention to treat SimdSignal as a scalar ("one elwid, full width")
which is very dangerous (explained already)
added in particular some notes about the parameters that go through
to layout()
Luke Kenneth Casson Leighton [Fri, 22 Oct 2021 14:14:13 +0000 (15:14 +0100)]
add comments / docstrings for layout function to illustrate where
the parameters actually come from
Luke Kenneth Casson Leighton [Fri, 22 Oct 2021 14:03:22 +0000 (15:03 +0100)]
only set standard PartType in non-Simd-mode
Luke Kenneth Casson Leighton [Fri, 22 Oct 2021 14:01:16 +0000 (15:01 +0100)]
in SimdScope only update module AST Typecast function in SIMD mode
do not whatever you do change the mode over to Simd casting in Scalar mode
Luke Kenneth Casson Leighton [Fri, 22 Oct 2021 13:41:41 +0000 (14:41 +0100)]
add the beginnings of a usage docstring for the module and add a Signal
function which shows how to connect things together.
with SimdScope being passed in as the "mask" parameter, the SimdSignal
knows to switch over to "ElwidPartType mode"
Luke Kenneth Casson Leighton [Fri, 22 Oct 2021 13:39:19 +0000 (14:39 +0100)]
remove simd_full_width_hint, it is down to individual Signals within the
context to explicitly declare their width, if in fact they need one.
some cases (as shown in the layout() function) no fixed (full) width
is required to explicitly be specified, it is determined instead from
the element widths
Luke Kenneth Casson Leighton [Fri, 22 Oct 2021 13:15:18 +0000 (14:15 +0100)]
add in TODO notes tying in SimdScope/SimdMode
Jacob Lifshay [Fri, 22 Oct 2021 07:40:09 +0000 (00:40 -0700)]
add type annotations .pyi file for SimdScope
Jacob Lifshay [Fri, 22 Oct 2021 07:39:42 +0000 (00:39 -0700)]
update SimdScope to use vec_el_counts
Jacob Lifshay [Fri, 22 Oct 2021 05:58:33 +0000 (22:58 -0700)]
move SimdScope to separate file
Luke Kenneth Casson Leighton [Thu, 21 Oct 2021 15:56:51 +0000 (16:56 +0100)]
add LHS support into PartitionedCat. amazingly - stunningly - it works
https://bugs.libre-soc.org/show_bug.cgi?id=731
Luke Kenneth Casson Leighton [Thu, 21 Oct 2021 15:50:01 +0000 (16:50 +0100)]
confirmed (in prototype form that LHS Cat will cause conflict
Luke Kenneth Casson Leighton [Thu, 21 Oct 2021 14:04:33 +0000 (15:04 +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.
Luke Kenneth Casson Leighton [Thu, 21 Oct 2021 13:31:36 +0000 (14:31 +0100)]
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
Luke Kenneth Casson Leighton [Thu, 21 Oct 2021 12:40:29 +0000 (13:40 +0100)]
add quick print statements to show that elaborate() gets called as a
second phase after the creation of the AST tree
this gives a window of opportunity to tree-walk and set whether SimdSignals
are LHS or RHS as determined by encountering SimdSignal.__Assign__
Luke Kenneth Casson Leighton [Thu, 21 Oct 2021 12:06:35 +0000 (13:06 +0100)]
found an error in PartitionedAssign and PartitionedRepl
where Slice was accidentally being done on SimdSignal rather than
SimdSignals internal sig. whilst this was a legitimate oversight
the bug should have been found when a NotImplemented SimdSignal.__Slice__
was added.
Project Development Practices were violated here by unit tests not
having been run, which would have easily detected the bug
Luke Kenneth Casson Leighton [Thu, 21 Oct 2021 11:50:58 +0000 (12:50 +0100)]
remove duplicate function definition
Luke Kenneth Casson Leighton [Thu, 21 Oct 2021 11:49:53 +0000 (12:49 +0100)]
remove reference to use of Swizzled class, due to it violating
Project Development Practices
documented here:
https://bugs.libre-soc.org/show_bug.cgi?id=731#c10
Jacob Lifshay [Sat, 16 Oct 2021 01:19:11 +0000 (18:19 -0700)]
add forgotten files from last commit
Jacob Lifshay [Sat, 16 Oct 2021 01:12:49 +0000 (18:12 -0700)]
add WIP code for handling Slice and Cat in a unified way, supporting assignment
Jacob Lifshay [Fri, 15 Oct 2021 23:58:24 +0000 (16:58 -0700)]
format code
Jacob Lifshay [Fri, 15 Oct 2021 05:05:23 +0000 (22:05 -0700)]
fix bmask calculation
Jacob Lifshay [Fri, 15 Oct 2021 03:53:09 +0000 (20:53 -0700)]
split out end_bit
Jacob Lifshay [Fri, 15 Oct 2021 03:51:09 +0000 (20:51 -0700)]
split out start_bit
Jacob Lifshay [Fri, 15 Oct 2021 03:45:49 +0000 (20:45 -0700)]
remove redundant plist variable
Jacob Lifshay [Fri, 15 Oct 2021 03:27:42 +0000 (20:27 -0700)]
sort dpoints keys
Jacob Lifshay [Fri, 15 Oct 2021 03:21:12 +0000 (20:21 -0700)]
simplify dpoints computation
width is already set to fixed_width, we don't need to have a separate case
Jacob Lifshay [Fri, 15 Oct 2021 03:20:43 +0000 (20:20 -0700)]
dedup dpoints
Jacob Lifshay [Fri, 15 Oct 2021 03:10:04 +0000 (20:10 -0700)]
delete superfluous documentation section
Jacob Lifshay [Fri, 15 Oct 2021 03:09:40 +0000 (20:09 -0700)]
format code
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 16:55:49 +0000 (17:55 +0100)]
create quick test of what 24-12-5-6 layout was likely-expected to be
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 15:24:48 +0000 (16:24 +0100)]
add 2nd test to see what is going on in layout_experiment
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 15:09:11 +0000 (16:09 +0100)]
add FP "exponent" example, not quite matching expected results
needs analysis
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 14:45:33 +0000 (15:45 +0100)]
remove return of part_count parameter because it is not useful
the actual part_count (per se) is simply specified by vec_el_counts
which is a dictionary not a single item.
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 14:44:19 +0000 (15:44 +0100)]
fix issue where width was being computed based on 2 maximum values
actually needed is to multiply the number of elements by the width of
an element and use that to determine which is greater
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 14:26:13 +0000 (15:26 +0100)]
remove unnecessary sign argument from layout() tests
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 14:23:03 +0000 (15:23 +0100)]
remove signed. again
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 14:20:29 +0000 (15:20 +0100)]
whitespace for clarity. comments
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 13:48:26 +0000 (14:48 +0100)]
move "faulty" test to end of layout_experiment.py (last test)
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 12:40:43 +0000 (13:40 +0100)]
although it is a little less visually clear, removing the whitespace
allows illustrating what is used and what is not used in the 5-6-6-6
example
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 12:36:47 +0000 (13:36 +0100)]
add assert to check that the 5-6-6-6 example returns the expected
partition points 5,6,12,18
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 12:25:09 +0000 (13:25 +0100)]
fix layout() to put in only the number of *requested* vector elements
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 12:06:25 +0000 (13:06 +0100)]
rename part_counts to vec_el_counts
to indicate that it is intended to be the count of the number of vector
elements within a partition
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 11:55:44 +0000 (12:55 +0100)]
cpart_wid is just max(lane_shapes.values())
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 11:51:09 +0000 (12:51 +0100)]
redefine part_counts to be "number of vector elements in a partition"
fixes the bug
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 11:47:38 +0000 (12:47 +0100)]
whitespace
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 11:45:29 +0000 (12:45 +0100)]
whitespace, illustrate examples so as to make expected results clear
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 11:28:13 +0000 (12:28 +0100)]
unfortunately this is a multi-purpose commit.
it:
1) adds some types AND
2) adds some classes AND
3) fixes some whitespace issues AND
4) (finally) fixes some bugs
we strictly require *single* purpose commits
https://libre-soc.org/HDL_workflow/
Keep commits single-purpose
edit files making minimal single purpose modifications
(even if it involves multiple files. Good extreme example:
globally changing a function name across an entire codebase
is one purpose, one commit, yet hundreds of files.
miss out one of those files, requiring multiple commits,
and it actually becomes a nuisance).
https://bugs.libre-soc.org/show_bug.cgi?id=713#c98
Revert "fix layout bugs"
This reverts commit
9a318256b74054b8d592efe7be298764d0de415a.
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 11:25:25 +0000 (12:25 +0100)]
waaay too big a patch set (957 lines).
https://bugs.libre-soc.org/show_bug.cgi?id=713#c98
Revert "refactor layout to use SimdScope and XLEN"
This reverts commit
48c4d358fafb59fc7fdc414874c5288b81ec462d.
Jacob Lifshay [Wed, 13 Oct 2021 08:48:36 +0000 (01:48 -0700)]
refactor layout to use SimdScope and XLEN
Jacob Lifshay [Wed, 13 Oct 2021 08:47:38 +0000 (01:47 -0700)]
add SimdMap and SimdScope and XLEN
Jacob Lifshay [Wed, 13 Oct 2021 03:39:51 +0000 (20:39 -0700)]
fix layout bugs
Jacob Lifshay [Wed, 13 Oct 2021 01:04:20 +0000 (18:04 -0700)]
add docs for layout
Jacob Lifshay [Wed, 13 Oct 2021 00:55:19 +0000 (17:55 -0700)]
format code
Luke Kenneth Casson Leighton [Tue, 12 Oct 2021 13:29:06 +0000 (14:29 +0100)]
add option to specify fixed_width and no lane_shaps only to find
that there has been assumption that lane_shapes equals element width *times*
partition count.
https://bugs.libre-soc.org/show_bug.cgi?id=713#c67
next step is to set lane_shapes in terms of the element width
Luke Kenneth Casson Leighton [Mon, 11 Oct 2021 10:53:59 +0000 (11:53 +0100)]
add blanking mask, but current example has no blank areas
Luke Kenneth Casson Leighton [Mon, 11 Oct 2021 10:26:20 +0000 (11:26 +0100)]
whitespace
Luke Kenneth Casson Leighton [Mon, 11 Oct 2021 10:25:11 +0000 (11:25 +0100)]
improve code-comments some more
Luke Kenneth Casson Leighton [Mon, 11 Oct 2021 10:19:35 +0000 (11:19 +0100)]
improve code-comments some more
Luke Kenneth Casson Leighton [Mon, 11 Oct 2021 10:11:24 +0000 (11:11 +0100)]
improve code-comments
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 20:06:26 +0000 (21:06 +0100)]
whoops conversion of list of 0/1 needed reversing
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 15:22:20 +0000 (16:22 +0100)]
add option to do fixed-width layout
https://bugs.libre-soc.org/show_bug.cgi?id=713#c22
currently failing, answer is *backwards* (bit-inverted) which makes no sense
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 14:45:16 +0000 (15:45 +0100)]
add a check of bitp against the expected partition points when
going through the elwidths
https://bugs.libre-soc.org/show_bug.cgi?id=713#c47
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 14:19:31 +0000 (15:19 +0100)]
add phase 3 of the layout() experiment.
https://bugs.libre-soc.org/show_bug.cgi?id=713#c34
here the binary values are obtained which, if elwidth is set to a given
value, we expect the PartitionPoints mask to be set to that value
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 14:11:43 +0000 (15:11 +0100)]
convert to two-stage layout points-creation
https://bugs.libre-soc.org/show_bug.cgi?id=713#c34
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 13:59:34 +0000 (14:59 +0100)]
add code-comments
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 13:45:46 +0000 (14:45 +0100)]
added example with elwidth==Signal(2) from:
https://bugs.libre-soc.org/show_bug.cgi?id=713#c30
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 13:35:05 +0000 (14:35 +0100)]
remove Shape, signed and unsigned from layout experiment,
idea is to sub-class from ast.Shape() and therefore that provides
the full and complete understanding and specification of signed,
not layout()
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 13:30:52 +0000 (14:30 +0100)]
add layout experiment from
https://bugs.libre-soc.org/show_bug.cgi?id=713#c20
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 11:15:11 +0000 (12:15 +0100)]
fix SimdSignal Repl test (was previously unfinished)
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 10:35:20 +0000 (11:35 +0100)]
big rename PartitionedSignal to SimdSignal (shorter)
https://bugs.libre-soc.org/show_bug.cgi?id=713#c58
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 10:33:23 +0000 (11:33 +0100)]
add some more comments for the elwidth-adapter
https://bugs.libre-soc.org/show_bug.cgi?id=713#c34
Luke Kenneth Casson Leighton [Sat, 9 Oct 2021 19:52:14 +0000 (20:52 +0100)]
altered test_partsig2.py removed outval, run with outval2 instead