1

I am writing a DPI checker(.cpp file), In this, Checker reads the 128-bit value on every line and I want to mask it with a 128-bit mask and compare it with RTL value but the issue I am seeing is the data type from which I am creating the mask only holds 32-bit value and I need to do bitwise anding with original data. Can anyone provide any suggestions?

typedef struct {
   BitVector<128>   data
} read_line;

svBitVecVal  mask;
mask = 0xffffffffffffffffffffffffffffffff;

BitVector<128>   data_masked;
data_masked = read_line->data & mask;

Here svBitVecVal can only hold a maximum of 32bit value. data_masked will not show the correct value if the mask is more than 32-bit.

Greg
  • 18,111
  • 5
  • 46
  • 68

1 Answers1

1

I don't know where you got your BitVector template from, but svBitVecVal is usually used as svBitVecVal* pointing to an array of 32 bits chunks.

mask needs to be a 4 element array to hold 128 bits.

And you'll need to either convert mask to a BitVector type first, or make sure it has the right overloaded function to do it for you.

dave_59
  • 39,096
  • 3
  • 24
  • 63