* [libre-riscv-dev] [Bug 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-05-15 20:39 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 #12 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
likewise we need LR at the same time. yeah, i know. it's a hell of a lot of
incoming wires and registers.
* LR 64-bit
* CIA 64-bit (48 probably more like?)
* CTR 64-bit
* TAR 64-bit
* CR 32-bit
* CompBROpSubset a *lot*. around 64 bits due to the expanded decoding.
we just have to tolerate that, and have a *five* input Branch Computation Unit.
which has me slightly concerned for adding TRAP to the same pipeline, because
that brings in *another* 128 bits (!!) - RA 64-bit, RB 64-bit, plus it modifies
the CR so that's another 32 bits on the output side as well. blegh. can't do
that.
new bugreport, there.
--
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-15 20:46 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 #13 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
ahhh hang on: just looking at decoder/isa/system.py as well
that will take in... either:
* CTR for rfsvc
* SRR1 for one of the other ops
* HSRR1 for another
so yes! CTR should remain named "spr" (or better, be named "spr1").
however the 2nd one... ahh op_rfid refers to *both* MSR *and* SRR1
so it should be called "spr2".
then, the execution issue will have to
* hard-decode the operations to detect which SPR is to go to spr1 and which to
spr2
* put those SPR numbers into the SPR-Dependency-Matrix
and in this way, the right SPRs will arrive at spr1 and spr2
we should record those somewhere.... hmmm... in the BranchInputData file 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] Introduction and Questions
From: Jeremy Singher @ 2020-05-15 20:50 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAPweEDyZQEBsh8uZ4VkzzALPcoiTgs0AvTmTwS6B0Dc+jy+mfw@mail.gmail.com>
> a teeny tiny bit over what we initially planned, then :)
Thanks Luke, these numbers are closer to what seems reasonable to me.
A simple superscalar core with 2 FPU functional units should be able
to achieve 4 GFLOPS, so a vector unit would need to go higher than
that to be worth the extra silicon.
> by overloading "multi-issue". a hardware for-loop at the instruction
> execution phase will push multiple sequential instructions into the
> OoO engine from a *single* instruction.
I see, so a form of micro-op fission, essentially you are decoding
complex vector (or "GPU") instructions into a sequential stream of
simple micro-ops? This seems like a pretty reasonable design point.
> the DIV pipeline will be... 8 (maybe more), MUL will be 2, ADD (etc.) will be 1.
> * fetch: 1.
> * decode: 1.
> * issue and reg-read: 1 (minimum).
> * execute: between 1 and 8 (maybe more)
> * write: 1 (minimum)
So this is just for the preliminary tapeout? I would expect an OOO
core targeting 1GHz+ to have more pipeline stages than this (10+). The
A72, Skylake, Zen, and BOOM all seem to target 10+ stages.
> basically this is why we're doing OoO because coordinating all that in
> an in-order system would be absolute hell.
I'm a bit confused now. In-order execution with variable-latency
functional units can be achieved with a scoreboard, and the pipeline
stages you describe reminds me of a in-order core with OOO write-back.
Is this what you are doing? Or are you pursuing true OOO execution
with register-renaming?
> it's down ultimately to how wide the register paths are, between the
> Regfile and the Function Units. if we have multiple Register Data
> Buses, and can implement the multi-issue part in time, it'll be coded
> in a general-purpose enough way that we could consider 4-issue.
> however... without the register data paths, there's no point.
Fair enough. Balancing the throughput of all the components in a OOO
core is tricky, and register read can certainly be a bottleneck.
> We had some unfortunate run-ins with Berkeley and RISCV - and we decided to go with POWER because we have access to some important relations at IBM
Have you looked at the open RISC-V micro-architectures though? Even if
this core runs POWER, it should be not too difficult to port design
ideas from existing cores, to avoid reinventing the wheel everywhere.
On Fri, May 15, 2020 at 1:12 PM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
>
> hi jeremy, welcome.
>
> here you may have noticed, there are two chips: the 180nm test ASIC
> which we have a tight deadline to meet, mid-august we need to freeze
> the design and immediately move to doing layout using Coriolis2. this
> one we are extremely unlikely to even have FP operations.
>
> beyond that we have a second ASIC to do, the quad-core SMP 800mhz
> dual-issue. that's where you saw the numbers for.
>
> On Fri, May 15, 2020 at 8:33 PM Yehowshua <yimmanuel3@gatech.edu> wrote:
>
> > I know we initially were targeting 5GFLOPS for the GPU on the first tapeout.
>
> this was to be 5-6 GMACs capability for the quad-core SMP 800mhz
> dual-issue (second target). however... *sheepish*... we kinda
> drastically overshot that on the internal architecture :) it was to
> be 5-6 GMACS which is of course 10-12 GFLOPS (FP MUL and FP ADD in
> FPMAC counting as 2).
>
> also each core - all four of them - is architected to handle a minimum
> 128-bit-wide LOAD/STORE data path (4x FP32), and there will be 4x FP32
> - FMACs - per clock cycle, because they will be issued as 2x 64-bit
> operations (2x 32-bit FPs in each 64-bit) and it is dual issue.
>
> 800mhz x 2 issue x 2-32 per 64-bit x 4 = 12.8 GMACs which x2 because
> FPMUL and FPADD is 2 ops = 25.6 GFLOPs.
>
> a teeny tiny bit over what we initially planned, then :)
>
> > Basically, the way we’re doing the GPU is the add a vector FPU along with
> > accompanying instructions into the actual CPU.
>
> by overloading "multi-issue". a hardware for-loop at the instruction
> execution phase will push multiple sequential instructions into the
> OoO engine from a *single* instruction.
>
> > We would then just write the drivers that translate various shaders and drawing
> > commands into vector instructions which can be scheduled on the scoreboard.
>
> rather than having a ridiculous "Remote Procedure Call" system that
> packs up Vulkan / OpenGL commands into a serial marshalled data stream
> from the application, communicated to the kernel, shipped over PCIe or
> other memory bus architecture, unpacked at the GPU, turned into
> instructions, executed, and the results shipped *back* the other way
>
> total insanity.
>
> > 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.
>
> straight POWER9 however still OoO
>
> > Since we’re doing FOSS down to the VLSI design cells(we’re using Time Ansell’s OpenPDK as an intermediate), we need somebody to do a PLL.
>
> a Professor from LIP6 has offered to do that. i introduced you to him
> and Tim, yehowshua.
>
> > With a FOSS PLL in place, we can get 300MHZ on the first tapeout. We’re doing a single core for the
> > first tape out, with 6 stages I think…
>
> the DIV pipeline will be... 8 (maybe more), MUL will be 2, ADD (etc.) will be 1.
>
> * fetch: 1.
> * decode: 1.
> * issue and reg-read: 1 (minimum).
> * execute: between 1 and 8 (maybe more)
> * write: 1 (minimum)
>
> POWER9 has update mode for LD/ST so those would take 1 extra. some
> ALU operations need to write to the Condition Register, that's another
> extra 1 write (possibly).
>
> etc.
>
> basically this is why we're doing OoO because coordinating all that in
> an in-order system would be absolute hell.
>
> > With no PLL, I think we’re limited to 25-50MHz.
>
> Staf mentioned that there's no reason why we should not attempt to
> drive the external CLK line at 100mhz. it could potentially radiate
> EM like stink, however it might work. we'll see :)
>
> > Some simple math could give a DMIPS estimate.
>
> it's down ultimately to how wide the register paths are, between the
> Regfile and the Function Units. if we have multiple Register Data
> Buses, and can implement the multi-issue part in time, it'll be coded
> in a general-purpose enough way that we could consider 4-issue.
> however... without the register data paths, there's no point.
>
> it comes down to how much time we have.
>
> 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] New: bperm TODO
From: bugzilla-daemon @ 2020-05-15 21:01 UTC (permalink / raw)
To: libre-riscv-dev
https://bugs.libre-soc.org/show_bug.cgi?id=316
Bug ID: 316
Summary: bperm TODO
Product: Libre-SOC's first SoC
Version: unspecified
Hardware: PC
OS: Linux
Status: CONFIRMED
Severity: normal
Priority: ---
Component: Source Code
Assignee: lkcl@lkcl.net
Reporter: colepoirier@gmail.com
CC: libre-riscv-dev@lists.libre-riscv.org
NLnet milestone: ---
Assigned to me by Luke as a first nmigen excercise.
pseudo-code here:
perm <- [0] * 8
for i = 0 to 7
index <- (RS)[8*i:8*i+7]
if index < 64 then
perm[i] <- (RB)[index]
else
perm[i] <- 0
RA <- [0]*56 || perm[0:7]
I am to see if I can write the above in nmigen. Below is the simulation
version (translated from the above pseudo-code), it may be easier to
understand:
@inject()
def op_bpermd(self, RS, RB):
perm = concat(0, repeat=8)
for i in range(0, 7 + 1):
index = RS[8 * i:8 * i + 7 + 1]
if lt(index, 64):
perm[i] = RB[index]
else:
perm[i] = 0
RA = concat(concat(0, repeat=56), perm[0:8])
notes:
* repeat=8 you use Repl
* concat you use Cat
* index you will have to actually store that in a temporary Signal (8
bits in length)
--
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: Yehowshua @ 2020-05-15 21:03 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAEoCstTERH=Z84je148ffL7_yiBYFj_Zet2VfOzkbe86MVmyQQ@mail.gmail.com>
>
> I'm a bit confused now. In-order execution with variable-latency
> functional units can be achieved with a scoreboard, and the pipeline
> stages you describe reminds me of a in-order core with OOO write-back.
> Is this what you are doing? Or are you pursuing true OOO execution
> with register-renaming?
>
Register renaming I believe.
> Have you looked at the open RISC-V micro-architectures though? Even if
> this core runs POWER, it should be not too difficult to port design
> ideas from existing cores, to avoid reinventing the wheel everywhere.
>
Yeah - there was a thought to use a RISC-V like microarchitecture.
And then do POWER ontop of that.
There are a couple things to consider.
1. SPR registers and TLB and cache behavior are notably different for POWER.
2. All the RISC-V instructions exist in POWER in some form. POWER’s extra instructions
can be composed of simpler instructions - but it may not be worth it
Consider the instruction the POWER instruction ``rlwinm``:
That does a bit rotate - can we guarantee that implementing hardware to translate ``rlwinm`` into some sequence of ``sll``and ``and`` will actually be easier?
We didn’t really have the time or labor to investigate in February.
Before that, we did however do an extensive investigation of RISC-V.
We concluded that the POWER software ecosystem is more mature, for example, POWER has
a well maintained port of V8 as well as a complete vector extension.
Since we wanted to use a vector like extension to implement our GPU, we didn’t want to release an SOC with its own RISCV vector extension, and then perhaps when RISCV in the future finalized their extension, ours would be out of date.
After talks with the OpenPOWER organization, we are allowed to implement special instructions as necessary while still maintaining the official POWER compliance of our chip.
The instructions we implement will be subject to review, but we’ve had healthy dialogue with the POWER foundation.
After some discussion with RVF, we weren’t sure if our chip would be deemed officially RISCV compliant with custom and potentially future conflicting custom instructions.
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
* [libre-riscv-dev] [Bug 316] bperm TODO
From: bugzilla-daemon @ 2020-05-15 21:06 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 #1 from Cole Poirier <colepoirier@gmail.com> ---
The code below is what I have so far in my first attempt at solving this
problem:
from nmigen import Elaboratable, Signal, Module, Repl, Cat
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(Cat(0, Repl(8)))
index = Signal(8)
for i in range(0, 7 + 1):
index = rs[8 * i:8 * i + 7 + 1]
with m.If(index.lt(64)):
m.d.comb += self.perm[i].eq(rb[index])
with m.Else():
m.d.comb += self.perm[i].eq(0)
m.d.comb += ra.eq(Cat(Cat(0, Repl(56)),prem[0:8]))
return m
if __name__ == "__main__":
bperm = Bpermd(width=8)
main(bperm, ports=[bperm.perm, bperm.rs, bperm.ra, bperm.rb])
```
When I try running a command (python3 bperm.py simulate -c 20 -v bperm.vcd)
taken from this
(http://blog.lambdaconcept.com/doku.php?id=nmigen:nmigen_hello_world) tutorial
I get the following error:
```
Traceback (most recent call last):
File "bperm.py", line 26, in <module>
main(bperm, ports=[bperm.perm, bperm.rs, bperm.ra, bperm.rb])
File "/home/colepoirier/src/nmigen/nmigen/cli.py", line 74, in main
main_runner(parser, parser.parse_args(), *args, **kwargs)
File "/home/colepoirier/src/nmigen/nmigen/cli.py", line 65, in main_runner
fragment = Fragment.get(design, platform)
File "/home/colepoirier/src/nmigen/nmigen/hdl/ir.py", line 39, in get
obj = obj.elaborate(platform)
File "bperm.py", line 13, in elaborate
m.d.comb += self.perm.eq(Cat(0, Repl(8)))
TypeError: __init__() missing 1 required positional argument: 'count'
```
I don't understand why I am getting the error that I'm missing a positional
argument count in my __init__() function, since it only takes the parameters
self and width. I'm sure this error is just due to my not understanding nmigen
properly yet, so any help will be very much appreciated.
--
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-15 21:07 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 #14 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
waaaa...
insn CR SPR1 SPR2 SPR3
---- -- ---- ---- ----
op_b xx LR xx xx
op_ba xx LR xx xx
op_bl xx LR xx xx
op_bla xx LR xx xx
op_bc CR, LR, CTR xx
op_bca CR, LR, CTR xx
op_bcl CR, LR, CTR xx
op_bcla CR, LR, CTR xx
op_bclr CR, LR, CTR xx
op_bclrl CR, LR, CTR xx
op_bcctr CR, LR, CTR xx
op_bcctrl CR, LR, CTR xx
op_bctar CR, LR, CTR, TAR
op_bctarl CR, LR, CTR, TAR
op_sc xx xx xx MSR
op_scv xx LR, SRR1, MSR
op_rfscv xx LR, CTR, MSR
op_rfid xx SRR0, SRR1, MSR
op_hrfid xx HSRR0, HSRR1, MSR
and if we did TRAP in the Branch pipeline as well, that would be
*six* incoming 64-bit register latch paths. nooo, i don't think so :)
so the above table should guide the numbering. LR - that's not an SPR,
is it? if not, then ho hum we should call the field lr_or_spr1 or something
horrible. not a huge fan of long data structure names, but hey :)
* the BranchCompUnit should expect to read the SPR regfile and allocate
lr_or_spr1, spr2, and spr3 accordingly.
* BranchInputData should be the target recipient of that data
* branch/main_stage should decode the three fields lr_or_spr1, spr2 and spr3
likewise according to that table.
for op_bc* that's dead simple: lr = lr_or_spr1, ctr = spr2, tar = spr3
for op_sc and other system calls it's more complex, but doable.
--
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-15 21:11 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
Cole Poirier <colepoirier@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|--- |Normal
Assignee|lkcl@lkcl.net |colepoirier@gmail.com
--
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 15may2020
From: Cole Poirier @ 2020-05-15 21:13 UTC (permalink / raw)
To: Libre-RISCV General Development; +Cc: Libre-RISCV General Development
In-Reply-To: <CAPweEDy7AVrX9XP_Nq1AKOSXej29Mpa9BtV-LidbKF7qRJVHkA@mail.gmail.com>
Yesterday, I finished the script that automates the installation from
source of the necessary yosys tools. Today I started learning nmigen, on
a bug report called 'bperm TODO' at luke's direction. As of the moment I
have written something that I think resembles proper nmigen code,
however I am running into an error that I am struggling to make sense
of, which I have reported on the bug report I filed
(https://bugs.libre-soc.org/show_bug.cgi?id=316), and have asked there
for help while I continue to try debugging this myself.
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
* [libre-riscv-dev] [Bug 291] HDL Workflow and Coriolis2 chroot automated setup scripts
From: bugzilla-daemon @ 2020-05-15 21:18 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
Cole Poirier <colepoirier@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|lkcl@lkcl.net |colepoirier@gmail.com
--
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: Jacob Lifshay @ 2020-05-15 21:19 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAEoCstTERH=Z84je148ffL7_yiBYFj_Zet2VfOzkbe86MVmyQQ@mail.gmail.com>
On Fri, May 15, 2020, 13:50 Jeremy Singher <thejsingher@gmail.com> wrote:
>
> > the DIV pipeline will be... 8 (maybe more), MUL will be 2, ADD (etc.)
> will be 1.
> > * fetch: 1.
> > * decode: 1.
> > * issue and reg-read: 1 (minimum).
> > * execute: between 1 and 8 (maybe more)
> > * write: 1 (minimum)
>
> So this is just for the preliminary tapeout? I would expect an OOO
> core targeting 1GHz+ to have more pipeline stages than this (10+). The
> A72, Skylake, Zen, and BOOM all seem to target 10+ stages.
>
We will definitely need more stages in the fetch pipeline for branch
prediction, TLB, and cache handling, I'm guessing 2 or 3 fetch stages.
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 316] bperm TODO
From: bugzilla-daemon @ 2020-05-15 21:23 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
Yehowshua <yimmanuel3@gatech.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |yimmanuel3@gatech.edu
--- Comment #2 from Yehowshua <yimmanuel3@gatech.edu> ---
Change line 13 to
``m.d.comb += self.perm.eq(0)``
You don't need to use ``Cat`` and or ``Repo``. nMigen knows how to 0 pad and
sign extend.
Now you'll get another issue - namely, that rs isn't define...
What is Bpermd supposed to do?
You should put a Python class comment as shown below to help readers
understand.
```
class Bpermd(Elaboratable):
"""This class does X,Y, and Z"""
def __init__(self, width):
self.perm = Signal(width)
```
--
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-15 21:26 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 #15 from Michael Nolan <mtnolan2640@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #14)
> waaaa...
>
> insn CR SPR1 SPR2 SPR3
> ---- -- ---- ---- ----
> op_b xx LR xx xx
> op_ba xx LR xx xx
> op_bl xx LR xx xx
> op_bla xx LR xx xx
> op_bc CR, LR, CTR xx
> op_bca CR, LR, CTR xx
> op_bcl CR, LR, CTR xx
> op_bcla CR, LR, CTR xx
> op_bclr CR, LR, CTR xx
> op_bclrl CR, LR, CTR xx
> op_bcctr CR, LR, CTR xx
> op_bcctrl CR, LR, CTR xx
> op_bctar CR, LR, CTR, TAR
> op_bctarl CR, LR, CTR, TAR
>
> op_sc xx xx xx MSR
> op_scv xx LR, SRR1, MSR
> op_rfscv xx LR, CTR, MSR
> op_rfid xx SRR0, SRR1, MSR
> op_hrfid xx HSRR0, HSRR1, MSR
>
> and if we did TRAP in the Branch pipeline as well, that would be
> *six* incoming 64-bit register latch paths. nooo, i don't think so :)
That table is a bit large, at least for the branch instructions. None of the
branches except for bclr(l) need to read LR, only write to it. And bclr doesn't
need to read TAR, so multiplexing TAR/LR on the same port would be possible.
> so the above table should guide the numbering. LR - that's not an SPR,
> is it?
It is, it's SPR #8
what are the opcodes starting with op_sc? I don't see any of them in the
power_enums list, nor do I see corresponding opcodes in the power ISA
specification
--
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-15 21:27 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 #16 from Michael Nolan <mtnolan2640@gmail.com> ---
(In reply to Michael Nolan from comment #15)
>
> what are the opcodes starting with op_sc? I don't see any of them in the
> power_enums list, nor do I see corresponding opcodes in the power ISA
> specification
NVM, I see where they're from
--
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 314] Create Condition Register pipeline
From: bugzilla-daemon @ 2020-05-15 21:53 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-314-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=314
Michael Nolan <mtnolan2640@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mtnolan2640@gmail.com
--- Comment #1 from Michael Nolan <mtnolan2640@gmail.com> ---
Are we planning to do crand, cror, crxor, and friends? They're not implemented
in microwatt as far as I can tell
--
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 21:53 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAEoCstTERH=Z84je148ffL7_yiBYFj_Zet2VfOzkbe86MVmyQQ@mail.gmail.com>
On Fri, May 15, 2020 at 9:50 PM Jeremy Singher <thejsingher@gmail.com> wrote:
>
> > a teeny tiny bit over what we initially planned, then :)
>
> Thanks Luke, these numbers are closer to what seems reasonable to me.
> A simple superscalar core with 2 FPU functional units should be able
> to achieve 4 GFLOPS, so a vector unit would need to go higher than
> that to be worth the extra silicon.
the hardware requirements are derived from the software ones. we
decided though to do a hybrid design rather than a separate CPU
separate GPU approach... because... well... um... that's.... two...
processors :)
hybrid designs are extremely unusual. there's only 2 that i have
heard of: the ICubeCorp IC3128, and the Broadcom VideoCore IV (based
around an ARC core, ARC - now bought by Synopsis - is known for
providing a wealth of SIMD and other "additional" instructions,
similar to how RISC-V is now set up, except completely secretive and
under the full and total proprietary control of Synopsis).
i've looked at Vector ISAs, and SIMD ISAs: i concluded that there's a
better way to do a Vector ISA, keeping the *semantics* outlined in the
article "SIMD Considered Harmful".
> > by overloading "multi-issue". a hardware for-loop at the instruction
> > execution phase will push multiple sequential instructions into the
> > OoO engine from a *single* instruction.
>
> I see, so a form of micro-op fission,
yes, in effect. this reduces I-Cache pressure, which in a *hybrid*
processor is critically important. in a separate-CPU,separate-GPU
design you have two I-Caches, running two separate executables, you
don't _give_ a damn.
in a hybrid processor, where GPU opcodes are often 64-bit and are more
usually 128-bit (FOUR banks of 32-bit VLIW instructions), because one
64-bit instruction may be doing 16x FP vector operations who _gives_ a
damn.
unfortunately, when the I-Cache is shared, we do give a damn.
therefore we need to reduce the instruction size and came up with
SimpleV (look it up).
> essentially you are decoding
> complex vector (or "GPU") instructions into a sequential stream of
> simple micro-ops? This seems like a pretty reasonable design point.
mmm not quite. look up SimpleV. 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.
> > the DIV pipeline will be... 8 (maybe more), MUL will be 2, ADD (etc.) will be 1.
> > * fetch: 1.
> > * decode: 1.
> > * issue and reg-read: 1 (minimum).
> > * execute: between 1 and 8 (maybe more)
> > * write: 1 (minimum)
>
> So this is just for the preliminary tapeout?
yes, in 180nm. which can only achieve a max of around 300mhz. if we
had a PLL. which we do not. because we are not signing Foundry NDAs.
and the Foundry will only give us the PLL block they normally hand
out.... under NDA.
> I would expect an OOO
> core targeting 1GHz+ to have more pipeline stages than this (10+). The
> A72, Skylake, Zen, and BOOM all seem to target 10+ stages.
yep. and these are all (except BOOM) USD $100 million custom silicon designs.
> > basically this is why we're doing OoO because coordinating all that in
> > an in-order system would be absolute hell.
>
> I'm a bit confused now. In-order execution with variable-latency
> functional units can be achieved with a scoreboard,
which we have. using an augmented variant of the 6600, thanks to Mitch Alsup.
https://libre-soc.org/3d_gpu/architecture/6600scoreboard/
> and the pipeline
> stages you describe reminds me of a in-order core with OOO write-back.
pipelines can still be used behind Function Unit "front-ends". Mitch Alsup
describes them as "Concurrent Computation Units". basically if the pipeline
is N deep, you put N-or-greater Function Unit "Reservation-Station" style
operand latches on the front, that gives you the ability to track the pipeline
results, match them *back* up with the FU index, and voila, you have
turned what is otherwise considered the exclusive domain of "in-order pipeline"
terminology into something that fits into OoO.
> Is this what you are doing?
no.
> Or are you pursuing true OOO execution
yes.
> with register-renaming?
no / misleading question.
we are using the 6600 design, from 1965. 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".
if you are familiar with the Tomasulo Algorithm: if you make the
number of Reservation Station Rows equal to 1, then the RS latches are
directly equal and equivalent to Function Unit operand latches, and
both are in effect "register renaming"... only the better terminology
is "nameless registers" or "in-flight registers / results".
if you have read his book and consider it to be the last word on
scoreboards, Patterson has completely and utterly misinformed the
general public and the academic community with his book, regarding the
6600 and scoreboards in general. 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.
> > it's down ultimately to how wide the register paths are, between the
> > Regfile and the Function Units. if we have multiple Register Data
> > Buses, and can implement the multi-issue part in time, it'll be coded
> > in a general-purpose enough way that we could consider 4-issue.
> > however... without the register data paths, there's no point.
>
> Fair enough. Balancing the throughput of all the components in a OOO
> core is tricky, and register read can certainly be a bottleneck.
yes. see https://groups.google.com/d/msg/comp.arch/qeMsE7UxvlI/AmwsomDoAQAJ
i can't find the diagram i drew at the moment... regfile i think...
ah yes here you go:
https://libre-soc.org/3d_gpu/architecture/regfile/
that's a global cyclic buffer at the regfile (acts as an Operand
Forwarding Bus) and
*local* cyclic buffers at the Function Units.
> > We had some unfortunate run-ins with Berkeley and RISCV - and we decided to go with POWER because we have access to some important relations at IBM
>
> Have you looked at the open RISC-V micro-architectures though?
yes. they are nowhere near the level of comprehensiveness needed.
plus, it would be incredibly irresponsible of us to bring to market a
100 million and above *libre* design where the modifications to the
compiler, toolchain, everything, all needed to be upstream.
> Even if
> this core runs POWER, it should be not too difficult to port design
> ideas from existing cores, to avoid reinventing the wheel everywhere.
because of the way that SimpleV works, and because we need to
drastically extend the target ISA (POWER9) with opcodes that are
everyday common-usage in GPUs (Texture Ops, SIN, COS, RGB2YUV), whilst
on the face of it the idea sounds "perfectly reasonable", the changes
required are so fundamental that starting from someone else's design
would produce massive barriers.
example: we have created PartitionedSignal - a class that not just
"performs add operations", it takes an *additional* (dynamic)
side-argument - a mask - which *dynamically* partitions what would
otherwise be a 64-bit operation into *any* combination of 8, 16, 24,
32, 40, 48 and 56 bit operations.
this class, because we are using python, can be handed in as a kls in
an Object-Orientated fashion, to *replace* nmigen Signal, and thus we
may construct code that on the first usage is a simple pipeline,
however we may then convert that EXACT SAME CODE into a dynamic SIMD
variant purely with a one-line change.
these kinds of techniques are normally the exclusive domain of
experienced Software Engineering teams. for a *hardware* team to
deploy them? this is unheard-of, and if attempted with even Chisel3 /
Scala, would have the team running away screaming within about 6
months. a team that was asked to do that in verilog or VHDL would
flat-out say "no". or ask for 50 extra engineers. which, for IBM or
Intel or ARM is not unreasonable, but for us it is not.
hence we started from scratch, in order to be able to deploy these
kinds of Software Engineering techniques.
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 21:55 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD4udi-tytQQACjZXsq=HURLEJVtianh+BGv0qJp+AVfFQ@mail.gmail.com>
On Fri, May 15, 2020 at 10:20 PM Jacob Lifshay <programmerjake@gmail.com> wrote:
> We will definitely need more stages in the fetch pipeline for branch
> prediction, TLB, and cache handling, I'm guessing 2 or 3 fetch stages.
oh, yes. good catch. ah... ok TLB is deliberately kept to very small
sizes (8 entries max)
so that it can respond in 1 cycle (or, same-cycle). branch prediction and
cache misses, i left out because they're "extra" (but only on misses).
however for higher speeds, TLBs are often cascaded and again end up with
extra misses. that's according to the wikipedia page on TLB :)
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-15 22:05 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 #3 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Yehowshua from comment #2)
> Change line 13 to
> ``m.d.comb += self.perm.eq(0)``
>
> You don't need to use ``Cat`` and or ``Repo``. nMigen knows how to 0 pad and
> sign extend.
>
> Now you'll get another issue - namely, that rs isn't define...
>
> What is Bpermd supposed to do?
> You should put a Python class comment as shown below to help readers
> understand.
>
> ```
> class Bpermd(Elaboratable):
> """This class does X,Y, and Z"""
> def __init__(self, width):
> self.perm = Signal(width)
> ```
Thanks so much for your help Yehowshua! I've done as you reccomended and added
a doc string, as well as changing line 13, and referring to ra and rb with the
self prefix. Now I am getting a different error, perhaps you could advise me as
to how to proceed?
1 bperm.py
X
from nmigen import Elaboratable, Signal, Module, Repl, Cat
from nmigen.cli import main
class Bpermd(Elaboratable):
"""This class does a Bit Permute on a Doubleword
X-form bpermd RA,RS,RB]
[snip]
"""
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(0)
index = Signal(8)
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(self.rb[index])
with m.Else():
m.d.comb += self.perm[i].eq(0)
m.d.comb += self.ra.eq(Cat(Cat(0,Repl(56)), self.perm[0:8]))
return m
if __name__ == "__main__":
bperm = Bpermd(width=64)
main(bperm,ports=[bperm.perm, bperm.rs, bperm.ra, bperm.rb])
```
Traceback (most recent call last):
File "bperm.py", line 50, in <module>
main(bperm,ports=[bperm.perm, bperm.rs, bperm.ra, bperm.rb])
File "/home/colepoirier/src/nmigen/nmigen/cli.py", line 74, in main
main_runner(parser, parser.parse_args(), *args, **kwargs)
File "/home/colepoirier/src/nmigen/nmigen/cli.py", line 65, in main_runner
fragment = Fragment.get(design, platform)
File "/home/colepoirier/src/nmigen/nmigen/hdl/ir.py", line 39, in get
obj = obj.elaborate(platform)
File "bperm.py", line 42, in elaborate
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)
--
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 314] Create Condition Register pipeline
From: bugzilla-daemon @ 2020-05-15 22:05 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-314-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=314
--- Comment #2 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #1)
> Are we planning to do crand, cror, crxor, and friends? They're not
> implemented in microwatt as far as I can tell
https://github.com/antonblanchard/microwatt/blob/master/execute1.vhdl
line 719.
oink.
am i reading this correctly: they actually use the cr operand as if
it was a *table*?? moo?
so the instruction field 0-15 is treated as a 4-bit number (a 4-bit
truth-table)
you then take ba and bb and create a 2-bit index.
then use that 2-bit address to get one of the bits of the 4-bit
instruction field.
wooow.
i'm deeply impressed.
um... answer... yes they do implement crand, cror etc :)
this must be how FPGAs do things, and is probably why LUTs are 4-bit.
--
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-15 22:14 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
Luke Kenneth Casson Leighton <lkcl@lkcl.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lkcl@lkcl.net
--- Comment #4 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Cole Poirier from comment #1)
> The code below is what I have so far in my first attempt at solving this
> problem:
good for you! throw it into... mmm... let's see...
soc/src/soc/logical/bperm.py
something like that.
> from nmigen import Elaboratable, Signal, Module, Repl, Cat
> 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(Cat(0, Repl(8)))
> index = Signal(8)
> for i in range(0, 7 + 1):
> index = rs[8 * i:8 * i + 7 + 1]
> with m.If(index.lt(64)):
> m.d.comb += self.perm[i].eq(rb[index])
> with m.Else():
> m.d.comb += self.perm[i].eq(0)
> m.d.comb += ra.eq(Cat(Cat(0, Repl(56)),prem[0:8]))
> return m
>
> if __name__ == "__main__":
> bperm = Bpermd(width=8)
> main(bperm, ports=[bperm.perm, bperm.rs, bperm.ra, bperm.rb])
> ```
> m.d.comb += self.perm.eq(Cat(0, Repl(8)))
ok this needed to be:
m.d.comb += self.perm.eq(Repl(Const(0, 1), 8)))
or better just:
m.d.comb += self.perm.eq(Const(0, 8))
but to be honest you do not need to set it at all. if not set, the default
will be zero.
> TypeError: __init__() missing 1 required positional argument: 'count'
> ```
>
> I don't understand why I am getting the error that I'm missing a positional
> argument count in my __init__() function, since it only takes the parameters
> self and width.
Repl takes 2 arguments: the thing to replicate, and the number of times to
replicate it.
you passed only one argument.
> I'm sure this error is just due to my not understanding
> nmigen properly yet, so any help will be very much appreciated.
change this
with m.If(index.lt(64)):
to this
with m.If(index < 64):
and this
m.d.comb += ra.eq(Cat(Cat(0, Repl(56)),prem[0:8]))
to just this:
m.d.comb += ra[0:8].eq(perm)
because you want the answer in the 1st 8 bits, and perm you know is 8 bits.
actually you could just do ra.eq(perm) but nmigen might try to bit-extend
perm out to 64 bits, and that's a waste, because, again, if not set, the
bits will default to being set to zero.
he said.
they better be :)
--
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 22:15 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAPweEDyHrrQqPaNy7OqCsPUgR0yrELuRENqZTw_qr-tBVHVg+g@mail.gmail.com>
> 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? 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. 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.
> unfortunately, when the I-Cache is shared, we do give a damn.
> therefore we need to reduce the instruction size and came up with
> SimpleV (look it up).
Yep, this seems like a reasonable conclusion to draw.
> 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, and that
the scheduler can aggressively execute instructions OOO when their
operands are available, instead of in serializing execution in program
order.
How does the scoreboard handle a WAW hazard... two instructions
writing the same register? Does the second instruction wait for the
first to finish?
> 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.
On Fri, May 15, 2020 at 2:54 PM Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
>
> On Fri, May 15, 2020 at 9:50 PM Jeremy Singher <thejsingher@gmail.com> wrote:
> >
> > > a teeny tiny bit over what we initially planned, then :)
> >
> > Thanks Luke, these numbers are closer to what seems reasonable to me.
> > A simple superscalar core with 2 FPU functional units should be able
> > to achieve 4 GFLOPS, so a vector unit would need to go higher than
> > that to be worth the extra silicon.
>
> the hardware requirements are derived from the software ones. we
> decided though to do a hybrid design rather than a separate CPU
> separate GPU approach... because... well... um... that's.... two...
> processors :)
>
> hybrid designs are extremely unusual. there's only 2 that i have
> heard of: the ICubeCorp IC3128, and the Broadcom VideoCore IV (based
> around an ARC core, ARC - now bought by Synopsis - is known for
> providing a wealth of SIMD and other "additional" instructions,
> similar to how RISC-V is now set up, except completely secretive and
> under the full and total proprietary control of Synopsis).
>
> i've looked at Vector ISAs, and SIMD ISAs: i concluded that there's a
> better way to do a Vector ISA, keeping the *semantics* outlined in the
> article "SIMD Considered Harmful".
>
> > > by overloading "multi-issue". a hardware for-loop at the instruction
> > > execution phase will push multiple sequential instructions into the
> > > OoO engine from a *single* instruction.
> >
> > I see, so a form of micro-op fission,
>
> yes, in effect. this reduces I-Cache pressure, which in a *hybrid*
> processor is critically important. in a separate-CPU,separate-GPU
> design you have two I-Caches, running two separate executables, you
> don't _give_ a damn.
>
> in a hybrid processor, where GPU opcodes are often 64-bit and are more
> usually 128-bit (FOUR banks of 32-bit VLIW instructions), because one
> 64-bit instruction may be doing 16x FP vector operations who _gives_ a
> damn.
>
> unfortunately, when the I-Cache is shared, we do give a damn.
> therefore we need to reduce the instruction size and came up with
> SimpleV (look it up).
>
> > essentially you are decoding
> > complex vector (or "GPU") instructions into a sequential stream of
> > simple micro-ops? This seems like a pretty reasonable design point.
>
> mmm not quite. look up SimpleV. 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.
>
> > > the DIV pipeline will be... 8 (maybe more), MUL will be 2, ADD (etc.) will be 1.
> > > * fetch: 1.
> > > * decode: 1.
> > > * issue and reg-read: 1 (minimum).
> > > * execute: between 1 and 8 (maybe more)
> > > * write: 1 (minimum)
> >
> > So this is just for the preliminary tapeout?
>
> yes, in 180nm. which can only achieve a max of around 300mhz. if we
> had a PLL. which we do not. because we are not signing Foundry NDAs.
> and the Foundry will only give us the PLL block they normally hand
> out.... under NDA.
>
> > I would expect an OOO
> > core targeting 1GHz+ to have more pipeline stages than this (10+). The
> > A72, Skylake, Zen, and BOOM all seem to target 10+ stages.
>
> yep. and these are all (except BOOM) USD $100 million custom silicon designs.
>
> > > basically this is why we're doing OoO because coordinating all that in
> > > an in-order system would be absolute hell.
> >
> > I'm a bit confused now. In-order execution with variable-latency
> > functional units can be achieved with a scoreboard,
>
> which we have. using an augmented variant of the 6600, thanks to Mitch Alsup.
> https://libre-soc.org/3d_gpu/architecture/6600scoreboard/
>
> > and the pipeline
> > stages you describe reminds me of a in-order core with OOO write-back.
>
> pipelines can still be used behind Function Unit "front-ends". Mitch Alsup
> describes them as "Concurrent Computation Units". basically if the pipeline
> is N deep, you put N-or-greater Function Unit "Reservation-Station" style
> operand latches on the front, that gives you the ability to track the pipeline
> results, match them *back* up with the FU index, and voila, you have
> turned what is otherwise considered the exclusive domain of "in-order pipeline"
> terminology into something that fits into OoO.
>
> > Is this what you are doing?
>
> no.
>
> > Or are you pursuing true OOO execution
>
> yes.
>
> > with register-renaming?
>
> no / misleading question.
>
> we are using the 6600 design, from 1965. 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".
>
> if you are familiar with the Tomasulo Algorithm: if you make the
> number of Reservation Station Rows equal to 1, then the RS latches are
> directly equal and equivalent to Function Unit operand latches, and
> both are in effect "register renaming"... only the better terminology
> is "nameless registers" or "in-flight registers / results".
>
> if you have read his book and consider it to be the last word on
> scoreboards, Patterson has completely and utterly misinformed the
> general public and the academic community with his book, regarding the
> 6600 and scoreboards in general. 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.
>
> > > it's down ultimately to how wide the register paths are, between the
> > > Regfile and the Function Units. if we have multiple Register Data
> > > Buses, and can implement the multi-issue part in time, it'll be coded
> > > in a general-purpose enough way that we could consider 4-issue.
> > > however... without the register data paths, there's no point.
>
> >
> > Fair enough. Balancing the throughput of all the components in a OOO
> > core is tricky, and register read can certainly be a bottleneck.
>
> yes. see https://groups.google.com/d/msg/comp.arch/qeMsE7UxvlI/AmwsomDoAQAJ
> i can't find the diagram i drew at the moment... regfile i think...
> ah yes here you go:
> https://libre-soc.org/3d_gpu/architecture/regfile/
>
> that's a global cyclic buffer at the regfile (acts as an Operand
> Forwarding Bus) and
> *local* cyclic buffers at the Function Units.
>
> > > We had some unfortunate run-ins with Berkeley and RISCV - and we decided to go with POWER because we have access to some important relations at IBM
> >
> > Have you looked at the open RISC-V micro-architectures though?
>
> yes. they are nowhere near the level of comprehensiveness needed.
> plus, it would be incredibly irresponsible of us to bring to market a
> 100 million and above *libre* design where the modifications to the
> compiler, toolchain, everything, all needed to be upstream.
>
>
> > Even if
> > this core runs POWER, it should be not too difficult to port design
> > ideas from existing cores, to avoid reinventing the wheel everywhere.
>
> because of the way that SimpleV works, and because we need to
> drastically extend the target ISA (POWER9) with opcodes that are
> everyday common-usage in GPUs (Texture Ops, SIN, COS, RGB2YUV), whilst
> on the face of it the idea sounds "perfectly reasonable", the changes
> required are so fundamental that starting from someone else's design
> would produce massive barriers.
>
> example: we have created PartitionedSignal - a class that not just
> "performs add operations", it takes an *additional* (dynamic)
> side-argument - a mask - which *dynamically* partitions what would
> otherwise be a 64-bit operation into *any* combination of 8, 16, 24,
> 32, 40, 48 and 56 bit operations.
>
> this class, because we are using python, can be handed in as a kls in
> an Object-Orientated fashion, to *replace* nmigen Signal, and thus we
> may construct code that on the first usage is a simple pipeline,
> however we may then convert that EXACT SAME CODE into a dynamic SIMD
> variant purely with a one-line change.
>
> these kinds of techniques are normally the exclusive domain of
> experienced Software Engineering teams. for a *hardware* team to
> deploy them? this is unheard-of, and if attempted with even Chisel3 /
> Scala, would have the team running away screaming within about 6
> months. a team that was asked to do that in verilog or VHDL would
> flat-out say "no". or ask for 50 extra engineers. which, for IBM or
> Intel or ARM is not unreasonable, but for us it is not.
>
> hence we started from scratch, in order to be able to deploy these
> kinds of Software Engineering techniques.
>
> 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 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-05-15 22:23 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 #17 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #15)
> (In reply to Luke Kenneth Casson Leighton from comment #14)
> > waaaa...
> >
> > insn CR SPR1 SPR2 SPR3
> > ---- -- ---- ---- ----
> > op_b xx LR xx xx
> > op_ba xx LR xx xx
> > op_bl xx LR xx xx
> > op_bla xx LR xx xx
> > op_bc CR, LR, CTR xx
> > op_bca CR, LR, CTR xx
> > op_bcl CR, LR, CTR xx
> > op_bcla CR, LR, CTR xx
> > op_bclr CR, LR, CTR xx
> > op_bclrl CR, LR, CTR xx
> > op_bcctr CR, LR, CTR xx
> > op_bcctrl CR, LR, CTR xx
> > op_bctar CR, LR, CTR, TAR
> > op_bctarl CR, LR, CTR, TAR
> >
> > op_sc xx xx xx MSR
> > op_scv xx LR, SRR1, MSR
> > op_rfscv xx LR, CTR, MSR
> > op_rfid xx SRR0, SRR1, MSR
> > op_hrfid xx HSRR0, HSRR1, MSR
> >
> > and if we did TRAP in the Branch pipeline as well, that would be
> > *six* incoming 64-bit register latch paths. nooo, i don't think so :)
>
>
> That table is a bit large, at least for the branch instructions. None of the
> branches except for bclr(l) need to read LR, only write to it.
err... nuts. the parser is bringing lr in as an input, when it should not.
that's another bug. let me update the table...
> And bclr
> doesn't need to read TAR, so multiplexing TAR/LR on the same port would be
> possible.
yep. good catch.
> > so the above table should guide the numbering. LR - that's not an SPR,
> > is it?
> It is, it's SPR #8
okaaay good.
> what are the opcodes starting with op_sc? I don't see any of them in the
> power_enums list, nor do I see corresponding opcodes in the power ISA
> specification
(i saw you found them, later comment - decoder/isa/system.py)
sooo, iiinteresting: OP_TRAP needs up to 3 SPRs, but OP_B* does not.
that is almost worthwhile considering having OP_TRAP and OP_B* in the
same pipeline... mm... 5 64-bit datapaths... yyeah no :)
--
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: Yehowshua @ 2020-05-15 22:29 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAEoCstT7yZObkbS9GhWDRE7rm3p=Y5CzAJgYYj_3THCuRy=MCQ@mail.gmail.com>
Luke, I’ll forward Jeremy the chapters.
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
* [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
page: next prev 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