Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions blog/20250819_tlb_middleware.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Introducing TLB Middleware in Akita
description: We have updated TLB with new protocols and the TLB Middleware
slug: tlb-middleware-in-akita
authors: [daoxuanxu, huizhizhao]
tags: [akita, tlb]
hide_table_of_contents: false
---

# TLB Middleware in Akita

The Translation Lookaside Buffer (TLB) is a crucial component in virtual memory systems that speeds up virtual-to-physical address translation. We have updated the `tlb` package with our “drain-flush-restart” protocol and implemented middlewares to support higher modularity, flexibility, and efficiency.

`tlbMiddleware` is responsible for managing and executing all internal TLB requests and tasks. It is designed to operate in a pipelined manner, processing up to multiple requests per cycle and maintaining internal state for control flow.

<!-- truncate -->

## Problems
TLB only supports 1-cycle latency when processing requests. Control messages and operational requests are not diversified. TLB functionalities are concentrated and lengthy.

## Work Principle

### Key Components and Features
A. ControlPort Handling(Flush/Restart/switch): Manages incoming control messages, enables reaction to system-level control.

B. State Machine(Enable/Drain/Pause): Specifies actions under different circumstances, ensures that the component works properly if simulation process is somehow paused or stopped.

C. Pipeline: Operates as an intermediate queue to enable multiple requests to be processed.

### Ticking Flow
The basic flow of the `tlbMiddleware` is as follows:

For each "Ticking" cycle, tlbMiddleware first peeks into the controlPort and performs the control message to either perform `Flush`/`Restart` or switch the state of tlbMiddleware between `enable`/`drain`/`pause`.

According to its current state, the middleware executes state-dependent behavior: enabled, draining, or paused.

- In the `enable` state, the middleware first tries to retrieve and send responded MSHR entries to top via `respondMSHREntry()`. Then, it parses incoming translation responses from lower memory via `parseBottom()`. After generating responses, it ticks the pipeline to retrieve new translation requests and process requests in line via `lookup()`.

- In the `drain` state, the middleware does similar cyclic tasks as in the `enable` state, where it responds to completed MSHR entries and parses incoming translation responses from lower memory. However, when ticking the pipeline, it no longer fetches new requests and only processes remaining requests in the pipeline. After both MSHR and bottomPort are drained to empty, the state will be switched to `pause`.

- In the `pause` state, the middleware does nothing.


With pipeline and actions regulated by different states, tlbMiddleware improves the efficiency of the TLB component in handling requests in parallel.
18 changes: 18 additions & 0 deletions blog/authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,22 @@ xuzhongwang:
image_url: https://media.licdn.com/dms/image/v2/D4E03AQFAjQqjt1Iq-A/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1730063518631?e=1754524800&v=beta&t=_pRMwAM8Vl265YZPsSl6kCZqnWsdTN-jBOYrRSXtmgQ
socials:
github: xuzhongwm
page: true

huizhizhao:
name: Huizhi Zhao
title: Undergraduate Student
url: https://sarchlab.org/huizhizhao
image_url: https://media.licdn.com/dms/image/D4D03AQH8b1d2f3jQ9g/profile-displayphoto-shrink_800_800/0/1730063518631?e=1754524800&v=beta&t=6k5J7Xq2c4Zy3Yp5a6m8x9z7F1n9G8V7Wl4u1k5K2hE
socials:
github: sylvzhz
page: true

daoxuanxu:
name: Daoxuan Xu
title: Undergraduate Student
url: https://sarchlab.org/daoxuanxu
image_url: https://media.licdn.com/dms/image/D4D03AQH8b1d2f3jQ9g/profile-displayphoto-shrink_800_800/0/1730063518631?e=1754524800&v=beta&t=6k5J7Xq2c4Zy3Yp5a6m8x9z7F1n9G8V7Wl4u1k5K2hE
socials:
github: DX990307
page: true
Loading