diff --git a/basil/HL/tdl_tdc.py b/basil/HL/tdl_tdc.py index d764c473..798e64e8 100644 --- a/basil/HL/tdl_tdc.py +++ b/basil/HL/tdl_tdc.py @@ -60,7 +60,7 @@ def is_time_word(self, word): return self.word_type_codes[self.get_word_type(word)] in ["TRIGGERED", "RISING", "FALLING"] def get_raw_tdl_values(self, word): - return word & 0b1111111 + return word & 0x7F def tdl_to_time(self, tdl_value): sample_proportion = self.calib_vector[tdl_value] @@ -111,17 +111,17 @@ def disassemble_tdc_word(self, word): word_type = self.word_type_codes[self.get_word_type(word)] if word_type in ["CALIB", "TRIGGERED", "RISING", "FALLING"]: return { - "source_id": (word >> (32 - 4)), + "source_id": word >> (32 - 4), "word_type": word_type, - "tdl_value": word & 0b1111111, + "tdl_value": word & 0x7F, "fine_clk_value": self.get_tdc_value(word), "raw_word": word, } elif word_type in ["TIMESTAMP", "RST"]: return { - "source_id": (word >> (32 - 4)), + "source_id": word >> (32 - 4), "word_type": word_type, - "timestamp": (word >> 9) & 0xFFFF, + "timestamp": word & 0x1FFFFFF, "raw_word": word, } else: