本文整理汇总了C++中BitString::getFieldJustify方法的典型用法代码示例。如果您正苦于以下问题:C++ BitString::getFieldJustify方法的具体用法?C++ BitString::getFieldJustify怎么用?C++ BitString::getFieldJustify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitString
的用法示例。
在下文中一共展示了BitString::getFieldJustify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Expect
void ScrDB::Expect(TARGETING::TargetHandle_t i_ptargetHandle,
BitString & bs,
uint64_t registerId)
{
PRDF_TRAC( "ScrDB::Expect() huid: %X, addr: %016X, data: %08X %08X",
getHuid(i_ptargetHandle), registerId,
bs.getFieldJustify(0,32), bs.getFieldJustify(32,32) );
SimScrDataSet eValues;
DataList data;
// parse all data given
data.push_back(bs.getFieldJustify(0,32));
data.push_back(bs.getFieldJustify(32,32));
eValues.AddData(data);
// PRDF_TRAC("get a copy");
PreScrMap scrMap = eChipset[i_ptargetHandle]; // create/get copy of map
// PRDF_TRAC("update register value");
scrMap[registerId] = eValues; // Add entree
// PRDF_TRAC("update the master");
eChipset[i_ptargetHandle] = scrMap; // copy it back
//PRDF_EXIT( "ScrDB::Expect()" );
}
示例2: Write
void ScrDB::Write(TARGETING::TargetHandle_t i_ptargetHandle,
BitString & bs,
uint64_t registerId)
{
PRDF_TRAC( "ScrDB::Write() huid: %X, addr: %016X, data: %08X %08X",
getHuid(i_ptargetHandle), registerId,
bs.getFieldJustify(0,32), bs.getFieldJustify(32,32) );
unsigned int dataWordSize = bs.getBitLen()/32;
// PRDF_TRAC("dataWordSize1: %d", dataWordSize);
dataWordSize += (bs.getBitLen() % 32) ? 1 : 0;
// PRDF_TRAC("dataWordSize2: %d", dataWordSize);
DataList data;
// parse all data given
data.push_back(bs.getFieldJustify(0,32));
data.push_back(bs.getFieldJustify(32,32));
// PRDF_TRAC("parse all data given");
// look for expected data
DataList expectedData;
if(eChipset.find(i_ptargetHandle) != eChipset.end())
{
PRDF_TRAC("found target");
PreScrMap escrmap = eChipset[i_ptargetHandle];
if(escrmap.find(registerId) != escrmap.end()) // we have expected data value
{
PRDF_TRAC("found scom reg");
SimScrDataSet eValues = escrmap[registerId];
expectedData = eValues.GetData(); // get next set of values
escrmap[registerId] = eValues;
eChipset[i_ptargetHandle] = escrmap;
}
}
if(expectedData.size() > 0)
{
if((expectedData[0] != data[0]) || (expectedData[1] != data[1]))
{
PRDF_ERR("Verify SC register: %p", i_ptargetHandle);
PRDF_ERR(" Address: 0x%016X", registerId);
PRDF_ERR("SCR write Actual : %08X %08X", data[0], data[1]);
PRDF_ERR("SCR write Expected: %08X %08X", expectedData[0], expectedData[1]);
}
else
{
PRDF_TRAC("Verify SC register: %p", i_ptargetHandle);
PRDF_TRAC(" Address: 0x%016X", registerId);
PRDF_TRAC("SCR write Actual: %08X %08X", data[0], data[1]);
}
}
// PRDF_TRAC("get a copy");
// get a copy of the scrMap for this chip - if one does not exist it will be created
ScrMap scrMap = chipset[i_ptargetHandle];
// PRDF_TRAC("update register value");
// update register value
scrMap[registerId] = data; // copy the supplied value to the register
// PRDF_TRAC("update the master");
chipset[i_ptargetHandle] = scrMap; // scrMap is only a copy so must update the master
//PRDF_EXIT( "ScrDB::Write()" );
}