Lalla Soft

Data Buffer Classes

NVMeConsole has two data buffer classes.
One is DATAMEM, the other is PCMEM.

DATAMEM class

Properties

Name Description
int size
The size assigned. If the size is zero, the data mem is not assigned.
int datapattern
The data pattern of filled data.

Methods

Name Description
bool DataMem_Assign(int)
Assign data memory in byte size,
string DataMem_Dump()
Print out whole data contents.
string DataMem_HumanReadable(int startoffset, int size)
Print out human readable data contents
void DataMem_SetDataPattern(int pattern)
Fill the memory with specific data pattern
void DataMem_FromFile(string path)
Fill the memory from a file
void DataMem_ToFile(string path)
Save the memory to file
void DataMem_Write32(int offset, UInt32 data)
Write 4 bytes data to offset
UInt32 DataMem_Read32(int offset)
Read 4 bytes from offset

PCMEM class

Properties

Name Description
int size
The size assigned. if the size is zero, the data mem is not assigned.
bool forsystem
Physically contiguous memory. If true, the memory is not released when NVMeConsole is closed.
address_l
Physical address lower of the assigned memory
address_h
Physical address higher of the assigned memory

Method

Name Description
bool PCMem_Assign(int)
Assign physically contiguous memory in byte size.
void PCMem_Free()
Release the memory
string PCMem_Dump()
Print out whole memory contents
void PCMem_FromFile(string path)
Fill the memory from a file
void PCMem_ToFile(string path)
Save the memory to file
void PCMem_Write32(int offset, UInt32 data)
Write 4 bytes data to offset
UInt32 PCMem_Read32(int offset)
Read 4 bytes from offset

Data Pattern

import(“def”, “.\lib\predefinitions.ncs”)
DataPattern.User             = {"name": "User data ",                "DPID": 0x00} 
DataPattern.Zeros = {"name": "Zeros data ", "DPID": 0x01}
DataPattern.Ones = {"name": "Ones data ", "DPID": 0x02}
DataPattern.Sequential = {"name": "Sequential data ", "DPID": 0x03}
DataPattern.SectorNumber = {"name": "Sector Number ", "DPID": 0x04}
DataPattern.RandomData1 = {"name": "Random data1 ", "DPID": 0x05}
DataPattern.RandomData2 = {"name": "Random data2 ", "DPID": 0x06}
DataPattern.Binary_55h = {"name": "Binary data1(55h) ", "DPID": 0x07}
DataPattern.Binary_AAh = {"name": "Binary data2(AAh) ", "DPID": 0x08}
DataPattern.Binary_33h = {"name": "Binary data3(33h) ", "DPID": 0x09}
DataPattern.Binary_CCh = {"name": "Binary data4(CCh) ", "DPID": 0x0A}
DataPattern.Binary_0Fh = {"name": "Binary data5(0Fh) ", "DPID": 0x0B}
DataPattern.Binary_F0h = {"name": "Binary data6(F0h) ", "DPID": 0x0C}
DataPattern.Binary_00FFh = {"name": "Binary data7(00FFh) ", "DPID": 0x0D}
DataPattern.Binary_FF00h = {"name": "Binary data8(FF00h) ", "DPID": 0x0E}
DataPattern.Binary_0000FFFFh = {"name": "Binary data9(0000FFFFh) ", "DPID": 0x0F}
DataPattern.Binary_FFFF0000h = {"name": "Binary data10(FFFF0000h) ", "DPID": 0x10}
DataPattern.Undefined = {"name": "Undefined ", "DPID": 0xFF}

Examples

DATAMEM Examples

PCMEM Examples