nmutil.git
2 years agoadd note that migration to new PLRU should be blocked on #913
Jacob Lifshay [Fri, 26 Aug 2022 17:10:36 +0000 (10:10 -0700)]
add note that migration to new PLRU should be blocked on #913

https://bugs.libre-soc.org/show_bug.cgi?id=913

2 years agoadd fixed PLRU
Jacob Lifshay [Fri, 19 Aug 2022 07:28:30 +0000 (00:28 -0700)]
add fixed PLRU

2 years agocopy plru.py -> plru2.py and add deprecation messages
Jacob Lifshay [Fri, 19 Aug 2022 02:54:34 +0000 (19:54 -0700)]
copy plru.py -> plru2.py and add deprecation messages

2 years agorename p_lru.txt to plru.txt so it shows up right next to plru.py
Jacob Lifshay [Fri, 19 Aug 2022 02:41:31 +0000 (19:41 -0700)]
rename p_lru.txt to plru.txt so it shows up right next to plru.py

2 years agoautoformat all code
Jacob Lifshay [Fri, 19 Aug 2022 02:40:16 +0000 (19:40 -0700)]
autoformat all code

2 years agoformat code with autopep8
Jacob Lifshay [Fri, 19 Aug 2022 02:31:14 +0000 (19:31 -0700)]
format code with autopep8

added empty lines to avoid confusion of which variable each docstring goes with

2 years agoi really hate f"....". replace with just bin(v) and add a comment
Luke Kenneth Casson Leighton [Thu, 18 Aug 2022 09:43:11 +0000 (10:43 +0100)]
i really hate f"....". replace with just bin(v) and add a comment

2 years agomoved pop_count to its own separate module so that it is obvious it exists.
Luke Kenneth Casson Leighton [Thu, 18 Aug 2022 09:37:38 +0000 (10:37 +0100)]
moved pop_count to its own separate module so that it is obvious it exists.
anyone looking at the top-level directory of nmutil will see
"oh there is a popcount.py in here"

2 years agowhitespace in docstrings
Luke Kenneth Casson Leighton [Thu, 18 Aug 2022 09:25:01 +0000 (10:25 +0100)]
whitespace in docstrings

2 years agoadd WIP formal proof
Jacob Lifshay [Thu, 18 Aug 2022 06:23:08 +0000 (23:23 -0700)]
add WIP formal proof

2 years agomodify PLRU to allow access to internals by formal proof
Jacob Lifshay [Thu, 18 Aug 2022 06:22:38 +0000 (23:22 -0700)]
modify PLRU to allow access to internals by formal proof

2 years agoadd support for plain_data __repr__ with fields that aren't set
Jacob Lifshay [Tue, 16 Aug 2022 06:07:40 +0000 (23:07 -0700)]
add support for plain_data __repr__ with fields that aren't set

2 years agoadd fields and replace functions, like dataclasses.fields/replace
Jacob Lifshay [Tue, 16 Aug 2022 05:25:58 +0000 (22:25 -0700)]
add fields and replace functions, like dataclasses.fields/replace

2 years agoconvert rest of dataclass uses to plain_data
Jacob Lifshay [Fri, 12 Aug 2022 07:44:08 +0000 (00:44 -0700)]
convert rest of dataclass uses to plain_data

2 years agofix prefix_sum.py after 63ffb1aa and d7288021
Jacob Lifshay [Fri, 12 Aug 2022 06:37:02 +0000 (23:37 -0700)]
fix prefix_sum.py after 63ffb1aa and d7288021

2 years agofinish implementing @plain_data()
Jacob Lifshay [Fri, 12 Aug 2022 06:08:44 +0000 (23:08 -0700)]
finish implementing @plain_data()

2 years agostart adding @plain_data() decorator
Jacob Lifshay [Thu, 11 Aug 2022 05:04:44 +0000 (22:04 -0700)]
start adding @plain_data() decorator

2 years agoremove all asserts restricting types.
Luke Kenneth Casson Leighton [Sat, 6 Aug 2022 02:36:33 +0000 (03:36 +0100)]
remove all asserts restricting types.
python is a liskov-substitution-principle language.

2 years agoremove dataclass and use of types
Luke Kenneth Casson Leighton [Fri, 5 Aug 2022 10:52:11 +0000 (11:52 +0100)]
remove dataclass and use of types

2 years agoadd partial_prefix_sum_ops
Jacob Lifshay [Fri, 5 Aug 2022 06:15:30 +0000 (23:15 -0700)]
add partial_prefix_sum_ops

