Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* [libre-riscv-dev] [Bug 316] bperm TODO
From: bugzilla-daemon @ 2020-05-15 22:36 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #5 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Cole Poirier from comment #3)

>     m.d.comb += self.perm[i].eq(self.rb[index])
>   File "/home/colepoirier/src/nmigen/nmigen/hdl/ast.py", line 253, in
> __getitem__
>     raise TypeError("Cannot index value with {}".format(repr(key)))
> TypeError: Cannot index value with (slice (sig rs) 0:8)

err... err.... ah :)  rrrright, you need to use nmigen.Array.

basically:

* create a list of 64 signals, each 1-bit wide, for-loop, append them each to
the
  list
* assign 1 bit of rb into each of those 64 (signal_1_bit.eq(rb[i]) 
* create the array: rb8 = Array(my_list_of_64_signals)

*then* you can index them.

however... be aware that this is an absolutely truly dreadful way to do it :)
it will at least be functional and we can work on an improved design in a
second iteration.

basically it is absolutely awful because we are creating a *SIXTY FOUR* way
crossbar... actually 8 such 64-way crossbars!

this is pretty massive.

however... before completely freaking out, it is worthwhile seeing what
yosys actually generates (synth command).  it *might* actually generate
an efficient design.  we have to see.

if it really doesn't, then we can look around for alternatives.  there might
be something in clifford wolf's excellent bitmanip code.

but - go through with this as it is, then write a unit test.  you will then
have "something to test an alternative design against", 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

* Re: [libre-riscv-dev] Introduction and Questions
From: Luke Kenneth Casson Leighton @ 2020-05-15 22:47 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEoCstT7yZObkbS9GhWDRE7rm3p=Y5CzAJgYYj_3THCuRy=MCQ@mail.gmail.com>

On Fri, May 15, 2020 at 11:15 PM Jeremy Singher <thejsingher@gmail.com> wrote:
>
> > it's basically a Cray Vector Loop
> > (VL) except that VL, when set, actually *PAUSES* the Program Counter,
> > and issues MULTIPLE instructions - using the one at the PC as a
> > "template" - but incrementing the operand register numbers
> > sequentially on each iteration of the loop from 0 to VL-1.
>
> So if you decode a vadd instruction, with VL=4, and a 1-wide pipeline,
> the design would stall instruction fetch, and issue 4 "scalar" add
> micro-ops with incrementing register indices?

not micro-ops, *actual* scalar add ops.

> That seems like it
> should work, although you would lose the ability to exploit vector
> chaining, since pausing the PC would prevent additional instructions
> after the vector instruction from getting issued.

nope :)  because the Out-of-Order scoreboard takes care of them.
they're *literally* simply as if you had had 4x (or 8x, or 12x, or
16x) scalar ADD multi-issue instructions shoved into the execution
engine.

any following 4x instructions (or however many) *will* still have the
register numbers - different or otherwise - and thus *will* have the
Read and Write Dependency Hazard tracking applied to them.

it's basically c macros... applied to hardware.

> I looked a SimpleV a
> while ago, and to me it seemed like the difference vs a normal vector
> architecture was that SimpleV merged the vector and integer register
> files.

no, it's waaay more than that.

> > this has "implicit"
> > register-renaming automatically built-in to the design.  these are the
> > Function Unit operand latches.  they are best termed "nameless
> > registers" rather than "register-renaming".
>
> I think I understand what you are saying, my terminology for this is
> that the core is "renaming" registers into what you call inflight
> "nameless registers". At the end of the day, the point is that
> register data is stored not just in a logical register file,

correct... it is "in flight".  the distinction is important because a
lot of people try
to *explicitly* add register-renaming hardware, register caches, and *actually*
rename the registers by providing a PRF-ARF (physical / architectural)
register file naming scheme.

we maaay have to do that (because we will have a 128 entry regfile and
the Dependency Matrices need to be of the size of the actual regs in use).

however it will be to *DOWNSIZE* the register numbers... *NOT* "upsize"
them as is normally done with e.g. x86.

> and that
> the scheduler can aggressively execute instructions OOO when their
> operands are available, instead of in serializing execution in program
> order.

correct.

> How does the scoreboard handle a WAW hazard... two instructions
> writing the same register? Does the second instruction wait for the
> first to finish?

sigh over a year ago i understood this enough to be able to answer.
what we will have to do is simply ignore the optimisation opportunity.

> > Mitch Alsup had to write two
> > additional chapters, as an addendum to James Thornton's book, "Design
> > of a Computer", in order to correct Patterson's misinformation.
>
> Do you have a link to the addendum? I have a pdf of the book, but it
> doesn't seem to have the addendum.

no it does not.  you will need to state that you are happy to give
credit if you use the book chapters, and that if you pass them on you
will likewise ask the recipient to guarantee that they also will give
credit to Mitch Alsup.

these are the conditions under which i received the book chapters from
Mitch Alsup, and, as the Copyright holder, he is entitled to request
any conditions that he sees fit.

if that's ok with you then i can send the chapters on to you.

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] Introduction and Questions
From: Luke Kenneth Casson Leighton @ 2020-05-15 22:51 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <76EA8C4A-CE82-43D1-9D9B-A4EDED181318@gatech.edu>

On Fri, May 15, 2020 at 11:29 PM Yehowshua <yimmanuel3@gatech.edu> wrote:
>
> Luke, I’ll forward Jeremy the chapters.

ah.  remember that the conditions that we received them under - as
requested by their Copyright Holder - are that you MUST ask the
recipient to agree to give credit AND to request those same conditions
to be respected (recursively) by any recipients that *THEY* pass the
book chapters on to.

you are under the same conditions - which you agreed to when i passed
the book chapters on to you, and *unconditionally* passing them on to
Jeremy is a breach of those conditions.

if you have done that already - to him or to anyone else - then you
are actually in breach of Copyright Law.  you would need to then
approach Mitch Alsup, directly, as the Copyright holder, to re-request
his explicit permission to use and distribute his Copyrighted
material.

Copyright Law is the underpinning of everything that we are doing
(LGPL) so we absolutely must be extremely careful, respectful, and
knowledgeable about it.

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 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-05-15 23:49 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-313-13@https.bugs.libre-soc.org/>

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

