Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
From: bugzilla-daemon@libre-soc.org
To: libre-riscv-dev@lists.libre-riscv.org
Subject: [libre-riscv-dev] [Bug 305] Create Pipelined ALU similar to alu_hier.py
Date: Wed, 13 May 2020 01:05:04 +0000
Message-ID: <bug-305-13-vjnnmgeF8I@https.bugs.libre-soc.org/> (raw)
In-Reply-To: <bug-305-13@https.bugs.libre-soc.org/>

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

--- Comment #49 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
ok.  i think we need to look more closely at decoder2.py compared to
decode2.vhdl
https://github.com/antonblanchard/microwatt/blob/master/decode2.vhdl

i'm not seeing any reason though why the operands should need "swapping over":
why RC is needing to go into a.

the alignment should definitively be:

* reg3_data into c
* reg2_data (or imm) into b
* reg1_data into a

ah hang on...

https://github.com/antonblanchard/microwatt/blob/master/execute1.vhdl

see lines 183-184:

    logical_0: entity work.logical
        port map (
            rs => c_in,
            rb => b_in,

and here, lines 166-169:

    rotator_0: entity work.rotator
        port map (
            rs => c_in,
            ra => a_in,

that's it.  that's what's going on.  the different pipelines have *different*
register map/alignment, *depending on function-group*.

the *adder* takes A as A, and B as B.  rotator crosses over, logical crosses
over.

what a mess.

ok what i suggest, then, here is: split out Logical ALU operations as well.
the ADD ALU will deal with OP_ADD and OP_CMP.  i don't yet know if we should
allow the ADD ALU to change the PC (handle OP_TRAP), i'm inclined to suggest
that that one be handled in the Branch Computation Unit.

by splitting out:

* ADD/CMP into one pipeline
* Logical into another
* Rotator into another

basically on the face of it we need to use the FunctionOp to determine the
re-routing of the operands.

but... it looks like you've discovered a correlation, where if reg_data3 is
available it can go *first* (into out.a), otherwise if reg_data1 is available, 
*that* goes first (into out.a)

however B i think definitely goes into out.b, or the immediate definitely
goes into out.b, and i think we'll find that there is no "immediate" form
with a register B.

fields.txt

    RB (16:20)
        Field used to specify a GPR to be used as a
        source.
        Formats: A, M, MDS, VA, X, XO

ok so strictly speaking MDS-Form has immediates in it, however if you look
at what anton's done, in minor-opcode table 30:
https://libre-soc.org/openpower/isatables/

he's marked rdlcr as *not* reading the immediate (bit 21, mb/me) as an
immediate, but instead operand2 is marked as "RB".  which explains why
we have to decode insn to get at dec2.mb and dec2.me.

so i think we're good to go with reg2_data (or imm_data) always going into
out.b
and perhaps to have an assert that checks, for these 2-operand pipelines,
that reg3_ok and reg1_ok can never be set simultaneously, and to always put
reg3_data or reg1_data into out.a.  perhaps even as an OR rather than a Mux.

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

  parent reply index

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 15:17 [libre-riscv-dev] [Bug 305] New: " bugzilla-daemon
2020-05-08 15:17 ` [libre-riscv-dev] [Bug 305] " bugzilla-daemon
2020-05-08 15:28 ` bugzilla-daemon
2020-05-08 15:28 ` bugzilla-daemon
2020-05-08 15:29 ` bugzilla-daemon
2020-05-08 15:29 ` bugzilla-daemon
2020-05-08 15:32 ` bugzilla-daemon
2020-05-08 15:35 ` bugzilla-daemon
2020-05-08 15:40 ` bugzilla-daemon
2020-05-08 16:48 ` bugzilla-daemon
2020-05-08 16:54 ` bugzilla-daemon
2020-05-08 17:04 ` bugzilla-daemon
2020-05-08 17:10 ` bugzilla-daemon
2020-05-08 18:38 ` bugzilla-daemon
2020-05-08 23:08 ` bugzilla-daemon
2020-05-09 13:13 ` bugzilla-daemon
2020-05-09 13:37 ` bugzilla-daemon
2020-05-09 13:41 ` bugzilla-daemon
2020-05-09 13:45 ` bugzilla-daemon
2020-05-09 13:48 ` bugzilla-daemon
2020-05-09 14:04 ` bugzilla-daemon
2020-05-09 14:06 ` bugzilla-daemon
2020-05-09 18:23 ` bugzilla-daemon
2020-05-09 19:08 ` bugzilla-daemon
2020-05-09 19:12 ` bugzilla-daemon
2020-05-09 21:18 ` bugzilla-daemon
2020-05-09 21:35 ` bugzilla-daemon
2020-05-09 21:42 ` bugzilla-daemon
2020-05-10  4:25 ` bugzilla-daemon
2020-05-10  4:30 ` bugzilla-daemon
2020-05-10 23:03 ` bugzilla-daemon
2020-05-10 23:06 ` bugzilla-daemon
2020-05-10 23:11 ` bugzilla-daemon
2020-05-10 23:15 ` bugzilla-daemon
2020-05-10 23:42 ` bugzilla-daemon
2020-05-11  0:04 ` bugzilla-daemon
2020-05-11  1:11 ` bugzilla-daemon
2020-05-11 10:30 ` bugzilla-daemon
2020-05-11 13:23 ` bugzilla-daemon
2020-05-11 14:31 ` bugzilla-daemon
2020-05-11 15:51 ` bugzilla-daemon
2020-05-11 16:03 ` bugzilla-daemon
2020-05-11 16:13 ` bugzilla-daemon
2020-05-11 16:13 ` bugzilla-daemon
2020-05-11 18:15 ` bugzilla-daemon
2020-05-11 18:23 ` bugzilla-daemon
2020-05-12  9:24 ` bugzilla-daemon
2020-05-12 10:03 ` bugzilla-daemon
2020-05-12 21:33 ` bugzilla-daemon
2020-05-12 22:02 ` bugzilla-daemon
2020-05-13  1:05 ` bugzilla-daemon [this message]
2020-05-13 16:46 ` bugzilla-daemon
2020-05-13 17:22 ` bugzilla-daemon
2020-05-13 17:29 ` bugzilla-daemon
2020-05-13 18:46 ` bugzilla-daemon
2020-05-13 18:48 ` bugzilla-daemon
2020-05-13 18:57 ` bugzilla-daemon
2020-05-13 21:54 ` bugzilla-daemon
2020-05-14  0:20 ` bugzilla-daemon
2020-05-14 14:37 ` bugzilla-daemon
2020-05-14 14:48 ` bugzilla-daemon
2020-05-14 15:34 ` bugzilla-daemon
2020-05-14 16:17 ` bugzilla-daemon
2020-05-14 16:21 ` bugzilla-daemon
2020-05-14 16:35 ` bugzilla-daemon
2020-05-14 16:54 ` bugzilla-daemon
2020-05-14 17:14 ` bugzilla-daemon
2020-05-14 17:29 ` bugzilla-daemon
2020-05-14 18:42 ` bugzilla-daemon
2020-05-14 19:06 ` bugzilla-daemon
2020-05-14 19:10 ` bugzilla-daemon
2020-05-14 19:21 ` bugzilla-daemon
2020-05-14 19:27 ` bugzilla-daemon
2020-05-14 19:48 ` bugzilla-daemon
2020-05-15 14:00 ` bugzilla-daemon
2020-05-15 14:13 ` bugzilla-daemon
2020-05-15 14:19 ` bugzilla-daemon
2020-05-15 14:23 ` bugzilla-daemon
2020-05-15 15:07 ` bugzilla-daemon
2020-05-15 15:29 ` bugzilla-daemon
2020-05-15 15:30 ` bugzilla-daemon
2020-05-15 15:33 ` bugzilla-daemon
2020-05-15 15:41 ` bugzilla-daemon
2020-05-18  1:40 ` bugzilla-daemon
2020-05-18  4:07 ` bugzilla-daemon
2020-05-18  5:19 ` bugzilla-daemon
2020-05-19 12:02 ` bugzilla-daemon
2020-05-19 12:04 ` bugzilla-daemon
2020-05-19 12:29 ` bugzilla-daemon
2020-05-20  6:06 ` bugzilla-daemon
2020-05-20 14:01 ` bugzilla-daemon
2020-05-20 15:19 ` bugzilla-daemon
2020-05-20 19:28 ` bugzilla-daemon
2020-05-21 10:31 ` bugzilla-daemon
2020-05-22 16:17 ` bugzilla-daemon
2020-05-22 17:27 ` bugzilla-daemon
2020-05-27 16:06 ` bugzilla-daemon
2020-05-27 17:46 ` bugzilla-daemon
2020-05-27 17:56 ` bugzilla-daemon
2020-05-27 18:24 ` bugzilla-daemon
2020-05-27 18:33 ` bugzilla-daemon
2020-05-27 18:38 ` bugzilla-daemon
2020-06-01 23:24 ` bugzilla-daemon
2020-06-08 18:37 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-305-13-vjnnmgeF8I@https.bugs.libre-soc.org/ \
    --to=bugzilla-daemon@libre-soc.org \
    --cc=libre-riscv-dev@lists.libre-riscv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Libre RISC-V Mailing list Archives (accessible via public-inbox)

Archives are clonable: git clone --mirror https://inbox.libre-soc.org/libre-riscv-dev

Example config snippet for mirrors


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git