2 years agoadd tree_reduction and pop_count based off of dead-code-elimination of prefix_sum_ops
Jacob Lifshay [Fri, 5 Aug 2022 05:53:08 +0000 (22:53 -0700)]
add tree_reduction and pop_count based off of dead-code-elimination of prefix_sum_ops

2 years agoadd Queue formal proof
Jacob Lifshay [Fri, 5 Aug 2022 04:46:24 +0000 (21:46 -0700)]
add Queue formal proof

2 years agofix bad escape sequences from forgetting to make the string raw
Jacob Lifshay [Fri, 5 Aug 2022 03:36:18 +0000 (20:36 -0700)]
fix bad escape sequences from forgetting to make the string raw

2 years agoremove unneeded imports
Jacob Lifshay [Thu, 4 Aug 2022 07:06:29 +0000 (00:06 -0700)]
remove unneeded imports

2 years agoadd byte_reverse formal proof
Jacob Lifshay [Thu, 4 Aug 2022 07:05:17 +0000 (00:05 -0700)]
add byte_reverse formal proof

2 years agoadd important note to byte_reverse's docs
Jacob Lifshay [Thu, 4 Aug 2022 07:04:45 +0000 (00:04 -0700)]
add important note to byte_reverse's docs

2 years agowrite output directory for formal test failures
Jacob Lifshay [Thu, 4 Aug 2022 07:04:03 +0000 (00:04 -0700)]
write output directory for formal test failures

2 years agoadd BetterMultiPriorityPicker and formal proof
Jacob Lifshay [Thu, 4 Aug 2022 05:41:28 +0000 (22:41 -0700)]
add BetterMultiPriorityPicker and formal proof

2 years agosplit out sim_util.write_il from sim_util.do_sim
Jacob Lifshay [Thu, 4 Aug 2022 05:40:52 +0000 (22:40 -0700)]
split out sim_util.write_il from sim_util.do_sim

2 years agoadd formal proof for MultiPriorityPicker
Jacob Lifshay [Thu, 4 Aug 2022 04:09:53 +0000 (21:09 -0700)]
add formal proof for MultiPriorityPicker

2 years agoadd comment on redundancy in PriorityPicker's arguments
Jacob Lifshay [Wed, 3 Aug 2022 05:30:59 +0000 (22:30 -0700)]
add comment on redundancy in PriorityPicker's arguments

2 years agoformal test for PriorityPicker passes
Jacob Lifshay [Wed, 3 Aug 2022 05:25:17 +0000 (22:25 -0700)]
formal test for PriorityPicker passes

I had to rename PriorityPicker's lsb_mode=False argument to msb_mode,
since it was actually doing lsb-priority mode by default. Nothing came
up when searching for uses of the lsb_mode parameter.

2 years agoadd sync domain if it isn't already there, making it much easier to write tests
Jacob Lifshay [Mon, 4 Jul 2022 06:16:29 +0000 (23:16 -0700)]
add sync domain if it isn't already there, making it much easier to write tests

2 years agoadd smtbmc_opts argument to assertFormal to allow passing more solver flags
Jacob Lifshay [Tue, 28 Jun 2022 04:53:04 +0000 (21:53 -0700)]
add smtbmc_opts argument to assertFormal to allow passing more solver flags

2 years agoswitch smtlib2 logic to ALL to support floats
Jacob Lifshay [Fri, 24 Jun 2022 23:53:39 +0000 (16:53 -0700)]
switch smtlib2 logic to ALL to support floats

2 years agopin some dependency versions
Jacob Lifshay [Thu, 12 May 2022 01:14:57 +0000 (18:14 -0700)]
pin some dependency versions

2 years agostop possibility of infinite recursion in stages which
Luke Kenneth Casson Leighton [Wed, 11 May 2022 10:17:16 +0000 (11:17 +0100)]
stop possibility of infinite recursion in stages which
set "stage = self"

2 years agorename proof_clz.py -> test_clz.py so it's run by pytest
Jacob Lifshay [Tue, 10 May 2022 01:41:54 +0000 (18:41 -0700)]
rename proof_clz.py -> test_clz.py so it's run by pytest

2 years agofix .gitlab-ci.yml
Jacob Lifshay [Tue, 10 May 2022 01:40:17 +0000 (18:40 -0700)]
fix .gitlab-ci.yml

2 years agorewrite test_clz.py to actually test both CLZ and clz.
Jacob Lifshay [Thu, 5 May 2022 05:50:00 +0000 (22:50 -0700)]
rewrite test_clz.py to actually test both CLZ and clz.