--- Comment #18 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
while you're doing the cr pipe i'll sort out spr1/2/3 in branch.

-- 
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] Introduction and Questions
From: Jeremy Singher @ 2020-05-15 23:49 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzObJ1RXD51Y1D1WDJqsmsiNJKL1j-jDQqy0OwKLs6fdQ@mail.gmail.com>

> not micro-ops, *actual* scalar add ops.

I think we just have different terminology for this. To me, a micro-op
is the smallest unit of compute that is passed through a pipeline, and
a micro-op could indicate that the core should perform a scalar add
op. I'm happy with your explanation, though, thank you.

> it's basically c macros... applied to hardware.

Good analogy, thanks. The one concern I have is that this "vector op
fission" approach will pump the pipeline with tons and tons of
scalar-ops, while a traditional vector execution engine would not
deconstruct the vector instruction into many scalar instructions.

Does the vector pipeline use ALL the same execution resources as the
scalar pipeline? The same issue queues, functional units, read ports,
writeback paths?

> > How does the scoreboard handle a WAW hazard... two instructions
> > writing the same register? Does the second instruction wait for the
> > first to finish?

> sigh over a year ago i understood this enough to be able to answer.
> what we will have to do is simply ignore the optimisation opportunity.

Hmmm, ignoring WAW will significantly limit the ability of the core to
exploit ILP, which is one of the fundamental reasons for going OOO.

> no it does not.  you will need to state that you are happy to give
> credit if you use the book chapters, and that if you pass them on you
> will likewise ask the recipient to guarantee that they also will give
> credit to Mitch Alsup.

Of course, I'm glad to have the conditions of use AOT. Its incredibly
annoying when one is provided some information, only for the provider
of the info to come back months later and tell you "Remember that
document I sent you, yeah, make sure you never reference it in any
published work ever".

> Here are the chapters.

Thanks, Yehowshua.

Best,
Jeremy

On Fri, May 15, 2020 at 3:48 PM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
>
> On Fri, May 15, 2020 at 11:15 PM Jeremy Singher <thejsingher@gmail.com> wrote:
> >
> > > it's basically a Cray Vector Loop
> > > (VL) except that VL, when set, actually *PAUSES* the Program Counter,
> > > and issues MULTIPLE instructions - using the one at the PC as a
> > > "template" - but incrementing the operand register numbers
> > > sequentially on each iteration of the loop from 0 to VL-1.
> >
> > So if you decode a vadd instruction, with VL=4, and a 1-wide pipeline,
> > the design would stall instruction fetch, and issue 4 "scalar" add
> > micro-ops with incrementing register indices?
>
> not micro-ops, *actual* scalar add ops.
>
> > That seems like it
> > should work, although you would lose the ability to exploit vector
> > chaining, since pausing the PC would prevent additional instructions
> > after the vector instruction from getting issued.
>
> nope :)  because the Out-of-Order scoreboard takes care of them.
> they're *literally* simply as if you had had 4x (or 8x, or 12x, or
> 16x) scalar ADD multi-issue instructions shoved into the execution
> engine.
>
> any following 4x instructions (or however many) *will* still have the
> register numbers - different or otherwise - and thus *will* have the
> Read and Write Dependency Hazard tracking applied to them.
>
> it's basically c macros... applied to hardware.
>
> > I looked a SimpleV a
> > while ago, and to me it seemed like the difference vs a normal vector
> > architecture was that SimpleV merged the vector and integer register
> > files.
>
> no, it's waaay more than that.
>
> > > this has "implicit"
> > > register-renaming automatically built-in to the design.  these are the
> > > Function Unit operand latches.  they are best termed "nameless
> > > registers" rather than "register-renaming".
> >
> > I think I understand what you are saying, my terminology for this is
> > that the core is "renaming" registers into what you call inflight
> > "nameless registers". At the end of the day, the point is that
> > register data is stored not just in a logical register file,
>
> correct... it is "in flight".  the distinction is important because a
> lot of people try
> to *explicitly* add register-renaming hardware, register caches, and *actually*
> rename the registers by providing a PRF-ARF (physical / architectural)
> register file naming scheme.
>
> we maaay have to do that (because we will have a 128 entry regfile and
> the Dependency Matrices need to be of the size of the actual regs in use).
>
> however it will be to *DOWNSIZE* the register numbers... *NOT* "upsize"
> them as is normally done with e.g. x86.
>
> > and that
> > the scheduler can aggressively execute instructions OOO when their
> > operands are available, instead of in serializing execution in program
> > order.
>
> correct.
>
> > How does the scoreboard handle a WAW hazard... two instructions
> > writing the same register? Does the second instruction wait for the
> > first to finish?
>
> sigh over a year ago i understood this enough to be able to answer.
> what we will have to do is simply ignore the optimisation opportunity.
>
> > > Mitch Alsup had to write two
> > > additional chapters, as an addendum to James Thornton's book, "Design
> > > of a Computer", in order to correct Patterson's misinformation.
> >
> > Do you have a link to the addendum? I have a pdf of the book, but it
> > doesn't seem to have the addendum.
>
> no it does not.  you will need to state that you are happy to give
> credit if you use the book chapters, and that if you pass them on you
> will likewise ask the recipient to guarantee that they also will give
> credit to Mitch Alsup.
>
> these are the conditions under which i received the book chapters from
> Mitch Alsup, and, as the Copyright holder, he is entitled to request
> any conditions that he sees fit.
>
> if that's ok with you then i can send the chapters on to you.
>
> l.
>
> _______________________________________________
> libre-riscv-dev mailing list
> libre-riscv-dev@lists.libre-riscv.org
> http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

