Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: Libre-RISCV General Development <libre-riscv-dev@lists.libre-riscv.org>
Subject: Re: [libre-riscv-dev] teaching the benefits of using nmigen over VHDL/Verilog
Date: Wed, 13 May 2020 19:18:06 +0100
Message-ID: <CAPweEDz9dQ1oRxTa+7hJGMyPdk2iDQAwN8LhP3v8iFe=Wef7OQ@mail.gmail.com> (raw)
In-Reply-To: <CAC2bXD7R_hA-6HhNP_kimq3YCgzUoq0o4_ch4x1bS2XUGMnwVQ@mail.gmail.com>

On Wednesday, May 13, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:

> On Tue, May 12, 2020, 08:04 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> wrote:
>
> > the next level up from that would be to say, "ok now do a 128-bit
> > adder", and they will struggle to create efficient-looking code in
> > VHDL, because they will end up cut/pasting 128 full-adders into the
> > file.  the point of *that* exercise being to point out to them that
> > VHDL (and verilog) are *not* adequate modern languages (they never
> > were), and that nmigen you can use a *python for-loop* to create - and
> > link up - the 128 full-adders.
> >
>
> That may not be an adequate demonstration, since a 128-bit ripple adder can
> be implemented in a few lines using the following pseudo-Verilog:
>
> module full_adder(a, b, c_in, c_out, o);
>     wire [127:0] a, b, c_in, c_out, o;
>     assign o = a ^ b ^ c_in;
>     assign c_out = (a & b) | (a & c_in) | (b & c_in);
> endmodule


that's the simple version (and a cool one), i was thinking in terms of a
suite of single-bit full adders that then need to be manually linked up.

in verilog or vhdl this is a total pain.

in nmigen it is just a for loop with setattr(m.submodules, "fulladd%d" % i,
fainstance)

the very simplicity of doing a full adder is why it would work as a rapid
demonstration of using python for HDL.

if the exercise were more complex the design of the submodule would
distract from the point.

l.



-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 10:45 [libre-riscv-dev] daily kan-ban update 12may2020 Luke Kenneth Casson Leighton
2020-05-12 14:00 ` Tobias Platen
2020-05-12 14:28 ` Michael Nolan
2020-05-12 14:53   ` Luke Kenneth Casson Leighton
2020-05-12 14:42 ` Yehowshua
2020-05-12 15:03   ` Luke Kenneth Casson Leighton
2020-05-13 17:49     ` [libre-riscv-dev] teaching the benefits of using nmigen over VHDL/Verilog Jacob Lifshay
2020-05-13 18:18       ` Luke Kenneth Casson Leighton [this message]
2020-05-13 18:51         ` Michael Nolan
2020-05-13 19:02           ` Jacob Lifshay
2020-05-13 19:54           ` Luke Kenneth Casson Leighton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPweEDz9dQ1oRxTa+7hJGMyPdk2iDQAwN8LhP3v8iFe=Wef7OQ@mail.gmail.com' \
    --to=lkcl@lkcl.net \
    --cc=libre-riscv-dev@lists.libre-riscv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Libre RISC-V Mailing list Archives (accessible via public-inbox)

Archives are clonable: git clone --mirror https://inbox.libre-soc.org/libre-riscv-dev

Example config snippet for mirrors


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git