Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* Re: [libre-riscv-dev] daily kan-ban update 13may2020
From: Tobias Platen @ 2020-05-13 13:56 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAPweEDz8rcJ7ENbJS5tk3pCs7TDSPx11=7cOPFwxRaTBbtW_wg@mail.gmail.com>

On Wed, 13 May 2020 11:28:25 +0100
Luke Kenneth Casson Leighton <lkcl@lkcl.net> wrote:

> yesterday i started on integrating the LDSTCompUnit into the
> scoreboard and immediately ran into a brick wall in the form of the
> address-request/release signalling.  when go_addr is raised (in
> response to req_addr), the LDSTCompUnit is supposed to drop req_addr
> one cycle later: instead it stays high.
> 
> i also investigated microwatt to find out what the heck is going on
> with the register-order-swapping.  turns out that different classes of
> operations (logical, rotate, arith) have different ordering.  why? who
> knows.
> 
> today i will continue working through the address-negotiation in LDSTCompUnit.
> 
> l.
> 
> _______________________________________________
> libre-riscv-dev mailing list
> libre-riscv-dev@lists.libre-riscv.org
> http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

I've looked into the soc/src/soc/decoder/isa and src/soc/alu/ directories.
There is a TODO that references the PowerISA PDF, so I will first read the 
following sections, before writing anything.
        # 4.2.2 p124 FPSCR (definitely "separate" - not in SPR)
        #            note that mffs, mcrfs, mtfsf "manage" this FPSCR
        # 2.3.1 CR (and sub-fields CR0..CR6 - CR0 SO comes from XER.SO)
        #         note that mfocrf, mfcr, mtcr, mtocrf, mcrxrx "manage" CRs
        # 2.3.2 LR   (actually SPR #8)
        # 2.3.3 CTR  (actually SPR #9)
        # 2.3.4 TAR  (actually SPR #815)
        # 3.2.2 p45 XER  (actually SPR #0)
        # 3.2.3 p46 p232 VRSAVE (actually SPR #256)
I assume that that the version of the pdf referenced is still 3.0 one and not 3.1 recently released.
       
Tobias

-- 
Tobias Platen <libre-soc[at]platen-software[dot]de>

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] daily kan-ban update 13may2020
From: Luke Kenneth Casson Leighton @ 2020-05-13 14:33 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <20200513155647.d30fe7986374bed381ba8360@platen-software.de>

---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68

On Wed, May 13, 2020 at 2:56 PM Tobias Platen
<libre-soc@platen-software.de> wrote:
>
> On Wed, 13 May 2020 11:28:25 +0100
> Luke Kenneth Casson Leighton <lkcl@lkcl.net> wrote:
>
> > yesterday i started on integrating the LDSTCompUnit into the
> > scoreboard and immediately ran into a brick wall in the form of the
> > address-request/release signalling.  when go_addr is raised (in
> > response to req_addr), the LDSTCompUnit is supposed to drop req_addr
> > one cycle later: instead it stays high.
> >
> > i also investigated microwatt to find out what the heck is going on
> > with the register-order-swapping.  turns out that different classes of
> > operations (logical, rotate, arith) have different ordering.  why? who
> > knows.
> >
> > today i will continue working through the address-negotiation in LDSTCompUnit.
> >
> > l.
> >
> > _______________________________________________
> > libre-riscv-dev mailing list
> > libre-riscv-dev@lists.libre-riscv.org
> > http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
>
> I've looked into the soc/src/soc/decoder/isa and src/soc/alu/ directories.
> There is a TODO that references the PowerISA PDF, so I will first read the
> following sections, before writing anything.

a really useful self-contained sub-task would be to convert this to nmigen:
https://github.com/antonblanchard/microwatt/blob/master/countzero.vhdl

focussing on that would allow you to do something immediately that did
not require a lot of background reading or preparation, and yet is really
important and valuable, and can be done fast.

you can see what i did with rotator.py to get a feel for how that's done.
these are two really important gotchas to watch out for:

* signal(HI downto LO) must be converted to signal[LO:HI+1]  **NOTE
THE ADD ONE**
* A & B & C must be converted to Cat(C, B, A)

as this is only 140 lines of code, if you plan to - or imagine that -
the time taken
is greater than 60 to 90 minutes to complete a first cut (which should be
committed immediately), then something is wrong.  this is a half to one day
task, absolute max.

going on from there - beyond that half-day:

if you can also write a formal proof, these we can donate more, where for
the "main core" - just the countzero - we are running low from that budget.
formal proofs are basically "a bunch of asserts" exactly as you would have
in c++ code or any other language with "assert if this is true or not".

