Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
From: bugzilla-daemon@libre-riscv.org
To: libre-riscv-dev@lists.libre-riscv.org
Subject: [libre-riscv-dev] [Bug 216] LOAD STORE buffer needed
Date: Thu, 12 Mar 2020 17:29:04 +0000
Message-ID: <bug-216-13-Cz17vALaL0@http.bugs.libre-riscv.org/> (raw)
In-Reply-To: <bug-216-13@http.bugs.libre-riscv.org/>

http://bugs.libre-riscv.org/show_bug.cgi?id=216

--- Comment #6 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
ok i think i have a data structure that will help.  it's a (very small) CAM,
with extra "things".

also it critically depends upon a pre-analysis of the LD/ST operation, breaking
it down from this form, where unary is defined as (1<<N):

FunctionUnit# Addr Length

into:

unary(FU#){0}  Addr[4:]   unary(Addr[0:3]     )  (start=0, mask=000bbbb)
unary(FU#){1}  Addr[4:]+1 unary(Addr[0:3]&mask)  (start=M, mask=bbb0000)

when a write is misaligned across a cache line, it results in the *second*
operation (unary(FU#){1}) being activated, where there would be two separate
and distinct LOADs / STOREs coming from *one* FunctionUnit.

the (start,mask) is so as to be able to shift and mask the data as it comes in
(or out) of the register.  this because when it's split into two, obviously you
have to know which portion of each split covers which part of the data
register.


let us assume that there are 4 LOAD/STORE Function Units.

there is a table (a CAM) with **EIGHT** rows, with an *unary* row-matching
by:

unary(FU#0){0}
unary(FU#0){1}
unary(FU#1){0}
unary(FU#1){1}
unary(FU#2){0}
unary(FU#2){1}
unary(FU#3){0}
unary(FU#3){1}

and in each column there is:

* MSBs of address - address[4:]
* *bitmask* of bytes covered by address[0:3]
* (up to) 128 bit data to be LD/ST'd

basically it's a very very small L0 cache, and because it's so small we can do
row-addressing in *unary*.

the key to resolving misalignment is that initial break-down of the "original"
LD/ST into a *PAIR* (plus a bitmask)

the bit that is a bit... awful is: there will be *four* Load-Store Units
creating and contending for up to *EIGHT* simultaneous reads/writes to this
CAM, worst-case (every single one of the operations crosses a cache-line
boundary)

that's far too much.

i think it is more reasonable to limit that to only four, however even a
four-way port-contention system is still one hell of a lot.

writing to this store/buffer/CAM: with four ports (four ways in CAM
terminology) any one LOAD/STORE will be able to write to two separate addresses
in the CAM

AND

up to *four* LOAD/STORE Units will be able to read/write to the *same* address
(same row).

the Memory itself will need individual byte-level enable lines.

then, the "flush" from this small CAM will be able to read/write entire lines
out to the L1 Cache.  each line will kiinda be like one single-entry FIFO.

-- 
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: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
     [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
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

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-Cz17vALaL0@http.bugs.libre-riscv.org/ \
    --to=bugzilla-daemon@libre-riscv.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