[Libre-soc-bugs] [Bug 745] OP_TERNARY instruction

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Dec 9 04:06:20 GMT 2021


https://bugs.libre-soc.org/show_bug.cgi?id=745

--- Comment #29 from Jacob Lifshay <programmerjake at gmail.com> ---
I decided that just passing the cpu's pspec into everything would work best, so
added it as parent_pspec variables, since it being parent makes it more obvious
what's going on. Hopefully I didn't miss anything important in my refactor...

I also added forwarding via __getattr__ so code expecting attributes to be set
on pspec will automatically get them from parent_pspec too.

class CommonPipeSpec:
    """CommonPipeSpec: base class for all pipeline specifications
    see README.md for explanation of members.
    """

    def __init__(self, id_wid, parent_pspec):
        self.pipekls = SimpleHandshakeRedir
        self.id_wid = id_wid
        self.opkls = lambda _: self.opsubsetkls()
        self.op_wid = get_rec_width(self.opkls(None))  # hmm..
        self.stage = None
        self.parent_pspec = parent_pspec

    # forward attributes from parent_pspec
    def __getattr__(self, name):
        return getattr(self.parent_pspec, name)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list