class FakeMmioRegRegion

Defined at line 59 of file ../../sdk/lib/driver/fake-mmio-reg/cpp/fake-mmio-reg.h

Represents a region of fake MMIO registers. Each register is backed by a FakeMmioReg instance.

Example:

fake_mmio::FakeMmioRegRegion fake_registers(register_size, number_of_registers);

fdf::MmioBuffer mmio_buffer(fake_registers.GetMmioBuffer());

fake_registers[0].SetReadCallback(read_fn);

fake_registers[0].SetWriteCallback(write_fn);

SomeDriver dut(mmio_buffer);

dut.DoSomeWork(); // backed by mmio_buffer.

Public Methods

fdf::MmioBuffer GetMmioBuffer ()

Constructs and returns a MmioBuffer object with a size that matches the FakeMmioReg.

Defined at line 9 of file ../../sdk/lib/driver/fake-mmio-reg/cpp/fake-mmio-reg.cc

void FakeMmioRegRegion (size_t reg_size, size_t reg_count)

Constructs a FakeMmioRegRegion backed by the given array. reg_size is the size of each

register in bytes, and reg_count is the total number of registers.

Defined at line 63 of file ../../sdk/lib/driver/fake-mmio-reg/cpp/fake-mmio-reg.h

const FakeMmioReg & operator[] (size_t offset)

Accesses the FakeMmioReg at the given offset. Note that this is the byte offset of the region

of MMIO registers, not the index. The accessed FakeMmioReg will be at the index calculated by

|offset| / |reg_size_|

Defined at line 72 of file ../../sdk/lib/driver/fake-mmio-reg/cpp/fake-mmio-reg.h

FakeMmioReg & operator[] (size_t offset)

Accesses the FakeMmioReg at the given offset. Note that this is the byte offset of the region

of MMIO registers, not the index. The accessed FakeMmioReg will be at the index calculated by

|offset| / |reg_size_|

Defined at line 80 of file ../../sdk/lib/driver/fake-mmio-reg/cpp/fake-mmio-reg.h