def test_pattern_type_or_length_mismatch(self):
        instr = pyrtl.WireVector(name='instr', bitwidth=8)
        with self.assertRaises(pyrtl.PyrtlError):
            o, _ = pyrtl.match_bitpattern(instr, '000100010')
        with self.assertRaises(pyrtl.PyrtlError):
            o, _ = pyrtl.match_bitpattern(instr, '0001000')
        with self.assertRaises(pyrtl.PyrtlError):
            o, _ = pyrtl.match_bitpattern(instr, '0b00010001')
        with self.assertRaises(pyrtl.PyrtlError):
            o, _ = pyrtl.match_bitpattern(instr, 0b000100010)
        with self.assertRaises(pyrtl.PyrtlError):
            o, _ = pyrtl.match_bitpattern(instr, '')
        with self.assertRaises(pyrtl.PyrtlError):
            o, _ = pyrtl.match_bitpattern(instr, None)
        with self.assertRaises(pyrtl.PyrtlError):
            o, _ = pyrtl.match_bitpattern(instr, instr)