_______________________________________________
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  0:24 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #6 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #4)
> (In reply to Cole Poirier from comment #1)
> good for you!  throw it into... mmm... let's see...
> soc/src/soc/logical/bperm.py

Thank you so much Luke, am positively giddy at having written my first bit of
nmigen HDL!!! 

(In reply to Luke Kenneth Casson Leighton from comment #5)
> (In reply to Cole Poirier from comment #3) 
> err... err.... ah :)  rrrright, you need to use nmigen.Array.
> 
> basically:
> 
> * create a list of 64 signals, each 1-bit wide, for-loop, append them each
> to the
>   list
> * assign 1 bit of rb into each of those 64 (signal_1_bit.eq(rb[i]) 
> * create the array: rb8 = Array(my_list_of_64_signals)
> 
> *then* you can index them.
> 
> however... be aware that this is an absolutely truly dreadful way to do it :)
> it will at least be functional and we can work on an improved design in a
> second iteration.
> 
> basically it is absolutely awful because we are creating a *SIXTY FOUR* way
> crossbar... actually 8 such 64-way crossbars!
> 
> this is pretty massive.
> 
> however... before completely freaking out, it is worthwhile seeing what
> yosys actually generates (synth command).  it *might* actually generate
> an efficient design.  we have to see.
> 
> if it really doesn't, then we can look around for alternatives.  there might
> be something in clifford wolf's excellent bitmanip code.

I looked up 'clifford wolf bitmanip' and found this
https://github.com/riscv/riscv-bitmanip/blob/master/verilog/rvb_bextdep/rvb_bextdep.v
which seems to implement the rvb equivalent of bperm, shfl (and unshfl). Wolf,
who I believe from the copyright on this file now goes by Claire, wrote the
riscv bitmanip extention proposal, which is also available in the linked repo
in pre-built or self-built pdf form. Is this the bitmanip code you are
referring to?

> but - go through with this as it is, then write a unit test.  you will then
> have "something to test an alternative design against", later.

I believe I have implemented the fixes you have suggested, but I'm really
struggling with how to write an appropriate unit test, which prevents me from
committing my code to your suggested location in the soc repo, if I'm recalling
the HDL_Workflow development rules correctly. Can you point me to a resource or
explain the basic principles or rules of writing hardware unit tests? I'm
feeling at a total loss of where to start here. Additionally, pardon my
ignorance, but are the unit tests supposed to be written inline or put in the
tests directory of the working directory? (It wasn't obvious to me after
examining the alu and experiment directories)

Here is my attempt at the array code because I believe I can't yet commit it to
the repo:
```
 from nmigen import Elaboratable, Signal, Module, Repl, Cat, Const, Array
 from nmigen.cli import main

 class Bpermd(Elaboratable):    
     def __init__(self, width):
         self.perm = Signal(width)
         self.rs   = Signal(width)
         self.ra   = Signal(width)
         self.rb   = Signal(width)

     def elaborate(self, platform):
         m = Module()
         m.d.comb += self.perm.eq(Const(0,8))
         index = Signal(8)
         signals = [ Signal(1) for i in range(0,64) ]
         for i,n in enumerate(signals):
             n.eq(self.rb[i])
         rb8 = Array(signals)
         for i in range(0, 7 + 1):
             index = self.rs[8 * i:8 * i + 7 + 1]
             with m.If(index < 64):
                 m.d.comb += self.perm[i].eq(rb8[index])
             with m.Else():
                 m.d.comb += self.perm[i].eq(0)
         m.d.comb += self.ra[0:8].eq(self.perm)
         return m

 if __name__ == "__main__":
     bperm = Bpermd(width=64)
     main(bperm,ports=[bperm.perm, bperm.rs, bperm.ra, bperm.rb])
```

-- 
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] Introduction and Questions
From: Luke Kenneth Casson Leighton @ 2020-05-16  0:40 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEoCstS+xz_K6AYNkq-nXB=e7B4FqdC5nzdOXRaNyiqNOuCC7w@mail.gmail.com>

On Sat, May 16, 2020 at 12:49 AM Jeremy Singher <thejsingher@gmail.com> wrote:
>
> > not micro-ops, *actual* scalar add ops.
>
> I think we just have different terminology for this. To me, a micro-op
> is the smallest unit of compute that is passed through a pipeline, and
> a micro-op could indicate that the core should perform a scalar add
> op. I'm happy with your explanation, though, thank you.

:)  allow me to explain for the benefit of future readers.  these discussions
are archived and thus the list is an informational resource for others.

we do intend to do micro-ops.  this because we will be sharing the MUL and
DIV *integer* pipeline(s) with the FP MUL and FP DIV pipelines.

apart from that, there is a direct and one-to-one direct correspondance
between "POWER9 instruction" and what is termed "micro-ops".

that said, microwatt did some really clever munging, which we followed exactly.
so i saaay "direct", but... technically... now that i think about it,
you're correct.

an example:

https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/logical/main_stage.py;hb=HEAD

note there, OP_XOR, OP_OR, OP_AND, there's no "OP_NOR" or "OP_NAND"?
this is because the tables (see https://libre-soc.org/openpower/isatables/ which
we extracted from microwatt decode1.vhdl) have *pre-analysed* the operations
and mapped them down to:

* a pre-processing stage (bit-inversion of RA, selection of Carry=1/0/Carry_Reg)
* the main processing stage
* a post-processing stage (bit-inversion of output, setting of
Condition Register CR0)

we *believe* this is a reflection of the intent of the original
designers of POWER,
and the people who designed microwatt have been tracking POWER for 20 years.
many of them work for IBM Research.

so these are kiiinda micro-op'd... except actually what we did was: split those
3 phases into 3 separate combinatorial blocks which are re-used in multiple
pipeline stages.

> > it's basically c macros... applied to hardware.
>
> Good analogy, thanks. The one concern I have is that this "vector op
> fission" approach will pump the pipeline with tons and tons of
> scalar-ops,

i know, right? :)

> while a traditional vector execution engine would not
> deconstruct the vector instruction into many scalar instructions.

yes.  the only real place where there is cause for concern is on losing the
element-stride information from sequential LD/ST operations: see below.

> Does the vector pipeline use ALL the same execution resources as the
> scalar pipeline? The same issue queues, functional units, read ports,
> writeback paths?

yyyup :)

the only "problem" comes in the address-matching when looking to
merge a batch of LDs (or STs) into a single L1 cache-line read.
the address-matching if you lose the fact that the addresses were
originally element-strided and thus sequential, you get hit by a massive
power surge of over 1000 XOR gates to get that information back,
if you have 8 LD/ST CompUnits.

