37#ifndef __DEV_ARM_FLASH_DEVICE_HH__
38#define __DEV_ARM_FLASH_DEVICE_HH__
43#include "debug/FlashDevice.hh"
45#include "enums/DataDistribution.hh"
46#include "params/FlashDevice.hh"
125 const std::function<
void()> &
event)
override
132 const std::function<
void()> &
event)
override
This is an interface between the disk interface (which will handle the disk data transactions) and th...
Flash Device model The Flash Device model is a timing model for a NAND flash device.
void checkDrain()
Checkdrain; needed to enable checkpoints.
EventFunctionWrapper planeEvent
Completion event.
void initializeMemory(uint64_t disk_size, uint32_t sector_size) override
Device access functions Inherrited from AbstractNVM.
const enums::DataDistribution dataDistribution
Flash organization.
void initializeFlash(uint64_t disk_size, uint32_t sector_size)
Initialization function; called when all disk specifics are known.
void actionComplete()
Event rescheduler.
void serialize(CheckpointOut &cp) const override
Serialize; needed to create checkpoints.
Tick accessTimes(uint64_t address, Actions accesstype)
Access time calculator.
std::vector< struct PageMapEntry > locationTable
address to logic place has a block and a page field
void accessDevice(uint64_t address, uint32_t amount, const std::function< void()> &event, Actions action)
Flash action function.
FlashDevice(const FlashDeviceParams &)
Initialize functions.
uint32_t pagesPerBlock
Disk dimensions in pages and blocks.
uint64_t diskSize
Disk sizes in bytes.
Tick remap(uint64_t logic_page_addr)
FTL functionality.
std::vector< uint32_t > blockEmptyEntries
number of empty entries
void unserialize(CheckpointIn &cp) override
Unserialize; needed to restore from checkpoints.
std::vector< std::deque< struct CallBackEntry > > planeEventQueue
This vector of queues keeps track of all the callbacks per plane.
std::vector< uint32_t > unknownPages
when the disk is first started we are unsure of the number of used pages, this variable will help det...
void readMemory(uint64_t address, uint32_t amount, const std::function< void()> &event) override
Access functions Access function to simulate a read/write access to the memory.
DrainState drain() override
Checkpoint functions.
void clearUnknownPages(uint32_t index)
Function to indicate that a page is known.
Actions
Defines the possible actions to the flash.
@ ActionCopy
A copy involves taking all the used pages from a block and store it in another.
const uint32_t GCActivePercentage
Garbage collection algorithm emulator.
void writeMemory(uint64_t address, uint32_t amount, const std::function< void()> &event) override
std::vector< uint32_t > blockValidEntries
number of valid entries per block
struct FlashDeviceStats stats
RequestHandler stats.
bool getUnknownPages(uint32_t index)
Function to test if a page is known.
const Tick readLatency
Access latencies.
This is a simple scalar statistic, like a counter.
DrainState
Object drain/handover states.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Tick
Tick count type.
Declaration of Statistics objects.
std::function< void()> function
statistics::Scalar totalGCActivations
Amount of GC activations.
FlashDeviceStats(statistics::Group *parent)
statistics::Histogram fileSystemAccess
statistics::Histogram readAccess
statistics::Histogram readLatency
statistics::Histogram writeAccess
Histogram of address accesses.
statistics::Histogram writeLatency
Histogram of access latencies.
Every logical address maps to a physical block and a physical page.