>         # 4.2.2 p124 FPSCR (definitely "separate" - not in SPR)
>         #            note that mffs, mcrfs, mtfsf "manage" this FPSCR
>         # 2.3.1 CR (and sub-fields CR0..CR6 - CR0 SO comes from XER.SO)
>         #         note that mfocrf, mfcr, mtcr, mtocrf, mcrxrx "manage" CRs
>         # 2.3.2 LR   (actually SPR #8)
>         # 2.3.3 CTR  (actually SPR #9)
>         # 2.3.4 TAR  (actually SPR #815)
>         # 3.2.2 p45 XER  (actually SPR #0)
>         # 3.2.3 p46 p232 VRSAVE (actually SPR #256)
> I assume that that the version of the pdf referenced is still 3.0 one and not 3.1 recently released.

correct.

l.

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] daily kan-ban update 13may2020
From: Tobias Platen @ 2020-05-13 14:43 UTC (permalink / raw)
  To: Libre-RISCV General Development; +Cc: Luke Kenneth Casson Leighton
In-Reply-To: <CAPweEDw+JVQPF6f=MXK-PTcFpqTk8z_j0p4ZFYgG0qBK9raX7A@mail.gmail.com>

On Wed, 13 May 2020 15:33:53 +0100
Luke Kenneth Casson Leighton <lkcl@lkcl.net> wrote:

> a really useful self-contained sub-task would be to convert this to nmigen:
> https://github.com/antonblanchard/microwatt/blob/master/countzero.vhdl
I think I could do this in an hour or less.

-- 
Tobias Platen <libre-soc[at]platen-software[dot]de>

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] daily kan-ban update 13may2020
From: Luke Kenneth Casson Leighton @ 2020-05-13 15:03 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <20200513164341.19d30999fa7607f985b2b842@platen-software.de>

On Wed, May 13, 2020 at 3:43 PM Tobias Platen
<libre-soc@platen-software.de> wrote:
>
> On Wed, 13 May 2020 15:33:53 +0100
> Luke Kenneth Casson Leighton <lkcl@lkcl.net> wrote:
>
> > a really useful self-contained sub-task would be to convert this to nmigen:
> > https://github.com/antonblanchard/microwatt/blob/master/countzero.vhdl
> I think I could do this in an hour or less.

ok great.  create a directory in soc.git, src/soc/countzero to work in.
don't commit the VHDL to the repo, reference it in a comment at the top
of countzero.py

also useful as a "very basic" simulation and confirmation of functionality
i'd recommend doing a unit test similar to countzero_tb.vhdl

l.

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] [Bug 309] investigate OpenTITAN
From: bugzilla-daemon @ 2020-05-13 16:21 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-309-13@https.bugs.libre-soc.org/>

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

Jacob Lifshay <programmerjake@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |programmerjake@gmail.com

--- Comment #1 from Jacob Lifshay <programmerjake@gmail.com> ---
The entropy source they currently have is a placeholder LFSR source, which is
well known to be insecure.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] [Bug 309] investigate OpenTITAN
From: bugzilla-daemon @ 2020-05-13 16:44 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-309-13@https.bugs.libre-soc.org/>

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

--- Comment #2 from Jacob Lifshay <programmerjake@gmail.com> ---
If we can get away with using a few op-amps, I quite like the infinite noise HW
entropy source:
https://github.com/waywardgeek/infnoise

See also:
https://github.com/alwynallan/redoubler

I've built a similar circuit on a breadboard before and it works quite well,
though didn't test the entropy quality since I didn't connect it to a computer.

It has the nice features of not being finicky (unlike quite a lot of other
entropy sources) as well as not breaking down when there is a lot of
environmental noise (perhaps from an attacker).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] [Bug 305] Create Pipelined ALU similar to alu_hier.py
From: bugzilla-daemon @ 2020-05-13 16:46 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-305-13@https.bugs.libre-soc.org/>

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

--- Comment #50 from Michael Nolan <mtnolan2640@gmail.com> ---
I tried using the rotator.py taken from microwatt, and it seems it doesn't
work. After fixing some syntax errors, I set the inputs up for a left shift,
and it did not output what I expected. I spent around 45 minutes setting up a
testbench for microwatt's rotator.vhdl, and it behaves correctly for the same
inputs.

Considering that I have already written a working shifter, is it worthwhile
trying to get this one to work?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] [Bug 305] Create Pipelined ALU similar to alu_hier.py
From: bugzilla-daemon @ 2020-05-13 17:22 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-305-13@https.bugs.libre-soc.org/>

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

--- Comment #51 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #50)
> I tried using the rotator.py taken from microwatt, and it seems it doesn't
> work. After fixing some syntax errors, I set the inputs up for a left shift,
> and it did not output what I expected. I spent around 45 minutes setting up
> a testbench for microwatt's rotator.vhdl, and it behaves correctly for the
> same inputs.

i may have messed things up in the translation from VHDL to nmigen, i didn't
write a unit test for it.

> Considering that I have already written a working shifter, is it worthwhile
> trying to get this one to work?