therefore the intention is to "mark" addresses as being sequential, if
they were auto-generated by an element-strided Vector-LD/ST, and
consequently, very few bits need to be examined to detect if the
address rolls over to a new L1 cache-line.

this is *literally* the only "unplanned" design optimisation that needs
to be added at the hardware level, just because of the decision to
jam as many scalar (element) operations into

> > > How does the scoreboard handle a WAW hazard... two instructions
> > > writing the same register? Does the second instruction wait for the
> > > first to finish?
>
> > sigh over a year ago i understood this enough to be able to answer.
> > what we will have to do is simply ignore the optimisation opportunity.
>
> Hmmm, ignoring WAW will significantly limit the ability of the core to
> exploit ILP, which is one of the fundamental reasons for going OOO.

we have a hell of a lot to get done in about 14 weeks, which is the
cutoff point at which we have to begin the actual layout.  our first primary
goal is to meet the Oct 2020 tapeout with "at least something functional".

after that, we can return to examining optimisations.  i have a way to
spot WAW, as well as a chain-elimination of all ongoing cascading
dependencies - it will just take me about an entire month to remember
it, and 3 months to implement it, and we don't have time to do that...
right now, this very minute.

for a 50 mhz proof-of-concept ASIC, i'm not going to worry about it.

> > no it does not.  you will need to state that you are happy to give
> > credit if you use the book chapters, and that if you pass them on you
> > will likewise ask the recipient to guarantee that they also will give
> > credit to Mitch Alsup.
>
> Of course, I'm glad to have the conditions of use AOT.

appreciated.  they are... absolutely fascinating, and extremely
informative, as well
as representing an advancement and significant simplification on how to do
OoO multi-issue designs.

it does have to be said that many Architects _have_ rediscovered the knowledge
from the original 6600, however with the majority of publicly-available designs
using *binary* Q-Tables, it becomes extremely difficult to do multi-issue on top
of binary-encoded Q-Tables.

one of the (many) insights that Mitch provided was that if you convert
the Q-Tables
to an *unary* array, you can perform transitive RaW/WaR/WaW cascade bit-setting
of the register vector numbers across multiple instructions in any
given multi-issue
batch, and thus, with simple single-bit OR and AND gates, throw
multiple instructions
into the Dependency Matrices and have their order still be correctly
preserved in
the Dependency Matrices DAGs.

in addition to that, the chapters describe how to implement Precise Exceptions
on top of a 6600 design.  it's real simple.  i leave it to you to read up on.

the only thing you need to be aware of is that the design concept described in
Chapter 11 is faulty (the one that removes the FU-FU Matrix and replaces it
with a big NOR gate).  it unfortunately took Mitch and I about 3-4 months of
discussion (and implementation) to detect this error.

the description in chapter 10 however is perfectly functional.

*be aware* also that the gate-level diagrams for the FU-Regs, FU-FU
Matrices, and for the Computation Units *require* that certain operations
take place on the RISING edge of CLK, whilst others take place on the
FALLING edge of CLK.

if this is not borne in mind, the diagrams look faulty and will not work if
implemented as-is on a "normal" (rising edge) modern HDL clock design.
i converted the code in libre-soc to work *solely* on the RISING edge.

> Its incredibly
> annoying when one is provided some information, only for the provider
> of the info to come back months later and tell you "Remember that
> document I sent you, yeah, make sure you never reference it in any
> published work ever".

:)

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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  0:50 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #7 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Cole Poirier from comment #6)

> I looked up 'clifford wolf bitmanip' and found this
> https://github.com/riscv/riscv-bitmanip/blob/master/verilog/rvb_bextdep/
> rvb_bextdep.v which seems to implement the rvb equivalent of bperm, shfl
> (and unshfl). Wolf, who I believe from the copyright on this file now goes
> by Claire, wrote the riscv bitmanip extention proposal, which is also
> available in the linked repo in pre-built or self-built pdf form. Is this
> the bitmanip code you are referring to?

yes.

> > but - go through with this as it is, then write a unit test.  you will then
> > have "something to test an alternative design against", later.
> 
> I believe I have implemented the fixes you have suggested, but I'm really
> struggling with how to write an appropriate unit test, which prevents me
> from committing my code to your suggested location in the soc repo, if I'm
> recalling the HDL_Workflow development rules correctly.

you're not.  if the code is unused by anyone (which in this case it is),
you cannot cause anyone else "damage" or "inconvenience"... therefore commit
it.  right now.

>  Can you point me to
> a resource or explain the basic principles or rules of writing hardware unit
> tests? I'm feeling at a total loss of where to start here. Additionally,
> pardon my ignorance, but are the unit tests supposed to be written inline or
> put in the tests directory of the working directory?

tests directory of the working directory.  in this case, soc/src/logical/test
as "test_bperm.py" or something.


> Here is my attempt at the array code because I believe I can't yet commit it
> to the repo:

the very fact that you've cut/paste at least 3 variations into a *bugtracker*
should tell you everything that you need to know.

and that if your hard drive were to become corrupted, the only way for you to
recover the work would be.... to extract the code... *from these comments*.

that's s***, isn't it? :)

therefore, clearly, you must have misunderstood.

> ```
>  from nmigen import Elaboratable, Signal, Module, Repl, Cat, Const, Array
>  from nmigen.cli import main
>  
>  class Bpermd(Elaboratable):    
>      def __init__(self, width):
>          self.perm = Signal(width)
>          self.rs   = Signal(width)
>          self.ra   = Signal(width)
>          self.rb   = Signal(width)
>  
>      def elaborate(self, platform):
>          m = Module()
>          m.d.comb += self.perm.eq(Const(0,8))

no need to set perm to 0.  i said already.

>          index = Signal(8)
>          signals = [ Signal(1) for i in range(0,64) ]

just range(64).  no need to specify the default of 0

>          for i,n in enumerate(signals):
>              n.eq(self.rb[i])
>          rb8 = Array(signals)

call it rb64

>          for i in range(0, 7 + 1):

you _can_ do this as "8", which is 7+1 :)

>              index = self.rs[8 * i:8 * i + 7 + 1]

likewise here...

>              with m.If(index < 64):
>                  m.d.comb += self.perm[i].eq(rb8[index])
>              with m.Else():
>                  m.d.comb += self.perm[i].eq(0)

again, no need to set something to zero when, if it is not set, it will
default *to* zero.

this btw only holds true for *combinatorial* logic.  sync logic you *must*
do zero-setting (etc) where needed.

>          m.d.comb += self.ra[0:8].eq(self.perm)

looks good.

>          return m
>  
>  if __name__ == "__main__":
>      bperm = Bpermd(width=64)
>      main(bperm,ports=[bperm.perm, bperm.rs, bperm.ra, bperm.rb])
> ```

