+ All Categories
Home > Documents > Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards...

Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards...

Date post: 23-Sep-2020
Category:
Upload: others
View: 10 times
Download: 0 times
Share this document with a friend
13
Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory, University of Cambridge 2 nd RISC-V workshop, 30/06/2015 Code release and tutorial: http://www.lowrisc.org/docs/tutorial/
Transcript
Page 1: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Towards General Purpose Tagged Memory

Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory, University of Cambridge

2nd RISC-V workshop, 30/06/2015

Code release and tutorial: http://www.lowrisc.org/docs/tutorial/

Page 2: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

lowRISC Project

• lowRISC – Open source SoC provider

– 64-bit RISC-V ISA, Rocket core

– Key features: tagged memory and “minion” cores

• Tagged memory – Adding tag bits for each 64-bit word.

– [Permission] Protection against control-flow hijacking

– [Lock] Memory synchronization

– [Type] Garbage collection

– [Breakpoint] Debugging

2

Page 3: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Rocket Chip

Rocket Core

L2 & Coherence Manager

L2 & Coherence Manager

TileLink

I$ D$

Rocket Tile

TileLinkTileLink

L2 & Coherence Manager

TileLinkTileLinkTileLink

Rocket Core

I$ D$

Rocket Tile

Rocket Core

I$ D$

Rocket Tile

Arbiter

Memory Controller

MemIO Converter

Rocket Tile: Rocket core, private I$ and D$

Crossbar between L1 and banked L2

Banked L2 (coherence manager)

Single memory port, format converter

Memory

3

Page 4: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Support Tagged Memory (1)

Rocket Core

L2 & Coherence Manager

L2 & Coherence Manager

TileLink

Allocator

I$ D$

Rocket Tile

TileLinkTileLink

L2 & Coherence Manager

TileLinkTileLinkTileLink

Rocket Core

I$ D$

Rocket Tile

Rocket Core

I$ D$

Rocket Tile

Tracker & Converter

DataArray

Tracker & Converter

MetaDataArray

Arbiter

Memory Controller

Tag Cache

Word Word Word Word Word Word Word512 bit

528 bit Word Word Word Word Word Word Word

tag

Word

Word

tag tag tag tag tag tag tag

Augment each 64-bit word with tag bits

Augmented cache line is transparent to coherence control.

4

Page 5: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Support Tagged Memory (1)

Rocket Core

L2 & Coherence Manager

L2 & Coherence Manager

TileLink

Allocator

I$ D$

Rocket Tile

TileLinkTileLink

L2 & Coherence Manager

TileLinkTileLinkTileLink

Rocket Core

I$ D$

Rocket Tile

Rocket Core

I$ D$

Rocket Tile

Tracker & Converter

DataArray

Tracker & Converter

MetaDataArray

Arbiter

Memory Controller

Tag Cache

Word Word Word Word Word Word Word512 bit

528 bit Word Word Word Word Word Word Word

tag

Word

Word

tag tag tag tag tag tag tag

Augment each 64-bit word with tag bits

Augmented cache line is transparent to coherence control.

Memory is partitioned into data and tag regions. Every memory access needs a data access and an extra tag access. To reduce the number of tag access, a tag cache is added.

5

Page 6: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Support Tagged Memory (2)

Rocket Core

L2 & Coherence Manager

L2 & Coherence Manager

TileLink

Allocator

I$ D$

Rocket Tile

TileLinkTileLink

L2 & Coherence Manager

TileLinkTileLinkTileLink

Rocket Core

I$ D$

Rocket Tile

Rocket Core

I$ D$

Rocket Tile

Tracker & Converter

DataArray

Tracker & Converter

MetaDataArray

Arbiter

Memory Controller

Tag Cache

6

New instructions for load/store tag: LTAG rd, imm(rs1) # load tag @ rs1 + imm to rd STAG rs2, imm(s1) # store tag rs2 @ rs1 + imm Adding a new memory op type M_T in D$. No change in core pipeline.

Page 7: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Support Tagged Memory (2)

Rocket Core

L2 & Coherence Manager

L2 & Coherence Manager

TileLink

Allocator

I$ D$

Rocket Tile

TileLinkTileLink

L2 & Coherence Manager

