[libre-riscv-dev] partitioned compare and mux

Jacob Lifshay programmerjake at gmail.com
Fri Feb 7 19:22:47 GMT 2020


On Fri, Feb 7, 2020 at 11:12 AM Luke Kenneth Casson Leighton
<lkcl at lkcl.net> wrote:
>
> On Fri, Feb 7, 2020 at 6:06 PM Jacob Lifshay <programmerjake at gmail.com> wrote:
>
> > Rather than adding subtract and negate modes, i think it would be more
> > worthwhile to implement carry-in/carry-out.
>
> because carry-in would be the "+1".  and ~b is just a straight bit-invert.

My point is that subtract and negate are kind-of special cases of
addition, it seems better to generalize all the way to add with
carry-in/out and then build a PartitionedAddSub built around the
extended PartitionedAdder that does the carry-in (with it optional for
borrow-in) and per-element selectable b inversion. yosys would just
simplify the resulting gates (a trivial transformation of ~0 xor b to
~b) for cases where it always subtracts.

Jacob



More information about the libre-riscv-dev mailing list