run python3 bperm.py generate -t il > bperm.il then use yosys to examine the
graph (read_ilang bperm.il; show top)

it will be fascinating to see.

-- 
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 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-05-16  0:56 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-313-13@https.bugs.libre-soc.org/>

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

--- Comment #19 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Luke Kenneth Casson Leighton from comment #18)
> while you're doing the cr pipe i'll sort out spr1/2/3 in branch.

done - please do let me know if the submodule is messed up (it shouldn't be).

in the unit test it will be necessary to have some detection logic (decoding
the op somewhat) in order to correctly set spr1,2,3.  this will not be
"wasted" code because once written it is exactly what the instruction-issue
phase will have to do.

-- 
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  1:16 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #8 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #7)
> (In reply to Cole Poirier from comment #6)
> you're not.  if the code is unused by anyone (which in this case it is),
> you cannot cause anyone else "damage" or "inconvenience"... therefore commit
> it.  right now.

Indeed I did misunderstand, thank you for correcting me. Unfortunately, I just
made the correction you suggested, and tried to push but I do not have push
access rights to the soc repo, only the dev-env-setup repo.

> > Additionally, pardon my ignorance, but are the unit tests supposed to 
> > be written inline or put in the tests directory of the working directory?
> 
> tests directory of the working directory.  in this case, soc/src/logical/test
> as "test_bperm.py" or something.
> 
> the very fact that you've cut/paste at least 3 variations into a *bugtracker*
> should tell you everything that you need to know.
> 
> and that if your hard drive were to become corrupted, the only way for you to
> recover the work would be.... to extract the code... *from these comments*.
> 
> that's s***, isn't it? :)
> 
> therefore, clearly, you must have misunderstood.

Very much so, I agree with your above logic, but due to my misunderstanding I
was very afraid to commit something because I mistakenly thought it could have
negative consequences.

> again, no need to set something to zero when, if it is not set, it will
> default *to* zero.
> 
> this btw only holds true for *combinatorial* logic.  sync logic you *must*
> do zero-setting (etc) where needed.

Thanks, I'll keep this in mind as I continue forwards, a very helpful tip!

> run python3 bperm.py generate -t il > bperm.il then use yosys to examine the
> graph (read_ilang bperm.il; show top)
> 
> it will be fascinating to see.

Ohhhboy... It worked! Very cool, however it is indeed a monster of a design

-- 
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  1:45 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #9 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Cole Poirier from comment #8)
> (In reply to Luke Kenneth Casson Leighton from comment #7)
> > (In reply to Cole Poirier from comment #6)
> > you're not.  if the code is unused by anyone (which in this case it is),
> > you cannot cause anyone else "damage" or "inconvenience"... therefore commit
> > it.  right now.
> 
> Indeed I did misunderstand, thank you for correcting me. Unfortunately, I
> just made the correction you suggested, and tried to push but I do not have
> push access rights to the soc repo, only the dev-env-setup repo.

added you.

> Very much so, I agree with your above logic, but due to my misunderstanding
> I was very afraid to commit something because I mistakenly thought it could
> have negative consequences.

think in terms of multi-way collaboration: you need to do work, other people
need to do work, the code under development needs to work.

the guidelines (based on 20+ years of experience of working with software
libre) balance all those three things.

> > run python3 bperm.py generate -t il > bperm.il then use yosys to examine the
> > graph (read_ilang bperm.il; show top)
> > 
> > it will be fascinating to see.
>  
> Ohhhboy... It worked! Very cool, however it is indeed a monster of a design

yyep.  to be expected.  clifford's bperm code is equally massive.

you might want to try running these:

* proc
* opt
* show top

and if you *really* want to put your computer into meltdown, run "synth"
followed by "show top".

just from a few lines of python, eh?  shows how careful you have to be
when working in H(igh) D(efinition) L(anguage)s.

-- 
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  2:03 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #10 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #9)
> (In reply to Cole Poirier from comment #8)
> added you.

Awesome! It worked :)

> think in terms of multi-way collaboration: you need to do work, other people
> need to do work, the code under development needs to work.
> 
> the guidelines (based on 20+ years of experience of working with software
> libre) balance all those three things.

I'm with you fully Luke. I try to follow your guidelines as best as I can.

> > Ohhhboy... It worked! Very cool, however it is indeed a monster of a design
> 
> yyep.  to be expected.  clifford's bperm code is equally massive.
> 
> you might want to try running these:
> 
> * proc
> * opt
> * show top
> 
> and if you *really* want to put your computer into meltdown, run "synth"
> followed by "show top".

I just might try it.

> just from a few lines of python, eh?  shows how careful you have to be
> when working in H(igh) D(efinition) L(anguage)s.

It really is incredible. Looking forward to improving the level of care I am
capable of taking with regard to HDL.

-- 
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  3:59 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #11 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Cole Poirier from comment #10)
> (In reply to Luke Kenneth Casson Leighton from comment #9)
> > (In reply to Cole Poirier from comment #8)
> > added you.
> 
> Awesome! It worked :)

exxxcellent. muhahaha.

> 
> > think in terms of multi-way collaboration: you need to do work, other people
> > need to do work, the code under development needs to work.
> > 
> > the guidelines (based on 20+ years of experience of working with software
> > libre) balance all those three things.
> 
> I'm with you fully Luke. I try to follow your guidelines as best as I can.

i am inviting you to think for yourself, to derive them from first principles
and thus be able, if there are any... unusual circumstances, to not be either
frozen solid or disruptive.


> > and if you *really* want to put your computer into meltdown, run "synth"
> > followed by "show top".
> 
> I just might try it.

be prepared to have to run "killall xdot".

>  
> > just from a few lines of python, eh?  shows how careful you have to be
> > when working in H(igh) D(efinition) L(anguage)s.
> 
> It really is incredible. Looking forward to improving the level of care I am
> capable of taking with regard to HDL.

if you at least run "show top" and also inspect submodules visually ("show
presstabkey presstabkey") and if you can relate what you see back to the actual
code and still follow the graph, the design is "clean".

if however you cannot see the graph even at fullscreen because boxes are too
small even on a 1920x1080 screen, then something is wrong, you need to break it
down into smaller submodules.

if possible.

or in this particular case, redesign it.

but not right now.

write unit test first.

research examples on how to do that ok?

-- 
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  4:20 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #12 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
you forgot this.  do a git pull in a moment...

diff --git a/src/soc/logical/bperm.py b/src/soc/logical/bperm.py
index 1dcb36d..05321e5 100644
--- a/src/soc/logical/bperm.py
+++ b/src/soc/logical/bperm.py
@@ -37,7 +37,7 @@ class Bpermd(Elaboratable):
         index = Signal(8)
         signals = [ Signal(1) for i in range(64) ]
         for i,n in enumerate(signals):
-            n.eq(self.rb[i])
+            m.d.comb += n.eq(self.rb[i])
         rb64 = Array(signals)
         for i in range(0, 8):
             index = self.rs[8 * i:8 * i + 8]

-- 
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  4:35 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #13 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
ok.  right.  re-run the generate -t ilang, and yosys show top.

then trace "rs", note how there are *two* copies of 8-bit chunks of rs?
one that goes into the "lt" (less-than) comparison, and a *second* copy
that goes into the the big "group" (this is a massive multiplexer btw)

that's 2x copies of 8 8-bit chunks.

so let's trace it back.

what thing or things - related to rs - have an 8-bit width?

well, that will be index, won't it?

index = self.rs[8 * i:8 * i + 8]

now, look where index is used.

first time:

   with m.If(index < 64):

that's where the lt (less-than) comes in (times 8)

second time:

   (rb64[index])

this is really important to note the difference between a *python* variable
and a nmigen Abstract Syntax Tree code-fragment.

you have created - with the "index = self.rs[blah blah]" a *python* variable
assignment from a *nmigen AST*.

therefore, whereever you use that python variable it INSERTS A COPY OF THAT
NMIGEN AST... into more nmigen AST.

now, in this particular case, that's fine (it's not a pretty graph) but in
cases where you did something like this:

     index = Cat(rs[blah], 5) * i + rb[i] * 3, rs[i] & rb[i])

or anything hugely and massively complex, that would ALSO GET INSERTED TWICE
and you would end up with a huge duplication of gate logic as a result, which
yosys would be very unlikely to spot and optimise away.

the solution - therefore - the best practice - is never to assign anything
other
than the most basic of nmigen objects - Signals, Consts, Records etc. - to a
python variable

    OR

to actually create a Signal into which that nmigen AST fragment is assigned...
*and then use that signal*.

in this case that would be:

    index = ...
    idx = Signal(8, name="idx%d" % i, reset_less=True)
    m.d.comb += idx.eq(index)

and then

    m.If(idx < 64)

and also

    rb64[idx]

see what difference that makes to the graphviz, ok?

-- 
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  4:37 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #14 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
     for i in range(0, 8):

just

     for i in range(8):

-- 
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-16  4:52 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <bug-316-13@https.bugs.libre-soc.org/>

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

--- Comment #15 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
i've put a stack of TODO comments in for you.  always remember to "git pull"
before doing any editing.  keep people informed what you are doing,
"i am going to edit this file, now" for example, because this will help you
to avoid edit-conflicts (because the other person knows to coordinate with
you).

for example, if you had fixed the thing in the previous comment *without*
a "git pull", committed it, *then* tried "git pull" you would now have
a conflict to resolve, because you edited the exact same line that i had
also edited.

we will soon see if you are checking the bugtracker and reading all comments...
:)

-- 
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] Introduction and Questions
From: Staf Verhaegen @ 2020-05-16  9:43 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <4BDA96A5-9063-42A6-9548-CAE3CBEBEBAC@gatech.edu>

[-- Attachment #1.1: Type: text/plain, Size: 649 bytes --]

Yehowshua schreef op vr 15-05-2020 om 15:33 [-0400]:
> 
> Realistically, for our first tapeout(we’re using Google’s shuttle service on 1800nm TSMC),
> we’d do a CPU with no vector instructions(effectively no GPU) for October.

Small correction, the 0.18um TSMC shuttle tape-outs are using the 
Europractice service.
In future very likely an open 0.13um PDK becomes available and some
Google sponsored shuttle service will likely be available but it will
have strict restrictions on area and pin count. When information is
public it will then need to be investigated if it can be used for
Libre-SOC prototyping.

greets,
Staf.


[-- Attachment #2: Type: text/plain, Size: 177 bytes --]

_______________________________________________
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] Introduction and Questions
From: Staf Verhaegen @ 2020-05-16  9:47 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <CAEoCstS+xz_K6AYNkq-nXB=e7B4FqdC5nzdOXRaNyiqNOuCC7w@mail.gmail.com>

[-- Attachment #1.1: Type: text/plain, Size: 686 bytes --]

Jeremy Singher schreef op vr 15-05-2020 om 16:49 [-0700]:
> 
> > 
> > sigh over a year ago i understood this enough to be able to answer.
> > what we will have to do is simply ignore the optimisation opportunity.
> 
> 
> Hmmm, ignoring WAW will significantly limit the ability of the core to
> exploit ILP, which is one of the fundamental reasons for going OOO.

I've wondered about this myself. Can you give concrete example of where
not supporting a WAW hazard blocks ILP ?
I am asking because just a WAW hazard could be easily avoided by a good
peep hole optimizer in software because it would see that the output of
the first write is never used.

greets,
Staf.


[-- Attachment #2: Type: text/plain, Size: 177 bytes --]

_______________________________________________
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] Introduction and Questions
From: Staf Verhaegen @ 2020-05-16 11:30 UTC (permalink / raw)
  To: libre-riscv-dev
In-Reply-To: <ff622773af59baea76786e85e28649a3941e69e5.camel@fibraservi.eu>

[-- Attachment #1.1.1: Type: text/plain, Size: 1267 bytes --]


Op 16/05/2020 om 11:47 schreef Staf Verhaegen:
> Jeremy Singher schreef op vr 15-05-2020 om 16:49 [-0700]:
>>
>> Hmmm, ignoring WAW will significantly limit the ability of the core to
>> exploit ILP, which is one of the fundamental reasons for going OOO.
> I've wondered about this myself. Can you give concrete example of where
> not supporting a WAW hazard blocks ILP ?
> I am asking because just a WAW hazard could be easily avoided by a good
> peep hole optimizer in software because it would see that the output of
> the first write is never used.

Ok after some reflection I do see the most possible performance
difference in procedures calls. Most of the time in procedures some
scratch registers are pushed on the stack at entering.

Assume a write to a scratch register is still pending when doing a
procedure. With real register renaming the register stack push does not
need to block until write to register is complete, if it doesn't the
register push will block.

The question is special hardware provision need to be done to optimize
this case or if one would rely on proper inlining of functions by the
compiler for performance critical code. Personally I don't see a problem
with relying on the latter.

greets,
Staf.



[-- Attachment #2: Type: text/plain, Size: 177 bytes --]

_______________________________________________
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] Introduction and Questions
From: Luke Kenneth Casson Leighton @ 2020-05-16 12:11 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <CAEoCstQz36UuDJ+ZUgLRJNeQkA=pTfYuzCr+XgF-FJY9+yJsvA@mail.gmail.com>

hiya jeremy just coming back to respond to the original message you wrote,
covering things we missed. yes lots of questions, therefore lots of answers
:)

On Friday, May 15, 2020, Jeremy Singher <thejsingher@gmail.com> wrote:

> Hi all,
>
> My name is Jeremy Singher. I'm a graduate student studying computer
> architecture, interested in open-source hardware and high performance
> microarchitectures. I am looking for an open-source hardware project I can
> contribute to through the course of my graduate studies,


great to hear.  we've established that you know a heck of a lot about
out-of-order design and i could really use some help with the precise
scoreboard system and the FSMs in the Computation Units.

you may have noticed that we have funding from NLNet.  therefore if you
complete a task on the pre-agreed list, you receive a donation from NLNet
for doing so. http://libre-doc.org/nlnet

i.e we are not expecting you to help "for free", ok? :)


> 1. It seems like you guys are building various components of an
> out-of-order microarchitecture, such as the scoreboard, and load-store
> ordering units. Do you have a complete microarchitecture diagram of the
> core (or a text description)?


it is pieces, from notes, often drawn as gate level diagrams.  more get
added as they happen, and they are more aide-memoire that we wish to expand
to full technical design documentation.

example, today, i plan to draw out the register port allocations to the
Function Units.  in the 180nm version there will be at least... 10
different types of FUs, each with radically different register port
allocations (!). i need to document those.

some of them are as high as 5 in, 3 out.  fortunately they are across
multiple different regfiles (we treat SPRs, Condition Regs, INT and FP as
completely different and consequently the FU port requirements are not as
deeply scary as they first sound: we do not need to go above 4R1W for any
one actual regfile)

also in particularly involved cases i have done youtube videos
http://youtube.com/user/lkcl and look at libresoc playlist.

see http://libre-soc.org/3d_gpu/architecture and drill down the levels
there.


 I could find bits and pieces on specific
> components,


this because that is our current focus.


> but I'm interested in details like pipeline width,


>
 the 180nm ASIC will likely have around... 20 separate and distinct
(parallel) Function Unit entry points into around... 10 to 12 types of
pipeline.

for a 180nm ASIC that is one hell of a lot.

for the Quad Core dual issue version that will jump to around... 28.



depth,
> branch-to-branch latency, load-use delay, etc.


we are literally in the process of assembling the pieces, for the 180nm
test chip.  consequently this is becoming apparent as each piece is put
together.

in other words we are right at the point where your help could define some
of those characteristics.



> 2. Is the SoC at a state at which I can evaluate performance on simple
> benchmarks in simulation?


as a python-based project we have a huge number of unit tests, you either
run them directly or you use nosetests3

we are still constructing building blocks (rapidly) so consequently the
individual tests are the focus of developer attention.


>  Other similar open-source hardware projects have
> make targets to launch verilator simulations, but I could not find an
> equivalent in your repos (although I probably am just bad at looking).


those will be added when compilation of the whole chip is ready to do so.
FPGA targets etc. these will indeed go at the top level.

however as we use a python-based HDL, python practices apply and that
typically means "python3 setup.py test" or "nosetests3" more than it means
"make test" although that i think was added into the soc top level Makefile.


> 3. What is your target performance in terms of an established benchmark
> like Coremark, Dhrystone, Embench, or SPEC?


really hard to tell right now. the primary focus is more on designing
something that is GPU Capable.  that is such a high performance and data
requirement that i think high SPEC etc figures will inherently drop out.



>  I'm trying to compare the
> merits and progress of various hardware projects out-there.


this one is... the reasons why we are all here are not technical ones,
although it is fascinating but deeply challenging work.

the driving reasons are that there are no SoCs out there at this level of
dedign capability (quad core dual issue SMP and 3D and VPU, and there is no
reason why we should not try quad or 6 issue, and 1.5 ghz and above, later)
that have a full Libre Software stack, intended right from the start for
100 million and above mass volume end user markets.

however even that masks a simpler way to put it:

we're giving citizens back Sovereign control over their computing devices.

if that sounded "merely" cool about 4 months ago, you will be keenly aware
with a little thought and analysis of the world news that that is now not
just cool, it is deeply *urgent*.

no other Libre project is creating an end-user product with a built in
*Libre* GPU and VPU for use in mass volume products.

* SiFive joined forces with ImgTec to use PowerVR. why on earth they did
this when ImgTec has such a dreadful reputation we will never know.

* MIAOW is a SIMT engine, not an actual GPU. there are no Texture opcodes,
nothing like that: they implemented a very small subset of the AMDGPU ISA,
basically.

* Nyuzi is an academic exercise demonstrating why Larrabee was not adequate
as a GPU. it was highly successful in this regard.

* GPLGPU is not actually GPL licensed (its author augmented the GPL, making
it a proprietary license), and it is based on PLAN9 which was a fixed
function (non-shader) design concept anyway.

therefore, even a Libre *GPU* does not exist that can meet commercial
power-performance expectations of today's markets.



> 4. What is the right way to get started contributing?


next step is probably to read http://libre-soc/HDL_workflow to get a feel
for how to get started, what the interaction and development flow is.


>  My experience is with
> Verilog, and I've looked at other languages too, including BSV and Chisel.


just follow the process step by step on the front page.  you did step 1 :)
"join list, say hello".

if you are not immediately familiar with nmigen there are tutorials the
best one is by robert baruch
https://github.com/RobertBaruch/nmigen-tutorial/blob/master/README.md

from there we're happy to give you a small (useful) task, like this:
https://bugs.libre-soc.org/show_bug.cgi?id=316

even just reading that, you will see some of the gotchas to expect.

btw, Cole a few months ago knew virtually nothing about software
development, or linux, or hardware, or python. or git.  for a total
beginner and i do mean total, he's doing really well. i'm kinda seriously
impressed.


I'm primarily interested in developing microarchitecture for
> performance-critical components, like branch predictors, prefetchers,
> instruction schedulers, and load-store units.


goood.  because those are exactly the things that we need help with, quite
urgently.



Ideally, I could contribute
> my work as part of graduate studies to this project.


fantastic.  remember: and receive donations from NLNet for doing so :)

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] Introduction and Questions
From: Luke Kenneth Casson Leighton @ 2020-05-16 12:14 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <d4ce8f3176bc0eefc6ffae8350cda41cb71f98b7.camel@fibraservi.eu>

