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 216] LOAD STORE buffer needed
Date: Sun, 19 Apr 2020 17:46:26 +0000
Message-ID: <bug-216-13-KQ5GHy1ROe@https.bugs.libre-soc.org/> (raw)
In-Reply-To: <bug-216-13@https.bugs.libre-soc.org/>

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

--- Comment #23 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
https://libre-soc.org/3d_gpu/mem_l0_to_l1_bridge_v2.png

ok done. it works like this:

* each FU (0-7) produces 2 LD/ST addresses which are broken up like this:

  addr1[0..3] addr1[4] addr1[5..11] addr1[12..48]
  addr2[0..3] addr2[4] addr2[5..11] addr2[12..48]

  where the relationship between addr1 and addr2 is:

       addr1[5..11] + 1 == addr2[5..11]

* addr1[0..3], in combination with the LD/ST len (1/2/3/4) is turned into
  a bytemap mask, 24 bits in length.  this bytemask is broken down into
  two halves:

      bytemask1, bytemask2 = map_addr(addr, LDST_len) [0..15], [16..23]

  i.e. anything that does not fit fully into bytemask1 is a "misaligned"
  LD/ST and the remainder overflows into bytemask2.

* if addr[4..11] == 0b111111111 and bytemask2 is non-zero, this indicates
  a "misaligned major page fault".

   this is a situation that we are *not* going to deal with (and it has
   been catered for in the 3.0B spec)

* all 16 FU LD/ST re-encodings of the (addr, LDST_len) are lined up in a
  table.  this table breaks down, alternating between:

  * FU # aligned     or FU # misaligned
  * addr1[5:11]      or addr2[5:11]
  * addr[12:48] for *BOTH*
  * bytemap1[0:15]   or bytemap2[0:15]
  * data1[0:15]      or data2[15]

note that addr[4] is *not* included in this because it is used to select
whether L1 cache bank #0 or #1 is to be used.

the algorithm for merging of LD/STs into *one single L1 cache line* is:

1). With a PriorityPicker find the index (row) of the first valid LD/ST request

2). For all entries after that row, compare Addr[5:11] and Addr[12:48].

3). If "match" on both, OR the byte-mask for that row onto the output.

that's it.  that's really all there is to it.


one thing that's important to note: there are only actually *eight* comparisons
of addr[12:48] needed (not 16), because the addr[12:48] is *identical* for
every *pair* of rows.

that however is still *seven* potential 36-bit CAM hits (seven lots of 36-bit
XOR gates).  which is a hell of a lot.

if we could somehow use the L1 "tag" in place of Addr[12:48], that would save a
huge amount of power.  unfortunately, every way i can think of that would get
the tag *into* L0 is either equally power-consuming, or results in multi-cycle
latency.

if we could reliably use a hash instead, i would suggest it.  however,
unfortunately, the risk of a collision is too detrimental consequences.

the "sensible" option that does not have too detrimental an effect on
performance is: reduce the number of LD/ST FUs to 6.  that would result in only
12 rows.

-- 
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: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-216-13@https.bugs.libre-soc.org/>
2020-04-19  9:51 ` bugzilla-daemon
2020-04-19  9:57 ` bugzilla-daemon
2020-04-19 15:22 ` bugzilla-daemon
2020-04-19 17:46 ` bugzilla-daemon [this message]
2020-04-20  9:10 ` bugzilla-daemon
2020-04-22 10:53 ` bugzilla-daemon
2020-04-22 12:17 ` bugzilla-daemon
2020-04-25 12:40 ` bugzilla-daemon
2020-04-26 11:28 ` bugzilla-daemon
2020-04-27 11:56 ` bugzilla-daemon
2020-04-29 11:16 ` bugzilla-daemon
2020-04-29 21:42 ` bugzilla-daemon
2020-05-01 13:27 ` bugzilla-daemon
2020-05-01 13:33 ` bugzilla-daemon
2020-05-04 10:21 ` bugzilla-daemon
2020-05-04 20:11 ` bugzilla-daemon
2020-05-06  0:33 ` bugzilla-daemon
2020-05-06  1:09 ` bugzilla-daemon
2020-05-06  1:11 ` bugzilla-daemon
2020-05-06  8:29 ` bugzilla-daemon
2020-05-06  8:42 ` bugzilla-daemon
2020-05-06 12:39 ` bugzilla-daemon
2020-05-06 13:12 ` bugzilla-daemon
2020-05-18  4:09 ` bugzilla-daemon
2020-05-23 15:17 ` bugzilla-daemon
2020-05-23 15:23 ` bugzilla-daemon
2020-05-24 19:29 ` bugzilla-daemon
2020-05-24 19:39 ` bugzilla-daemon
2020-05-25 10:36 ` bugzilla-daemon
2020-05-25 13:55 ` bugzilla-daemon
2020-05-26 12:50 ` bugzilla-daemon
2020-05-27 11:10 ` bugzilla-daemon
2020-05-28 12:35 ` bugzilla-daemon
2020-05-28 12:38 ` bugzilla-daemon
2020-05-28 13:07 ` bugzilla-daemon
2020-05-28 13:26 ` bugzilla-daemon
2020-05-28 20:34 ` bugzilla-daemon
2020-05-29 13:56 ` bugzilla-daemon
2020-05-29 16:17 ` bugzilla-daemon
2020-05-30 19:40 ` bugzilla-daemon
2020-06-02 18:26 ` bugzilla-daemon
2020-06-04 16:49 ` bugzilla-daemon
2020-06-05 19:17 ` bugzilla-daemon
2020-06-05 19:40 ` bugzilla-daemon
2020-06-07 23:42 ` bugzilla-daemon
2020-03-11 20:28 [libre-riscv-dev] [Bug 216] New: " bugzilla-daemon
2020-03-11 22:54 ` [libre-riscv-dev] [Bug 216] " bugzilla-daemon
2020-03-11 23:08 ` bugzilla-daemon
2020-03-12  1:54 ` bugzilla-daemon
2020-03-12 11:13 ` bugzilla-daemon
2020-03-12 13:35 ` bugzilla-daemon
2020-03-12 17:29 ` bugzilla-daemon
2020-03-13 11:50 ` bugzilla-daemon
2020-03-13 18:37 ` bugzilla-daemon
2020-03-13 20:16 ` bugzilla-daemon
2020-03-15 21:19 ` bugzilla-daemon
2020-03-16 17:25 ` bugzilla-daemon
2020-03-23 10:21 ` bugzilla-daemon
2020-03-24 13:55 ` bugzilla-daemon
2020-03-24 14:22 ` bugzilla-daemon
2020-03-24 18:00 ` bugzilla-daemon
2020-03-24 20:19 ` bugzilla-daemon
2020-03-24 20:27 ` 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-216-13-KQ5GHy1ROe@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