+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+"""
+
from nmigen import Signal, Cat
# TODO: turn this into a module
""" This module is much more efficient than PriorityEncoder
although it is functionally identical.
see https://bugs.libre-soc.org/show_bug.cgi?id=326
+
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
"""
class CLZ(Elaboratable):
""" concurrent unit from mitch alsup augmentations to 6600 scoreboard
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
* data fans in
* data goes through a pipeline
* results fan back out.
the output data format has to have a member "muxid", which is used
as the array index on fan-out
+
+ Associated bugreports:
+
+ * https://bugs.libre-soc.org/show_bug.cgi?id=538
"""
from math import log
def num_bits(n):
return int(log(n) / log(2))
+
class PipeContext:
def __init__(self, pspec):
+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
+"""
+
from copy import copy
# this is a POWER ISA 3.0B compatible *signed* div function
# however it is also the c, c++, rust, java *and* x86 way of doing things
""" Meta-class that allows a dynamic runtime parameter-selectable "mixin"
+ This work is funded through NLnet under Grant 2019-02-012
+
The reasons why this technique is being deployed is because SimpleHandshake
needs to be dynamically replaced at the end-users' choice, without having
to duplicate dozens of classes using multiple-inheritanc "Mix-in" techniques.
+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
+"""
from nmigen import Repl, Cat, Const
+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
+"""
from vcd.gtkw import GTKWSave, GTKWColor
from math import log2
""" IO Control API
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
Associated development bugs:
+ * http://bugs.libre-riscv.org/show_bug.cgi?id=538
* http://bugs.libre-riscv.org/show_bug.cgi?id=148
* http://bugs.libre-riscv.org/show_bug.cgi?id=64
* http://bugs.libre-riscv.org/show_bug.cgi?id=57
+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
+"""
from nmigen.compat.sim import run_simulation
from nmigen.cli import verilog, rtlil
from nmigen import Record, Signal, Module, Const, Elaboratable, Mux
+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
+"""
+
from nmigen import Module, Signal, Elaboratable
from nmigen.utils import log2_int
""" Combinatorial Multi-input and Multi-output multiplexer blocks
conforming to Pipeline API
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
Multi-input is complex because if any one input is ready, the output
can be ready, and the decision comes from a separate module.
and the selection is just a mux. The only proviso (difference) being:
the outputs not being selected have to have their ready_o signals
DEASSERTED.
+
+ https://bugs.libre-soc.org/show_bug.cgi?id=538
"""
from math import log
""" nmigen operator functions / utils
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
eq:
--
""" Priority Picker: optimised back-to-back PriorityEncoder and Decoder
and MultiPriorityPicker: cascading mutually-exclusive pickers
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
PriorityPicker: the input is N bits, the output is N bits wide and
only one is enabled.
+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
+"""
+
""" Example 5: Making use of PyRTL and Introspection. """
from collections.abc import Sequence
+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+ Associated bugreports:
+ * https://bugs.libre-soc.org/show_bug.cgi?id=538
+
+"""
+
from nmigen import Elaboratable
from ieee754.pipeline import DynamicPipe
from nmutil.singlepipe import StageChain
+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+"""
+
# need to ripple the starting LSB of each partition up through the
# rest of the partition. a Mux on the partition gate therefore selects
# either the current "thing" being propagated, or, if the gate is set open,
""" Pipeline API. For multi-input and multi-output variants, see multipipe.
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
Associated development bugs:
* http://bugs.libre-riscv.org/show_bug.cgi?id=148
* http://bugs.libre-riscv.org/show_bug.cgi?id=64
""" Stage API
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+
Associated development bugs:
* http://bugs.libre-riscv.org/show_bug.cgi?id=148
* http://bugs.libre-riscv.org/show_bug.cgi?id=64
+"""
+ This work is funded through NLnet under Grant 2019-02-012
+
+ License: LGPLv3+
+
+"""
+
from collections.abc import Iterable
from nmigen import Mux, Signal