TileLinkTileLinkTileLink

Rocket Core

I$ D$

Rocket Tile

Rocket Core

I$ D$

Rocket Tile

Tracker & Converter

DataArray

Tracker & Converter

MetaDataArray

Arbiter

Memory Controller

Tag Cache

7

New instructions for load/store tag: LTAG rd, imm(rs1) # load tag @ rs1 + imm to rd STAG rs2, imm(s1) # store tag rs2 @ rs1 + imm Adding a new memory op type M_T in D$. No change in core pipeline.

Multiple trackers (transaction handlers) to serve multiple memory access in parallel.

Non-intrusive to current Rocket chip. Easy to implement. But not efficient.

Page 8: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Function and Performance Tests

• Function tests: – Inline assembly to use LTAG/STAG

– Bare metal assembly test cases (riscv-tests)

– Larger C programs (proxy kernel) to memory sweep with tags

– Boot Linux with separated tag region

– SystemVerilog unit test for the tag cache (random package generation)

• Performance tests: – SPECInt 2006 benchmark (9 out of 12)

8

Page 9: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

SPECInt 2006 Result (1) I$

8 KiB (MPKI)

D$ 16 KiB (MPKI)

L2 256 KiB (MPKI)

Mem Traffic No Tag (TPKI)

Tag $ 16 KiB (MPKI)

Traffic Ratio

Tag $ 32 KiB (MPKI)

Traffic Ratio

Tag $ 64 KiB (MPKI)

Traffic Ratio

Tag $ 128 KiB (MPKI)

Traffic Ratio

perlbench 20 5 <1 2 <1 1.289 <1 1.089 <1 1.025 <1 1.011

bzip2 <1 14 10 16 10 1.941 7 1.688 3 1.281 <1 1.007

gcc 15 11 4 6 2 1.497 <1 1.240 <1 1.072 <1 1.023

mcf <1 168 104 136 67 1.651 40 1.409 11 1.128 3 1.040

gobmk 24 8 3 6 1 1.368 <1 1.146 <1 1.073 <1 1.046

sjeng 11 5 1 3 1 1.673 <1 1.482 <1 1.383 <1 1.316

h264ref 1 3 2 3 <1 1.480 <1 1.265 <1 1.109 <1 1.028

omnetpp 40 5 <1 <1 <1 1.653 <1 1.415 <1 1.190 <1 1.042

astar <1 21 5 9 4 1.750 2 1.471 <1 1.173 <1 1.009

average 12 27 14 20 10 1.589 6 1.356 2 1.159 <1 1.058

9

MPKI: misses per 1000 instructions TPKI: transactions per 1000 instructions

Page 10: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

SPECInt 2006 Result (2)

10

0 32 64 96 1280

50

100

150

200

Me

mo

ry T

raff

ic (

MP

KI)

Tag Cache Size (KiB)

mcf

sjeng

average

0 32 64 96 1281.0

1.2

1.4

1.6

1.8

Me

mo

ry T

raff

ic R

atio

Tag Cache Size (KiB)

mcf

sjeng

average

Memory traffic ratio Tagged/no tag

Memory Traffic (MPKI)

Page 11: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Future Work (1)

• Optimizing the tag cache

– Identify non-tag pages

– Automatic check for non-tag (zero tags) cache line

– Write back only revised tags

• Further ISA support

– Atomic data + tag load/store

– I$, trap instructions lack of permissions in tags

– Set/reset tags for a whole cache line

11

Page 12: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Future Work (2)

• General tag interpretation

– Propagate tags through core pipeline

– General tag interpretation/check/operation

– Rule configuration

• Static table

• Controlled by minion cores

12

Page 13: Towards General Purpose Tagged Memorywsong83.github.io/presentation/riscv2015.pdf · Towards General Purpose Tagged Memory Wei Song, Alex Bradbury, and Robert Mullins Computer Laboratory,

Conclusion

• Add tagged memory in Rocket chip

– Augment cache lines with tag bits

– Add a tag cache to reduce memory traffic

– New instructions for tag load/store

– More optimization in the future

13

Fro more information and get in touch: 1. Talk to Alex or me. 2. http://www.lowrisc.org/ 3. E-Mail to [email protected]


Recommended