Python TLB API¶
| Function | Signature |
|---|---|
init_tlb |
(tlb_init_info: TLBInitInfo) -> None |
alloc_tlb_page |
(tlb_alloc_info: TLBAllocInfo) -> None |
dealloc_tlb_page |
(tlb_dealloc_info: TLBDeallocInfo) -> None |
configure_tlb |
(page_size: int, shared_channel_number: int, auto_prefetch_enable: bool = False, auto_prefetch_len_x: int = 0, auto_prefetch_len_y: int = 0, auto_prefetch_stride_y: int = 0, transl_time_limit: int = 0) -> None |
set_page_table_range |
(page_table_base_addr: int, page_table_size: int, effective_vpn_width: int, cache_invalidate: bool = True) -> None |
flush_tlb |
() -> None |
Import TLBInitInfo, TLBAllocInfo, TLBDeallocInfo, PageType and ValuePageMode from hart.hart
(Types). init_tlb() is for Bertha DC EVT0 only; EVT1 configures the TLB with configure_tlb() and
set_page_table_range(). Each function has the semantics of the C++ TLB API.
Example¶
alloc_tlb_page¶
Allocates pages of one page type for a request.
Example
1 2 3 4 5 6 7 | |
dealloc_tlb_page¶
Releases the request's pages when the request finishes.
Example
1 2 3 4 5 6 7 | |
init_tlb¶
Static KV-cache path, Bertha DC EVT0 only.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |