gem5 v25.0.0.1
Loading...
Searching...
No Matches
gem5::BaseMMU::MMUTranslationGen Class Reference

#include <mmu.hh>

Inheritance diagram for gem5::BaseMMU::MMUTranslationGen:
gem5::TranslationGen

Public Member Functions

 MMUTranslationGen (Addr page_bytes, Addr new_start, Addr new_size, ThreadContext *new_tc, BaseMMU *new_mmu, BaseMMU::Mode new_mode, Request::Flags new_flags)
Public Member Functions inherited from gem5::TranslationGen
 TranslationGen (Addr new_start, Addr new_size)
 The starting virtual address and the size of the entire region being translated.
virtual ~TranslationGen ()
Addr start () const
Addr size () const
const_iterator begin () const
const_iterator end () const

Private Member Functions

void translate (Range &range) const override
 Subclasses implement this function to complete TranslationGen.

Private Attributes

ThreadContexttc
ContextID cid
BaseMMUmmu
BaseMMU::Mode mode
Request::Flags flags
const Addr pageBytes

Additional Inherited Members

Public Types inherited from gem5::TranslationGen
using const_iterator = TranslationGenConstIterator
Protected Attributes inherited from gem5::TranslationGen
Addr _start
Addr _size

Detailed Description

Definition at line 130 of file mmu.hh.

Constructor & Destructor Documentation

◆ MMUTranslationGen()

gem5::BaseMMU::MMUTranslationGen::MMUTranslationGen ( Addr page_bytes,
Addr new_start,
Addr new_size,
ThreadContext * new_tc,
BaseMMU * new_mmu,
BaseMMU::Mode new_mode,
Request::Flags new_flags )

Member Function Documentation

◆ translate()

void gem5::BaseMMU::MMUTranslationGen::translate ( Range & range) const
overrideprivatevirtual

Subclasses implement this function to complete TranslationGen.

It should accept a Range reference which will have its "vaddr" field set to the virtual address to translate, and the "size" field set to the remaining size of the entire region being translated.

If there is a fault performing the translation of "vaddr", then this function should set the "fault" field of range and return.

If the translation was successful, this method should set "paddr" to the corresponding physical address, and set "size" to the number of bytes corresponding to the translation. Or more precisely, size should be set to the maximum "N" where vaddr + n maps to paddr + n for all 0 <= n <= N.

Implements gem5::TranslationGen.

Definition at line 153 of file mmu.cc.

References cid, gem5::TranslationGen::Range::fault, flags, gem5::TranslationGen::Range::flags, gem5::Request::funcRequestorId, mmu, mode, gem5::NoFault, gem5::TranslationGen::Range::paddr, pageBytes, gem5::roundUp(), gem5::TranslationGen::Range::size, tc, and gem5::TranslationGen::Range::vaddr.

Member Data Documentation

◆ cid

ContextID gem5::BaseMMU::MMUTranslationGen::cid
private

Definition at line 134 of file mmu.hh.

Referenced by MMUTranslationGen(), and translate().

◆ flags

Request::Flags gem5::BaseMMU::MMUTranslationGen::flags
private

Definition at line 137 of file mmu.hh.

Referenced by MMUTranslationGen(), and translate().

◆ mmu

BaseMMU* gem5::BaseMMU::MMUTranslationGen::mmu
private

Definition at line 135 of file mmu.hh.

Referenced by MMUTranslationGen(), and translate().

◆ mode

BaseMMU::Mode gem5::BaseMMU::MMUTranslationGen::mode
private

Definition at line 136 of file mmu.hh.

Referenced by MMUTranslationGen(), and translate().

◆ pageBytes

const Addr gem5::BaseMMU::MMUTranslationGen::pageBytes
private

Definition at line 138 of file mmu.hh.

Referenced by MMUTranslationGen(), and translate().

◆ tc

ThreadContext* gem5::BaseMMU::MMUTranslationGen::tc
private

Definition at line 133 of file mmu.hh.

Referenced by MMUTranslationGen(), and translate().


The documentation for this class was generated from the following files:

Generated on Sat Oct 18 2025 08:06:49 for gem5 by doxygen 1.14.0