it didn't actually test any simulation outputs of CLZ before.

2 years agoadd clz function
Jacob Lifshay [Thu, 5 May 2022 05:49:37 +0000 (22:49 -0700)]
add clz function

2 years agofix RippleMSB
Jacob Lifshay [Thu, 5 May 2022 04:24:08 +0000 (21:24 -0700)]
fix RippleMSB

TODO: add tests

https://bugs.libre-soc.org/show_bug.cgi?id=798#c5

2 years agoRevert "add reduce_only option to prefix_sum_ops"
Jacob Lifshay [Fri, 22 Apr 2022 22:01:09 +0000 (15:01 -0700)]
Revert "add reduce_only option to prefix_sum_ops"

it doesn't work when the element count isn't a power-of-2

This reverts commit c4357f7839c612a9c560a2bda14c34af6adee87b.

2 years agoadd reduce_only option to prefix_sum_ops
Jacob Lifshay [Fri, 22 Apr 2022 21:53:06 +0000 (14:53 -0700)]
add reduce_only option to prefix_sum_ops

2 years agoautoformat code
Jacob Lifshay [Fri, 22 Apr 2022 21:47:50 +0000 (14:47 -0700)]
autoformat code

2 years agowhitespace cleanup:
Luke Kenneth Casson Leighton [Sat, 9 Apr 2022 05:47:39 +0000 (06:47 +0100)]
whitespace cleanup:
* 80-char limit
* {code} {semi-colon} {docstring} reduces line-count, increases clarity
nothing can be done about URLs greater than 80 chars unfortunately

2 years agoadd prefix sum render tests
Jacob Lifshay [Sat, 9 Apr 2022 03:01:24 +0000 (20:01 -0700)]
add prefix sum render tests

2 years agoadd prefix_sum and initial tests
Jacob Lifshay [Sat, 9 Apr 2022 02:47:50 +0000 (19:47 -0700)]
add prefix_sum and initial tests

2 years agoadd SPDX-License-Identifier comments rather than using License:
Jacob Lifshay [Fri, 8 Apr 2022 23:26:58 +0000 (16:26 -0700)]
add SPDX-License-Identifier comments rather than using License:

2 years agoformat code
Jacob Lifshay [Fri, 8 Apr 2022 23:23:51 +0000 (16:23 -0700)]
format code

2 years agoformat and move comment block into fake docstring
Jacob Lifshay [Fri, 8 Apr 2022 23:15:41 +0000 (16:15 -0700)]
format and move comment block into fake docstring

otherwise autopep8 tries to move the comments to the top of the
file and smush the imports right against like()

2 years agoadd default argument fn=None to treereduce (identity operation)
Luke Kenneth Casson Leighton [Tue, 5 Apr 2022 14:38:14 +0000 (15:38 +0100)]
add default argument fn=None to treereduce (identity operation)
clean up docstring

2 years agocreate Ripple module, now joined by RippleMSB
Luke Kenneth Casson Leighton [Tue, 5 Apr 2022 10:30:10 +0000 (11:30 +0100)]
create Ripple module, now joined by RippleMSB

2 years agomove clmul files into nmigen-gf.git
Jacob Lifshay [Mon, 4 Apr 2022 05:42:27 +0000 (22:42 -0700)]
move clmul files into nmigen-gf.git

https://git.libre-soc.org/?p=nmigen-gf.git;a=commit;h=926798b6e232f09a36773be07de2d90e3fd431a4
src/nmutil/clmul.py => nmigen-gf.git/src/nmigen_gf/hdl/clmul.py
src/nmutil/test/test_clmul.py => nmigen-gf.git/src/nmigen_gf/hdl/test/test_clmul.py

2 years agofix accidentally wrong copyright year
Jacob Lifshay [Fri, 25 Mar 2022 03:26:43 +0000 (20:26 -0700)]
fix accidentally wrong copyright year

2 years agoadd CLMulAdd and tests
Jacob Lifshay [Wed, 23 Mar 2022 05:41:29 +0000 (22:41 -0700)]
add CLMulAdd and tests

2 years agoadd il generation by default
Jacob Lifshay [Tue, 1 Mar 2022 22:52:30 +0000 (14:52 -0800)]
add il generation by default

2 years agoFixed input shift reg signal name
Andrey Miroshnikov [Tue, 15 Feb 2022 11:35:59 +0000 (11:35 +0000)]
Fixed input shift reg signal name

2 years agoadd lut2 ilang output to lut.py to help testing
Luke Kenneth Casson Leighton [Sun, 13 Feb 2022 17:34:13 +0000 (17:34 +0000)]
add lut2 ilang output to lut.py to help testing

