From: Michael Nolan <mtnolan2640@gmail.com>
To: 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 14:51:48 -0400
Message-ID: <48c106bb-90f0-3d67-6021-a9e1c2190faa@gmail.com> (raw)
In-Reply-To: <CAPweEDz9dQ1oRxTa+7hJGMyPdk2iDQAwN8LhP3v8iFe=Wef7OQ@mail.gmail.com>
On 5/13/20 2:18 PM, Luke Kenneth Casson Leighton wrote:
> 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.
>
I agree it's easier to do in nmigen, but both verilog and vhdl support
generate statements for doing just that.
module wide_adder(o, a, b);
input [8:0] a;
input [8:0] b;
output [8:0] o;
genvar i;
wire [9:0] carries;
assign carries[0] = 0;
generate
for(i=0; i<9; i=i+1) begin
adder u0 (.o(o[i]), .carry_out(carries[i+1]),
.a(a[i]), .b(b[i]),
.carry_in(carries[i]));
end
endgenerate
endmodule
--Michael
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
next prev parent 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
2020-05-13 18:51 ` Michael Nolan [this message]
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=48c106bb-90f0-3d67-6021-a9e1c2190faa@gmail.com \
--to=mtnolan2640@gmail.com \
--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