Skip to content

Latest commit

 

History

History
204 lines (120 loc) · 4.52 KB

File metadata and controls

204 lines (120 loc) · 4.52 KB

TLB

#include <tlb.hpp>

class TLB

Defined in include/tlb.hpp:30

RISC-V Translation Lookaside Buffer.

List of all members

Name Kind Owner
TLB function Declared here
~TLB function Declared here
lookup function Declared here
insert function Declared here
flush_all function Declared here
flush_addr function Declared here
flush_asid function Declared here
flush_addr_asid function Declared here

Public Methods

Return Name Description
TLB inline TLB Constructor.
~TLB inline TLB Destructor.
bool lookup Looks up in cache for TLB entry.
void insert Inserts new TLB entry in cache.
void flush_all inline Flushes all TLB entries.
void flush_addr inline Flushes all TLB entries by address.
void flush_asid inline Flushes all TLB entries by ASID.
void flush_addr_asid inline Flushes all TLB entries by address and ASID.

TLB

inline

inline TLB()

Defined in include/tlb.hpp:36

TLB Constructor.


~TLB

inline

inline ~TLB()

Defined in include/tlb.hpp:40

TLB Destructor.


lookup

bool lookup(uint64_t va, AccessType type, uint16_t asid, int mode, bool mxr, bool sum, uint64_t * pa)

Defined in include/tlb.hpp:76

Looks up in cache for TLB entry.

See also: MMU

See also: Hart

Returns

Is success?

Parameters

Parameter Type Description
va uint64_t Virtual Address
type AccessType Access type
asid uint16_t ASID
mode int Privilage Mode casted to integer
mxr bool Hart Status MXR bit
sum bool Hart Status SUM bit
pa uint64_t * Physical Address pointer

insert

void insert(uint64_t va, uint64_t pa, uint8_t page_bits, uint8_t perm, uint16_t asid, bool global)

Defined in include/tlb.hpp:87

Inserts new TLB entry in cache.

See also: MMU

Parameters

Parameter Type Description
va uint64_t Virtual Address
page_bits uint8_t Size of PPN page bits
perm uint8_t Permissions bit set
asid uint16_t Entry ASID
global bool Entry G bit

flush_all

inline

inline void flush_all()

Defined in include/tlb.hpp:92

Flushes all TLB entries.


flush_addr

inline

inline void flush_addr(uint64_t)

Defined in include/tlb.hpp:98

Flushes all TLB entries by address.

Note

Currently does nothing; calls flush_all


flush_asid

inline

inline void flush_asid(uint16_t)

Defined in include/tlb.hpp:103

Flushes all TLB entries by ASID.

Note

Currently does nothing; calls flush_all


flush_addr_asid

inline

inline void flush_addr_asid(uint64_t, uint16_t)

Defined in include/tlb.hpp:108

Flushes all TLB entries by address and ASID.

Note

Currently does nothing; calls flush_all