there are some significant elegant aspects of the microwatt-based one, namely
that it covers *all* shift operations in that short and compact code.  it uses
the trick of having only 1 64-bit shifter (ROTL) instance, putting the 32-bit
data in *twice* - once into the top 32-bit and again into the bottom 32-bit -
reducing the amount of hardware needed to perform both 32 and 64 bit shifts
by at least 30%.

however if you feel that you can get something operational and compliant
quicker
than by debugging rotator.py then go for it.  we can look at clean-up and
merge,
later.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] [Bug 309] investigate OpenTITAN
From: bugzilla-daemon @ 2020-05-13 17:27 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-309-13@https.bugs.libre-soc.org/>

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

--- Comment #3 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
interesting, i think my friend phil has used something like this, for a better
source than /dev/random, for GPG and VPN usage.  i've designed cryptographic
algorithms so know how to test them to make sure they're indistinguishable
from white noise (dieharder, CSRC's STS)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] [Bug 305] Create Pipelined ALU similar to alu_hier.py
From: bugzilla-daemon @ 2020-05-13 17:29 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-305-13@https.bugs.libre-soc.org/>

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

--- Comment #52 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #50)
> I tried using the rotator.py taken from microwatt, and it seems it doesn't
> work. After fixing some syntax errors, I set the inputs up for a left shift,
> and it did not output what I expected.

can you commit what you have, i'm background-curious to see the output.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] teaching the benefits of using nmigen over VHDL/Verilog
From: Jacob Lifshay @ 2020-05-13 17:49 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDy_hRZj4EFaViq95kyKxjFb_nfQZX1OBKg9Zvde1YTmTw@mail.gmail.com>

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

module adder(a, b, c_in, c_out, o);
    wire [127:0] a, b, o, c;
    wire c_in, c_out;
    full_adder fa(
        .a: a,
        .b: b,
        .o: o,
        .c_in: {c[126:0], c_in},
        .c_out: c,
    );
    assign c_out = c[127];
endmodule

Jacob
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] [Bug 291] HDL Workflow and Coriolis2 chroot automated setup scripts
From: bugzilla-daemon @ 2020-05-13 17:58 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-291-13@https.bugs.libre-soc.org/>

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

--- Comment #9 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #8)
> (In reply to Cole Poirier from comment #7)
> > Ah, I'm realizing now that I really should have been using a hard-coded git
> > tag number.
> 
> ah - no, not exactly.  keep it simple for now.  the idea we came up with
> is to have a new (single) repo with git submodules.
> 
> the git branch/tag info will be encoded into the submodules.  this way,
> the script remains the same.
> 
> > Can you share your known-working git tag number for coriolis2 so
> > I can continue working on the script tomorrow?
> 
> wait for jean-paul to investigate:
> https://gitlab.lip6.fr/vlsi-eda/coriolis/-/issues/13

Ok, thank you for the explanation, makes much more sense to me now. I will move
on to the non-chroot part of the HDL workflow for now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] daily kan-ban update 13may2020
From: Cole Poirier @ 2020-05-13 18:07 UTC (permalink / raw)
  To: Libre-RISCV General Development; +Cc: Libre-RISCV General Development
In-Reply-To: <CAPweEDw0vX56mGdvDCJaykQbf3qAS3TLZryprnt5JpL4cggiDA@mail.gmail.com>

Yesterday, after several rounds of failed testing of the coriolis2
chroot setup script, I conclueded that coriolis2 currently has a bug in
it that I should wait on JP for (thank for helping me come to this
conclusion luke). Today I will work on the non-chroot HDL_Workflow setup script.

Cole

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] teaching the benefits of using nmigen over VHDL/Verilog
From: Luke Kenneth Casson Leighton @ 2020-05-13 18:18 UTC (permalink / raw)
  To: Libre-RISCV General Development
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

^ permalink raw reply

* Re: [libre-riscv-dev] note on memory operation requirements for linux
From: Luke Kenneth Casson Leighton @ 2020-05-13 18:41 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzS9kK2UQkLxwdBfQ-LahutQg2PPDUiSH2w+foO9MbxkQ@mail.gmail.com>

On Sat, May 9, 2020 at 12:11 AM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
>
> On Fri, May 8, 2020 at 8:15 PM Jacob Lifshay <programmerjake@gmail.com> wrote:
> >
> > I haven't checked but I'm 99% sure that we will need to implement standard
> > Power atomics, fences, ll/sc (including 128-bit version), cache flushes,
> > and non-cacheable load/store operations if we want to support Linux on our
> > october test chip.
>
> added  to page.  good catch.

3.1B (POWER10) doc says that atomics and so on are optional.  this is
good, although performance would suck.

l.

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] [Bug 305] Create Pipelined ALU similar to alu_hier.py
From: bugzilla-daemon @ 2020-05-13 18:46 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-305-13@https.bugs.libre-soc.org/>

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

