From 4cf5ed94a8767efd13265abcc20a5082acc02824 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sat, 18 May 2024 09:13:11 -0600 Subject: tb/gfx_shader_bind: initial commit --- tb/gfx_shader_bind/testbench/data.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tb/gfx_shader_bind/testbench/data.py (limited to 'tb/gfx_shader_bind/testbench/data.py') diff --git a/tb/gfx_shader_bind/testbench/data.py b/tb/gfx_shader_bind/testbench/data.py new file mode 100644 index 0000000..4aa3630 --- /dev/null +++ b/tb/gfx_shader_bind/testbench/data.py @@ -0,0 +1,23 @@ +BAD_PC = 0xffff_ffff >> 2 + +class FrontWave: + def __init__(self, *, group, insn, soft=False): + self.group, self.insn = group, insn + self.retry = insn is None + self._soft = soft + + def __eq__(self, other): + if self._soft and not other._soft: + return other.__eq__(self) + + if other._soft: + return self.group == other.group and \ + ((other.insn is None and self.insn is None) or \ + (other.insn is not None and (not self.insn or self.insn == other.insn))) + + return self.group == other.group and self.insn == other.insn + + def __repr__(self): + insn = f', insn=0x{self.insn:08x}' if not self.retry else '' + soft = f', soft' if self._soft else '' + return f'FrontWave(group={self.group}, retry={int(self.retry)}{insn}{soft})' -- cgit v1.2.3