2 years agostore latch next in temporary
Luke Kenneth Casson Leighton [Mon, 31 Jan 2022 16:13:15 +0000 (16:13 +0000)]
store latch next in temporary

2 years agoremove unused import
Jacob Lifshay [Thu, 6 Jan 2022 02:14:39 +0000 (18:14 -0800)]
remove unused import

2 years agoPLRU interface signals (acc_i and acc_en) were reversed
Luke Kenneth Casson Leighton [Wed, 5 Jan 2022 14:23:13 +0000 (14:23 +0000)]
PLRU interface signals (acc_i and acc_en) were reversed
(no unit test exists for this module yet)

2 years agouse bit_length rather than log2_int function in mask.py
Luke Kenneth Casson Leighton [Wed, 5 Jan 2022 14:14:29 +0000 (14:14 +0000)]
use bit_length rather than log2_int function in mask.py

2 years agoredo grev
Jacob Lifshay [Thu, 23 Dec 2021 04:43:52 +0000 (20:43 -0800)]
redo grev

2 years agoremove redundant comments/docs
Jacob Lifshay [Thu, 23 Dec 2021 00:25:57 +0000 (16:25 -0800)]
remove redundant comments/docs

2 years agoadd additional command in comment
Jacob Lifshay [Wed, 22 Dec 2021 04:09:41 +0000 (20:09 -0800)]
add additional command in comment

2 years agorewrite TreeBitwiseLut to actually use a tree rather than a dict, hopefully making...
Jacob Lifshay [Wed, 22 Dec 2021 04:02:12 +0000 (20:02 -0800)]
rewrite TreeBitwiseLut to actually use a tree rather than a dict, hopefully making the code much easier to follow

2 years agomove writing rtlil into do_sim
Jacob Lifshay [Wed, 22 Dec 2021 03:57:15 +0000 (19:57 -0800)]
move writing rtlil into do_sim

2 years agoadd copyright notices
Jacob Lifshay [Wed, 22 Dec 2021 01:12:14 +0000 (17:12 -0800)]
add copyright notices

email and (C) aren't required according to https://www.gnu.org/licenses/gpl-howto.html

2 years agoremove unnecessary <no space here> messages
Jacob Lifshay [Wed, 22 Dec 2021 01:02:34 +0000 (17:02 -0800)]
remove unnecessary <no space here> messages

2 years agoformat code
Jacob Lifshay [Wed, 22 Dec 2021 00:58:24 +0000 (16:58 -0800)]
format code

2 years agoinput is a keyword in python
Luke Kenneth Casson Leighton [Fri, 17 Dec 2021 23:01:35 +0000 (23:01 +0000)]
input is a keyword in python

2 years agoinput is a keyword in python
Luke Kenneth Casson Leighton [Fri, 17 Dec 2021 22:55:19 +0000 (22:55 +0000)]
input is a keyword in python

2 years agocleanup chunk_size and list of steps in GRev
Luke Kenneth Casson Leighton [Fri, 17 Dec 2021 22:43:53 +0000 (22:43 +0000)]
cleanup chunk_size and list of steps in GRev

2 years agoadd NLnet Grant References
Luke Kenneth Casson Leighton [Fri, 17 Dec 2021 21:55:37 +0000 (21:55 +0000)]
add NLnet Grant References

2 years ago* moved the grev formal correctness assertions into the module
Luke Kenneth Casson Leighton [Fri, 17 Dec 2021 21:52:14 +0000 (21:52 +0000)]
* moved the grev formal correctness assertions into the module
  (under the protection of "if platform == formal")
* moved grev assert on internal variable (dut._steps) inside the
  unit test process() function so that it is after the elaborate()
  which is where ._steps gets created
  (this keeps Grev._steps a private variable for unit tests only)
* added TODO comment about the copyright notice at the top of test_grev.py

2 years agomore code-comments on BitwiseLut
Luke Kenneth Casson Leighton [Fri, 17 Dec 2021 12:24:07 +0000 (12:24 +0000)]
more code-comments on BitwiseLut
also minor rewrite/style to avoid yosys creating large copies
of expressions (store in temporary signals).
the temp signals have the advantage of drastically simplifying and
clarifying the yosys graphviz output, making it easier to visually
inspect the correctness of the HDL

2 years agorewrite GRev. put in code-comments and some more TODOs
Luke Kenneth Casson Leighton [Fri, 17 Dec 2021 12:22:27 +0000 (12:22 +0000)]
rewrite GRev. put in code-comments and some more TODOs