On Saturday, May 16, 2020, Staf Verhaegen <staf@fibraservi.eu> wrote:

> Yehowshua schreef op vr 15-05-2020 om 15:33 [-0400]:
> >
> > Realistically, for our first tapeout(we’re using Google’s shuttle
> service on 1800nm TSMC),
> > we’d do a CPU with no vector instructions(effectively no GPU) for
> October.
>
> Small correction,


thank you Staf.


>
> the 0.18um TSMC shuttle tape-outs are using the
> Europractice service.


In future very likely an open 0.13um PDK becomes available


>

-- 
---
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] Introduction and Questions
From: Luke Kenneth Casson Leighton @ 2020-05-16 12:30 UTC (permalink / raw)
  To: Libre-RISCV General Development
In-Reply-To: <7c84f530-fc12-0f4e-8a1c-7e58a1b498c3@fibraservi.eu>

(appreciate the compiler analysis, Staf.)

On Saturday, May 16, 2020, Staf Verhaegen <staf@fibraservi.eu> wrote:

>
> Assume a write to a scratch register is still pending when doing a
> procedure. With real register renaming the register stack push does not
> need to block until write to register is complete, if it doesn't the
> register push will block.


fortunately if there are enough Function Units (their operand and result
latches being "storers of in-flight registers without any names"), the
pipelines can continue to produce results, and if there is an operand
forwarding bus the scratch register result can be passed on to other FUs to
continue further work - none of which hits the Register File... yet - all
without stalling.

