gpt4 book ai didi

c - 为什么我们在用于内存测试的模式末尾找到 ULL?

转载 作者:太空宇宙 更新时间:2023-11-04 07:46:02 26 4
gpt4 key购买 nike

<分区>

在为测试内存而编写的模式末尾添加 ULL 有什么用?

例如

uint64 pattern_55 =  0xAAAAAAAAAAAAAAAAULL;

static error_t sram_aa_55_test(uint32 start_address, uint32 tested_area_size)
{
error_t status = E_NOERROR;

/*Patterns used to test every SRAM cell */
uint64 pattern_aa = 0x5555555555555555ULL;
uint64 pattern_55 = 0xAAAAAAAAAAAAAAAAULL;

/* Current address being tested */
uint32 address;

/* data read back in memory */
uint64 data_read;

/* AA pattern test */
memset((uint64*)start_address, pattern_aa, tested_area_size);
sync();

for (address = start_address; address < start_address + tested_area_size; address += sizeof(uint64))
{
/* read back the memory cell and check that it contains the same pattern we just wrote */
data_read = rd_io_64(address);

if (data_read != pattern_aa)
{
return CORE_Test_Error;
}
}
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com