* [libre-riscv-dev] [Bug 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-06-02 20:30 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 #47 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #46)
> (In reply to Luke Kenneth Casson Leighton from comment #44)
>
> > bear in mind that DecodeA reads CTR, (which goes into read_fast1)
> > and DecodeB reads LR or TAR (which goes into read_fast2).
> >
> > so the above test needs to be split.
>
> So main_stage.py will need to check whether the instruction is a bcctr and
> use spr1, otherwise use spr2?
sigh yes. although what i was going to do was to just make BCREG use spr2
for CTR/LR/TAR and BC uses spr1=CTR.
i believe that may end up being simpler, because main_stage.py would not
need to decode XO[5/9]?
--
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-06-02 21:03 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 #48 from Michael Nolan <mtnolan2640@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #44)
> yes. it's accessed often enough.
Lol, back when I was doing some PowerPC reverse engineering I never saw a
bctar. Then again, it was a fairly old chip so TAR may not have been introduced
yet.
>
> then, read_fast1 and read_fast2 can be used in both unit tests:
> fu/compunit/test/test_branch_compunit.py
> and
> fu/branch/test/test_pipe_caller.py
This has been done to test_pipe_caller, still need to do the compunit one.
--
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-06-02 21:33 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 #49 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #48)
> (In reply to Luke Kenneth Casson Leighton from comment #44)
>
> > yes. it's accessed often enough.
>
> Lol, back when I was doing some PowerPC reverse engineering I never saw a
> bctar.
okok :) put another way: i don't want the hassle of adding an extra regfile
port (a slow SPR one) to the branch regspecs :)
> > then, read_fast1 and read_fast2 can be used in both unit tests:
> > fu/compunit/test/test_branch_compunit.py
> > and
> > fu/branch/test/test_pipe_caller.py
>
> This has been done to test_pipe_caller, still need to do the compunit one.
the compunit one _should_ just pick it up automatically, because of the use
of regspecs.
howeverrrr.... there's something fishy going on in test_bc_cr, which
is only noticed on the *next* instruction, test_bc_ctr
here's test_bc_cr output phase:
check extra output 'bc 12, 3, -12720' {} <-- uh-oh... no output regs.
test_bc_ctr
following that, this - in the output log - is extremely bad:
before inputs, rd_rel, wr_rel: 0b1100 0b101 <--- wr_rel *must* be zero here.
rd_rel 0 wait HI 0 spr1 0x57b4136e
rd_rel 0 wait HI 1 spr1 0x57b4136e
rd_rel 2 wait HI 1 cr_a 0x0
rd_rel 3 wait HI 1 cia 0x0
if that occurs, it means that the pipeline has set Data.ok flags but that
PowerDecode2 has *NOT* set the corresponding write regs information.
or the other way round.
--
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-06-02 21:38 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 #50 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
problem is caused by test_bc_reg() - any one of those will cause
subsequent tests to fail
--
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 02jun2020
From: Jacob Lifshay @ 2020-06-02 22:35 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAPweEDy-nKkUYj-2uikQpg54GGbZW+DOhy-wcL1jBdkt3XM+xw@mail.gmail.com>
today:
working on div and mul pipelines
helping explain Rust's Send and Sync traits:
https://github.com/PyO3/pyo3/pull/948#issuecomment-637108905
working some on requirements for Systemes Libres
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 313] Create Branch Pipeline for POWER9
From: bugzilla-daemon @ 2020-06-02 22:41 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 #51 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
found it. when no registers were to be written, MultiCompUnit couldn't cope.
this actually happens with some of the branch tests. no change to LR,
no change to CTR, no change to NIA (because the branch was not taken):
wark-wark.
i added yet another hacked-in condition to MCU to get it to test if the
ALU was finished.
--
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 01jun2020
From: Cole Poirier @ 2020-06-02 22:48 UTC (permalink / raw)
To: Libre-RISCV General Development; +Cc: Libre-RISCV General Development
In-Reply-To: <CAPweEDyFts_=98SQUJQ2HQj99sOBTsF69O0DWCP3MrRDyFn8Xg@mail.gmail.com>
On Jun 2 2020, at 3:11 am, Luke Kenneth Casson Leighton <lkcl@lkcl.net> wrote:
> On Tue, Jun 2, 2020 at 1:23 AM Cole Poirier <colepoirier@gmail.com> wrote:
>>
>> Today (actual):
>>
>> Spent today reading the parts of OPENPOWER ISA v3.1 related to traps,
>> not finished yet. I don't understand very much currently, but I think
>> that this will progress as I read and investigate further, however,
>> since I don't think I can read the spec well enough to understand
>> what I
>> have to implement for fu/trap/main_stage, if someone else has the
>> time I
>> think they should do it. Otherwise, I'll continue to work away at
>> understanding enough of the spec to be able to implement the trap pipeline.
>
> it is not in the least bit necessary to "understand" the spec. i do not.
>
> what *is* necessary is to understand how to translate microwatt VHDL
> source code into nmigen.
>
> and to TRUST that microwatt is correct.
>
> this is why i have put in code-snippets from microwatt into the bugreport.
>
> this turns an exercise that would take months if not years by a factor
> of approximately TEN.
>
> quotes understanding quotes comes later.
>
> l.
Aha! Thanks for this course correction Luke. I reviewed the comments on
the bug report yesterday, but I will now review it again with this fresh
knowledge, and get to work translating the microwatt VHDL into nmigen
for the trap pipeline.
Cole
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* Re: [libre-riscv-dev] daily kan-ban update 02jun2020
From: Luke Kenneth Casson Leighton @ 2020-06-02 23:02 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAC2bXD5--6h=JXLSYbygdQVJGyveECox5tibzoP6rGgkvJuVfQ@mail.gmail.com>
On Tuesday, June 2, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:
> today:
>
> working on div and mul pipelines
>
> helping explain Rust's Send and Sync traits:
> https://github.com/PyO3/pyo3/pull/948#issuecomment-637108905
oo interesting
>
> working some on requirements for Systemes Libres
>
> Jacob
> _______________________________________________
> libre-riscv-dev mailing list
> libre-riscv-dev@lists.libre-riscv.org
> http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
>
--
---
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] daily kan-ban update 01jun2020
From: Luke Kenneth Casson Leighton @ 2020-06-02 23:03 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <9D360AEA-C7A4-41EC-B9CA-DCEBF39E6F40@getmailspring.com>
On Tuesday, June 2, 2020, Cole Poirier <colepoirier@gmail.com> wrote:
>
> Aha! Thanks for this course correction Luke. I reviewed the comments on
> the bug report yesterday, but I will now review it again with this fresh
> knowledge, and get to work translating the microwatt VHDL into nmigen
> for the trap pipeline.
it's basically a nobrainer, but still absolutely essential.
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] daily kan-ban update 01jun2020
From: Cole Poirier @ 2020-06-02 23:05 UTC (permalink / raw)
To: Libre-RISCV General Development; +Cc: Libre-RISCV General Development
In-Reply-To: <CAPweEDxr6XgHY6ZNvx-eoJTatKzqXV83cTs=FC3bTAPCEGUqig@mail.gmail.com>
On Jun 2 2020, at 4:03 pm, Luke Kenneth Casson Leighton <lkcl@lkcl.net> wrote:
> it's basically a nobrainer, but still absolutely essential.
>
> l.
Perfect :)
_______________________________________________
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 02jun2020
From: Cole Poirier @ 2020-06-02 23:06 UTC (permalink / raw)
To: Libre-RISCV General Development; +Cc: Libre-RISCV General Development
In-Reply-To: <CAPweEDyDFNqcKj+bxpJvK4Q_dzbs7ixY99fsFaLpFsSkMNFBtQ@mail.gmail.com>
Today:
Translate microwatt vhdl code for trap pipeline into nmigen.
_______________________________________________
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 336] ALU CompUnit needs to recognise that RA (src1) can be zero
From: bugzilla-daemon @ 2020-06-02 23:06 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-336-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=336
--- Comment #48 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
hi cesar i added a hack-test for when wrmak is zero. this basically says that
when the ALU says that is done, if there isno data to write then the MCU
write-request phase is also done.
the logic becomes pretty similar to what is in LDSTCompUnit, which for ST does
not write a reg, either.
--
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-02 23:07 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #18 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #15)
> https://git.libre-soc.org/?p=soc.git;a=commitdiff;
> h=2955619bc39a83b09920f8452882c4c327d30fef
>
> cole, this is important to understand: you *do not* need to "understand"
> what is "going on". you do not need to read 1,300 page PDFs - in full -
> memorised in their entirety - before being able to take action.
>
> this can be extremely uncomfortable. it feels... "unnatural", like,
> "i should know everything because if i don't i might make a mistake or
> implement the wrong thing".
>
> sound familiar?
>
> please understand: "understanding" != "action".
>
> the trick that i learned - a long time ago, from doing reverse-engineering -
> is to find someone else's *working* implementation, and *without*
> understanding,
> perform as direct a one-to-one translation as is humanly and conveniently
> possible.
>
> forget optimisation.
>
> forget "understanding".
>
> forget even *bug* fixes.
>
> just... get... it... translated.
>
> through that process, it turns out that by walking over the code (which you
> quotes don't understand quotes), this puts that code into your brain.
>
> **THEN** when you read the spec - the 1300 page PDF - you go, "ohhhh,
> yeahhh, i
> recognise that. that's those bits/flags/functions/insert-whatever that i saw
> when i was reading and translating the code, line-by-line".
>
> and *NOW* you have quotes understanding quotes.
>
> without having taken that first step, i guarantee to you that you will get
> nowhere, fast.
>
>
> so just - and i mean this literally - translate the comments that i've put
> from microwatt execute1.vhdl into nmigen. you can see how Michael and i
> did that already for both OP_TRAP and OP_MFMSR.
>
> i deliberately inserted the original microwatt code even for those, so that
> you have a direct side-by-side comparison, and can follow the adage
> "A is to B, as C is to D".
>
> you'll also need to translate the bit-patterns MSR_* - this again should be
> obvious and easy.
With you all the way Luke, just needed this redirection/confidence boost.
--
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-02 23:07 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #19 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #17)
> Cole: example (A is to B, as C is to D). examine case OP_TRAP and case
> OP_SC.
>
> A:
> ctrl_tmp.irq_nia <= std_logic_vector(to_unsigned(16#C00#,
> 64));
> ctrl_tmp.srr1 <= msr_copy(ctrl.msr);
>
> B:
>
> ????
>
>
> C:
> ctrl_tmp.irq_nia <=
> std_logic_vector(to_unsigned(16#700#, 64));
> ctrl_tmp.srr1 <= msr_copy(ctrl.msr);
>
> D:
>
> comb += self.o.nia.data.eq(0x700) # trap address
> comb += self.o.nia.ok.eq(1)
>
>
> it should be BLINDINGLY obvious that B should be:
>
> comb += self.o.nia.data.eq(0xC00) # trap address
> comb += self.o.nia.ok.eq(1)
>
>
> therefore, in switch statement OP_SC, that's what goes into that function.
>
> and that's it.
>
> ta-daaa. OP_SC is completed.
>
> wasn't that easy?
>
> Q: do you understand or know what OP_SC is or does?
> A: i don't... and don't care, and it is completely irrelevant to you, as
> well.
>
> (it's *optional* to have understanding: you may *desire* understanding,
> you may *like* to have understanding, but it is, fundamentally,
> *completely
> irrelevant* to the actual task)
>
> Q: do we *need* to understand or know what OP_SC is or does?
> A: no we do not.
>
> Q: will it work?
> A: yes it will.
>
> Q: will there be bugs?
> A: most probably, and those can be found with unit tests.
>
> Q: do absolutely all the required unit tests have to be written *right now*?
> A: no they do not.
>
> Q: do we need to freeze and lock up solid in total fear at our total and
> complete lack of understanding just because those unit tests do not exist?
> A: of course not.
>
> so reading a 1300 page PDF is completely and utterly pointless. and making
> reading that 1300 page PDF a hard, fixed, absolute critical dependency on
> *completing this task* is a false assumption, isn't it?
Very, very helpful. Indeed my false assumption was thankfully very false :)
--
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 02jun2020
From: Luke Kenneth Casson Leighton @ 2020-06-02 23:07 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <F579B954-400A-4D2E-80B4-C7A6C8FE3668@getmailspring.com>
On Wednesday, June 3, 2020, Cole Poirier <colepoirier@gmail.com> wrote:
> Today:
>
> Translate microwatt vhdl code for trap pipeline into nmigen.
brilliant. should not take long.
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] daily kan-ban update 02jun2020
From: Luke Kenneth Casson Leighton @ 2020-06-02 23:16 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAPweEDzcutLmVo_h7sJWRQ9bcjLqP1wiqW+Zo8J9=-3ZKLwpsw@mail.gmail.com>
i created a link function between PowerDecode2 and the FunctionUnits, it's
not in use... yet.
however as part of that i made the regspec register names sufficiently
consistent so that they can be globally identified by PowerDecode2.
whilst doing that, i found that Branch can legitimately exit with zero
register file changes (branch not taken, no CTR mode, no LR mode).
that had to be fixed... in MultiCompUnit.
long day :)
l.
--
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-02 23:46 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #20 from Cole Poirier <colepoirier@gmail.com> ---
Pushed a commit with my attempt at OP_RFID and OP_SC. Can you take a look at
OP_RFID because I found it hard and confusing to translate? Is the only
remaining TRAP instruction to be implemented OP_ADDPCIS? I see the pseudo code
here for it, but I cannot understand it. Should I look for it's implementation
in microwatt on github?
--
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-02 23:54 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #21 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
comb += self.o.msr.data.eq(Cat(b[63:31], b[26:22], b[15:0]))
this says "concatenate bits and put thrm into the LSBs of MSR".
look again at the VHDL. it says, "transfer 3 sets of bits into their exact
same corresponding bit places.
also, python numbering is start:end+1
you have specified end:start
so the ranges are 0:16
22:27
31:64
make 3 separate assignments ok?
comb += self.o.msr.ok.eq(a)
the ok field is 1 bit, saying "this reg is to be written". by placing the LSB
of a into it (because msr.ok is only 1 wide), you end up with random situations
where the MSB will randomly get written.
msr.ok should be set to 1, to gyarantee it will be written.
also remember to translate this bit:
if c_in(MSR_PR) = '1' then
131 ctrl_tmp.msr(MSR_EE) <= '1';
132 ctrl_tmp.msr(MSR_IR) <= '1';
133 ctrl_tmp.msr(MSR_DR) <= '1';
OP_SC looks great.
--
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-02 23:59 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #22 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #21)
> comb += self.o.msr.data.eq(Cat(b[63:31], b[26:22], b[15:0]))
>
> this says "concatenate bits and put thrm into the LSBs of MSR".
>
> look again at the VHDL. it says, "transfer 3 sets of bits into their exact
> same corresponding bit places.
>
> also, python numbering is start:end+1
>
> you have specified end:start
>
> so the ranges are 0:16
> 22:27
> 31:64
>
> make 3 separate assignments ok?
Thanks, will do.
>
> comb += self.o.msr.ok.eq(a)
>
>
> the ok field is 1 bit, saying "this reg is to be written". by placing the
> LSB of a into it (because msr.ok is only 1 wide), you end up with random
> situations where the MSB will randomly get written.
>
> msr.ok should be set to 1, to gyarantee it will be written.
Ah thank you that was a typo, had meant to put 1.
> also remember to translate this bit:
>
> if c_in(MSR_PR) = '1' then
> 131 ctrl_tmp.msr(MSR_EE) <= '1';
> 132 ctrl_tmp.msr(MSR_IR) <= '1';
> 133 ctrl_tmp.msr(MSR_DR) <= '1';
>
>
>
> OP_SC looks great.
Thanks. I'm not sure how to tranlate c_in and in OP_MTMSR this seems to be done
by just:
```
comb += self.o.msr.data.eq(a)
comb += self.o.msr.ok.eq(1)
```
Is this correct?
--
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-03 0:11 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #23 from Cole Poirier <colepoirier@gmail.com> ---
Pushed a commit with your suggested fixes, however I don't think what I wrote
makes sense, but since I don't understand b_in and c_in I tried follow what you
did in OP_MTMSR.
Also, does OP_ADDPCIS need to be implemented? I cannot find it's implementation
in microwatt.
--
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-03 0:38 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #24 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Cole Poirier from comment #23)
> Pushed a commit with your suggested fixes, however I don't think what I
> wrote makes sense, but since I don't understand b_in and c_in I tried follow
> what you did in OP_MTMSR.
:)
you're still thinking too much. less brain, more automatonic robot :)
the bitassignnents look great.
however, with this:
comb += self.o.msr.data.eq(b)
171 comb += self.o.msr.ok.eq(1)
172
you just trashed all the good work :)
lose those lines.
> Also, does OP_ADDPCIS need to be implemented? I cannot find it's
> implementation in microwatt.
correct, we leave it 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] [OpenPOWER-HDL-Cores] microwatt decoder tables: M-Form and X-Form switched RS and RB
From: Paul Mackerras @ 2020-06-03 0:40 UTC (permalink / raw)
To: Luke Kenneth Casson Leighton
Cc: openpower-hdl-cores, Libre-RISCV General Development
In-Reply-To: <CAPweEDzExCYVqzR+mBEeyr3KwNYS4aFO1QBUSJGynK_53Bgw_w@mail.gmail.com>
On Tue, Jun 02, 2020 at 01:10:37PM +0100, Luke Kenneth Casson Leighton wrote:
> ok. interesting. i start to see how POWER's design hangs together,
> from a RISC / architectural perspective. RA, RB, RC, RT, RS - these
> would have been divided into "lanes" - effectively register file and
> inter-Function-Unit "broadcast" buses: 5 of them.
>
> RA, RB, RC and RS were probably also connected to 4 read ports (on a
> 4R1W regfile), and i suspect that RA and RS were multiplexed onto the
> same regfile write port (with stall signals or careful scheduling).
> those broadcast bus lanes would have been shared between:
>
> * read regfile ports
> * write regfile ports
> * Function Unit incoming and outgoing ports.
>
> just as for LD/ST, RS/RB would have been "laned" so that the
> part-result could be "broadcast" onto those buses (without needing
> MUXes to do so), such that the Shift Function Unit can pick it up as
> if the information had come from the register file ports, OP_EXTS was
> also put onto "lane RC" because it can then be likewise used as a
> micro-code block in exactly the same way.
>
> likewise, the OR, AND and XOR operations, to allow direct inter-FU
> communication without any kind of lane cross-over.
>
> it's really elegant, because it basically encodes "operand forwarding"
> into the actual architecture.
>
>
> however the _normal_ focus of RISC is on the instruction encoding. in
> the CDC 6600, there's 3 bits which are quite literally hard-wired to
> enable a given Function Unit (of which there are, as might be obvious
> from the 3-bits used: 8 types). a few extra gates - again directly
> from the opcode - says whether the instruction is 1-operand or
> 2-operands.
>
> i believe in the CDC 6600 it's something ridiculous like under 15
> gates for the entire instruction decoder. now *that's* R(educed)
> I(nstruction) S(et) C(oding)!
>
> this therefore leaves me wondering if something similar was done for
> POWER, where we've simply missed these patterns because they're just
> not documented.
As far as I can see, there are patterns like this to some extent, but
not uniformly, and not as much as one would like.
For example, with the condition register logical ops (crand etc.),
there are 4 bits of the instruction word that give the truth table for
the operation. However, the fixed-point logical ops don't have that.
> example: we know that ADD, NEG, SUB and even CMP can all use the exact
> same underlying add hardware, with A-inversion, Out-inversion,
> carry-in and carry-out detection engaged, optionally, to "augment" the
> operation and turn what would otherwise be a plain add into a NEG, or
> a SUB, and so on.
>
> however... is this fact encoded *in the instructions*? i.e. is the
> instruction set encoded such that:
>
> * "bit 8 indicates invert A"
> * "bit 9 indicates invert output"
> * "pattern of bits in positions X thru Y indicate an *underlying*
> generic ADD hardware is to be used"
Appendix D (Opcode Maps) of the ISA is useful for investigating this
sort of question. The add and sub instructions are on page 1365, with
sub instructions in the first column (bits 1-5 of the instruction word
being 01000) and add instructions in the third column (01010). The
ops that use CA for the carry input seem to be in rows 5-8 and 21-24
(instruction bits 6-10 containing x01xx). The ops that have the carry
input set to one all have bit 6 of the instruction word = 1.
I can't see much more structure to the layout than that, though others
might.
> Rc and OE definitely fall into this category, however my question is:
> does this pattern go much deeper?
>
> if this principle has been applied across the board, in the ISA
> design, the POWER instruction decoder phase could be drastically
> simplified. right now, the decoder is a massive 4 deep nested series
> of Switch/Case statements, and consequently the number of gates
> involved is enormous compared to other RISC architectures.
I don't know of such a principle being applied in recent times, though
there may have been such a principle in the very early days (early
90s). I had hoped that the logic simplification algorithms that the
synthesis tools have would automatically detect the patterns, but
maybe that's asking a bit much. It would probably help if our decode
tables indicated the don't-care entries rather than just putting 0 for
table entries that have no effect.
Paul.
_______________________________________________
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-03 0:47 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #25 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
i added some more TODOs, and also translated the "if blah blah" in OP_MTMSR
which you can now look at and cookie-cut for OP_RFID.
also you missed srr1 in OP_SC. remember to set srr1.ok.eq(1)
--
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-03 1:13 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #26 from Cole Poirier <colepoirier@gmail.com> ---
Thanks for your assisstance, it made things much easier, and more robotic :)
I just pushed a new commit with your suggested changes. If this is now complete
is the next step writing unit tests?
--
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 325] create POWER9 TRAP pipeline
From: bugzilla-daemon @ 2020-06-03 1:28 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #27 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Cole Poirier from comment #26)
> Thanks for your assisstance, it made things much easier, and more robotic :)
> I just pushed a new commit with your suggested changes. If this is now
> complete is the next step writing unit tests?
yes... but it's not complete. every single line needs to be translated,
which means paying attention to every line. it's quite... tedious.
you missed several: i highlighted them for you.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
page: 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