Driver API: TLB¶
Static KV-cache TLB and page-table TLB configuration. See Driver API for the concepts.
Contents¶
| 이름 | 분류 | 설명 |
|---|---|---|
ha_drv_init_tlb |
API | 정적 KV 캐시 TLB 초기화 |
ha_drv_alloc_tlb_page |
API | TLB 페이지 할당 |
ha_drv_dealloc_tlb_page |
API | TLB 페이지 해제 |
ha_drv_configure_tlb |
API | page-table TLB 설정 |
ha_drv_set_page_table_range |
API | 페이지 테이블 주소와 크기 설정 |
ha_drv_flush_tlb |
API | TLB 캐시 전체 무효화 |
ha_drv_init_tlb¶
Initialize the static KV-cache TLB on dev from the geometry in info.
| Parameter | Direction | Default | Description |
|---|---|---|---|
dev |
in | — | Device handle from ha_drv_open. |
info |
in | — | TLB init info (non-null). |
Returns — HaSuccess; HaInvalidArgument if dev/info is null; HaDeviceNotReady if a reset is in
progress; or the device's TLB error.
시그니처 · 예제
1 | |
예제
1 2 3 4 5 6 7 | |
ha_drv_alloc_tlb_page¶
Allocate a TLB page on dev. Backs the runtime's TLB API.
| Parameter | Direction | Default | Description |
|---|---|---|---|
dev |
in | — | Device handle from ha_drv_open. |
tlb_alloc_info |
in | — | TLB alloc info. |
Returns — HaSuccess; HaInvalidArgument if dev/tlb_alloc_info is null; HaDeviceNotReady if a reset is in
progress; or the device's TLB error.
시그니처 · 예제
1 | |
예제
1 2 3 4 5 | |
ha_drv_dealloc_tlb_page¶
Free a TLB page on dev. Backs the runtime's TLB API.
| Parameter | Direction | Default | Description |
|---|---|---|---|
dev |
in | — | Device handle from ha_drv_open. |
tlb_dealloc_info |
in | — | TLB dealloc info. |
Returns — HaSuccess; HaInvalidArgument if dev/tlb_dealloc_info is null; HaDeviceNotReady if a reset is
in progress; or the device's TLB error.
시그니처 · 예제
1 | |
예제
1 2 3 4 5 | |
ha_drv_configure_tlb¶
Configure the page-table TLB on dev. (Re)configuration always invalidates the TLB cache; use
ha_drv_flush_tlb for standalone invalidation.
| Parameter | Direction | Default | Description |
|---|---|---|---|
dev |
in | — | Device handle from ha_drv_open. |
auto_prefetch_enable |
in | — | Non-zero to enable auto-prefetch. |
auto_prefetch_len_x |
in | — | Auto-prefetch length along the X dimension. |
auto_prefetch_len_y |
in | — | Auto-prefetch length along the Y dimension. |
auto_prefetch_stride_y |
in | — | Auto-prefetch stride along the Y dimension. |
transl_time_limit |
in | — | Address-translation time limit in cycles; 0 means no limit. |
page_size |
in | — | Page size in bytes. |
shared_channel_number |
in | — | Number of shared DRAM channels. |
Returns — HaSuccess; HaInvalidArgument if dev is null; HaDeviceNotReady if a reset is in progress; or the
device's TLB error.
시그니처 · 예제
1 2 3 | |
예제
1 2 3 | |
ha_drv_set_page_table_range¶
Set the page-table base address and size on dev (page-table TLB).
| Parameter | Direction | Default | Description |
|---|---|---|---|
dev |
in | — | Device handle from ha_drv_open. |
page_table_base_addr |
in | — | Physical base address of the page table. |
page_table_size |
in | — | Size in bytes of the page-table region. |
effective_vpn_width |
in | — | Number of significant bits in the virtual page number. |
cache_invalidate |
in | — | Non-zero to invalidate the TLB cache once after updating the range. |
Returns — HaSuccess; HaInvalidArgument if dev is null; HaDeviceNotReady if a reset is in progress; or the
device's TLB error.
시그니처 · 예제
1 2 | |
예제
1 2 | |
ha_drv_flush_tlb¶
Flush (invalidate) the entire TLB cache on dev (page-table TLB).
| Parameter | Direction | Default | Description |
|---|---|---|---|
dev |
in | — | Device handle from ha_drv_open. |
Returns — HaSuccess; HaInvalidArgument if dev is null; HaDeviceNotReady if a reset is in progress; or the
device's TLB error.
시그니처 · 예제
1 | |
예제
1 | |