2 years agoclean up rest of grev.py docs
Jacob Lifshay [Fri, 17 Dec 2021 03:27:06 +0000 (19:27 -0800)]
clean up rest of grev.py docs

2 years agoclarify docs
Jacob Lifshay [Fri, 17 Dec 2021 03:23:26 +0000 (19:23 -0800)]
clarify docs

2 years agoclarify docstring
Jacob Lifshay [Fri, 17 Dec 2021 03:14:33 +0000 (19:14 -0800)]
clarify docstring

2 years agoadd grev test and formal proof
Jacob Lifshay [Fri, 17 Dec 2021 03:12:54 +0000 (19:12 -0800)]
add grev test and formal proof

2 years agoclean up grev
Jacob Lifshay [Fri, 17 Dec 2021 03:12:39 +0000 (19:12 -0800)]
clean up grev

2 years agomove do_sim and hash_256 to separate module
Jacob Lifshay [Fri, 17 Dec 2021 01:37:26 +0000 (17:37 -0800)]
move do_sim and hash_256 to separate module

2 years agoadd docs
Jacob Lifshay [Fri, 17 Dec 2021 01:21:32 +0000 (17:21 -0800)]
add docs

2 years agosimplify lut.py
Jacob Lifshay [Fri, 17 Dec 2021 01:20:50 +0000 (17:20 -0800)]
simplify lut.py

2 years agowhoops just step through i not list
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 14:35:07 +0000 (14:35 +0000)]
whoops just step through i not list

2 years agoremove the pre-added array, remove the sub-function (sub-functions
Luke Kenneth Casson Leighton [Sun, 12 Dec 2021 14:32:24 +0000 (14:32 +0000)]
remove the pre-added array, remove the sub-function (sub-functions
are a bit... naff), accumulate the list on-demand, provide comments
about what that list is for

2 years agomore comments
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 15:57:05 +0000 (15:57 +0000)]
more comments
reason: understanding lambda networks (aka butterfly aka generalised-rev)
is a bit of a pig

2 years agosome more hints/comments
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 15:37:35 +0000 (15:37 +0000)]
some more hints/comments

2 years agoadd some comments (locations for comments to be added)
Luke Kenneth Casson Leighton [Sat, 11 Dec 2021 15:29:09 +0000 (15:29 +0000)]
add some comments (locations for comments to be added)

2 years agoadd initial grev implementation
Jacob Lifshay [Fri, 10 Dec 2021 23:42:11 +0000 (15:42 -0800)]
add initial grev implementation

2 years agoremove unused import
Jacob Lifshay [Fri, 10 Dec 2021 23:30:44 +0000 (15:30 -0800)]
remove unused import

2 years agofix to nmutil workaround for detecting new Simulator API
Luke Kenneth Casson Leighton [Wed, 8 Dec 2021 12:48:11 +0000 (12:48 +0000)]
fix to nmutil workaround for detecting new Simulator API
the engine argument if already provided, just use that

2 years agoadd a PLRUs module which selects between multiple PLRUs
Luke Kenneth Casson Leighton [Mon, 6 Dec 2021 17:00:56 +0000 (17:00 +0000)]
add a PLRUs module which selects between multiple PLRUs

2 years agoadd nmigen/_toolchain/__init__ as toolchain.py to avoid depending on internal API
Jacob Lifshay [Thu, 2 Dec 2021 01:50:41 +0000 (17:50 -0800)]
add nmigen/_toolchain/__init__ as toolchain.py to avoid depending on internal API

2 years agoremove redundant overrides of stuff that's aready in unittest in python >=3.7
Jacob Lifshay [Thu, 2 Dec 2021 01:44:22 +0000 (17:44 -0800)]
remove redundant overrides of stuff that's aready in unittest in python >=3.7

2 years agoadd missing import Statement for assertRepr
Jacob Lifshay [Thu, 2 Dec 2021 01:39:40 +0000 (17:39 -0800)]
add missing import Statement for assertRepr

2 years agochange FHDLTestCase to use get_test_path
Jacob Lifshay [Thu, 2 Dec 2021 01:26:13 +0000 (17:26 -0800)]
change FHDLTestCase to use get_test_path

Fixes the issue with FHDLTestCase sometimes using the same directory for
different test cases, causing problems for running tests in parallel.

2 years agoswitch test_lut to use FHDLTestCase
Jacob Lifshay [Thu, 2 Dec 2021 01:24:18 +0000 (17:24 -0800)]
switch test_lut to use FHDLTestCase