diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-05-18 09:13:11 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-05-24 05:58:41 -0600 |
| commit | 4cf5ed94a8767efd13265abcc20a5082acc02824 (patch) | |
| tree | 0a98aaac24245a8daf76d25e8161cd3c03acd2fb /tb/gfx_shader_bind/testbench/data.py | |
| parent | a3559d9e53100cd2d9c1e481ec81eeb90ca0ba5b (diff) | |
tb/gfx_shader_bind: initial commit
Diffstat (limited to 'tb/gfx_shader_bind/testbench/data.py')
| -rw-r--r-- | tb/gfx_shader_bind/testbench/data.py | 23 |
1 files changed, 23 insertions, 0 deletions
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})' |