--- Comment #53 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
you got it working, cool!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] [Bug 305] Create Pipelined ALU similar to alu_hier.py
From: bugzilla-daemon @ 2020-05-13 18:48 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-305-13@https.bugs.libre-soc.org/>

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

--- Comment #54 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
oops soc.shift_rotate.input_stage missing.  remember use "git status" to check
:)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] teaching the benefits of using nmigen over VHDL/Verilog
From: Michael Nolan @ 2020-05-13 18:51 UTC (permalink / raw)
  To: libre-riscv-dev
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

^ permalink raw reply

* [libre-riscv-dev] [Bug 305] Create Pipelined ALU similar to alu_hier.py
From: bugzilla-daemon @ 2020-05-13 18:57 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-305-13@https.bugs.libre-soc.org/>

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

--- Comment #55 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Luke Kenneth Casson Leighton from comment #54)
> oops soc.shift_rotate.input_stage missing.  remember use "git status" to
> check :)

got it.... :)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] teaching the benefits of using nmigen over VHDL/Verilog
From: Jacob Lifshay @ 2020-05-13 19:02 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <48c106bb-90f0-3d67-6021-a9e1c2190faa@gmail.com>

On Wed, May 13, 2020, 11:52 Michael Nolan <mtnolan2640@gmail.com> wrote:

> 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.
>

Maybe a better (though maybe not realistic) example is trying to xor all
input bits where the bits' indexes are prime numbers, that would be
relatively easy in nmigen but quite hard in VHDL or Verilog.

Jacob

>
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] teaching the benefits of using nmigen over VHDL/Verilog
From: Luke Kenneth Casson Leighton @ 2020-05-13 19:54 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <48c106bb-90f0-3d67-6021-a9e1c2190faa@gmail.com>

On Wednesday, May 13, 2020, Michael Nolan <mtnolan2640@gmail.com> wrote:

> 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.


oh! nice! i kinda learned them both by osmosis :)

so it would be a side by side comparison of how to do submodules.

i wonder where it gets really difficult (primes is a nice example, jacob).

i know.  something where you pass in different Record layouts in nmigen.
VHDL you would have to do macro substitution of the record type, and only
mentor graphics sv supports records as arguments to modules.

then the next horrible thing to do would be a multiple inheritance python
module, or, like in the FP code surrounding ctx and pspec, use dynamic
classes that override __new__.

first time i did something like that and actually had to ask on
stackoverflow :)

even just passing in the class (ctx kls) would cause a seasoned verilog HDL
engineer to blow a fuse :)

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

^ permalink raw reply

* [libre-riscv-dev] [Bug 305] Create Pipelined ALU similar to alu_hier.py
From: bugzilla-daemon @ 2020-05-13 21:54 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-305-13@https.bugs.libre-soc.org/>

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

--- Comment #56 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
you probably noticed, i split out Logical operations into a separate
pipeline, mirroring logical.vhdl
https://github.com/antonblanchard/microwatt/blob/master/logical.vhdl

popcount, parity, i've added TODO.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* Re: [libre-riscv-dev] daily kan-ban update 13may2020
From: Luke Kenneth Casson Leighton @ 2020-05-13 22:02 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDw0vX56mGdvDCJaykQbf3qAS3TLZryprnt5JpL4cggiDA@mail.gmail.com>

tobias: encoder, in countzero.vhdl, is PriorityEncoder in nmigen.
however you have to invert the input bits for right-mode input[::-1]
or something like that.  there may be a function for it in nmigen

l.

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

* [libre-riscv-dev] popcount and parity
From: Luke Kenneth Casson Leighton @ 2020-05-13 22:20 UTC (permalink / raw)
  To: Libre-RISCV General Development

jacob would you like to do popcount and parity, i remember you
mentioned a "best work" algorithm somewhere (referenced a wikipedia
page)? it resonated with me that it might be nice to add a general
class (of some kind) to nmutil for use in doing things like... ooo....
popcount.

here's where the two functions are in microwatt, feel free to use this
as a guide:
https://github.com/antonblanchard/microwatt/blob/master/logical.vhdl

and here's where they need to go in the logical pipeline:
https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/logical/main_stage.py;h=622216bbf5c8d9f80e1ad04f0903f5b27e0f7102;hb=HEAD#l41

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

^ permalink raw reply

* [libre-riscv-dev] [Bug 305] Create Pipelined ALU similar to alu_hier.py
From: bugzilla-daemon @ 2020-05-14  0:20 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-305-13@https.bugs.libre-soc.org/>

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

--- Comment #57 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
https://git.libre-soc.org/?p=soc.git;a=commitdiff;h=de6e2485dff057322f6686ddeba6458b63a47159

ah well spotted, the correct field

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply

page:   latest

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