You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
533 B
Python
22 lines
533 B
Python
from abc import ABCMeta, abstractmethod
|
|
|
|
from power_fv import pfv
|
|
from power_fv.insn import WordInsn
|
|
|
|
|
|
__all__ = ["InsnSpec"]
|
|
|
|
|
|
class InsnSpec(metaclass=ABCMeta):
|
|
def __init__(self, insn, **kwargs):
|
|
if not isinstance(insn, WordInsn):
|
|
raise TypeError("Instruction must be an instance of WordInsn, not {!r}"
|
|
.format(insn))
|
|
|
|
self.insn = insn
|
|
self.pfv = pfv.Interface(**kwargs)
|
|
|
|
@abstractmethod
|
|
def elaborate(self, platform):
|
|
raise NotImplementedError
|