it has been a year so the details are a little hazy, however i seem to
recall that a WaW with enough FunctionUnits plus operand forwarding will
just have a small one clock cycle penalty of the extra regfile write that
could be optimised out.

not, "total catastrophic performance drop".

the optimisation if i recall correctly involved detecting, at the
Dependency Matrices, that there was not only no reader of a given register
waiting for the result, but that there was an outstanding write as well.

i.e. WaW can only be optimised away if there is no reader *in between* the
two writes.

i.e. if there is W R W you cannot throw away the 1st W until the R has
happened.

this requires tracking of multiple Ws per register actually at the
Dependency Matrices, and that means literally doubling or tripling the size
of the matrices which are already going to be enormous.

hence why the decision was taken to shelve that one for later as it is the
kind of thing that matters for high performance.

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] daily kan-ban update 16may2020
From: Luke Kenneth Casson Leighton @ 2020-05-16 13:28 UTC (permalink / raw)
  To: Libre-RISCV General Development

yesterday i completely failed to do anything on the LDSTCompUnit. the
online meeting with 100 Marketnext members went well, however took until
12:30.

however i helped Michael, Tobias and Cole with components of the
pipelines.  in particular, with Michael, we had to go through and define
the SPR regfile and other allocations for the operations to be done by the
Branch pipeline.  it's a *lot*.

this took well into the night, beyond 1:30am, so will have consequences.

today i am therefore unlikely to do anything particularly useful in terms
of focus or planned in advance.

just see how it goes.

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] Scoreboard vs Tomasulo
From: Yehowshua @ 2020-05-16 14:04 UTC (permalink / raw)
  To: Libre-RISCV General Development

This website gives an excellent comparison

https://www.cs.umd.edu/~meesh/cmsc411/website/projects/dynamic/intro.html <https://www.cs.umd.edu/~meesh/cmsc411/website/projects/dynamic/intro.html>

In general, it sits that Tomasulo is a distributed scoreboard.

The biggest drawback of Tomasulo is the central data bus as the messaging scheme. One could use a mesh NOC between functional units.


Given that we have well over 15 functional units, I would have thought a distributed scoreboard instead of a centralized one makes more sense.

Of course, I have no numbers to back this up. But these are just some thoughts.


I know we’re using a ring/circular buffer for messaging at the moment.
Given that we have hard deadlines and limited resources, we can stick with this. But these are questions I do wonder about the answer to. I wonder if there are any papers where this has been explored at sufficient depth to draw conclusions.

Yehowshua
_______________________________________________
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