[Libre-soc-isa] [Bug 686] create Power ISA test API

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Sep 12 10:15:59 BST 2021


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

--- Comment #36 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to klehman9 from comment #35)
> https://git.libre-soc.org/?p=soc.git;a=commit;
> h=50a8c2147c00271bc82cc3298290d7b046d6f3ae
> 
> Added compare function as a first step (besides, it needed to come over in
> some fashion regardless).
> 
> Tested fine.  Asserts now show what type/class of the different states are
> involved.

excellent, do drop in its usage as well.  i'll run the long test(s)

next on the TODO: given that this is being called tens of thousands of times
it's probably a good idea to begin to add some docstrings :)

also, just occurred to me: the Factory needs "outside modules" to be
capable of adding *themselves* to the dictionary.
example: this API (teststate.py) is one that i'd actually recommend
moving to openpower-isa (because it's fundamentally part of the rest
of the test infrastructure rather than unique to the soc repo)...
... but HDLState has to *stay* in soc because it's got nothing to do
with the *rest* of the openpower-isa repo.

(SimState on the other hand *could* move to openpower-isa)

thus, the Factory dictionary is one of the rare instances in python
where it should be a global, and a global function made available
to add things to it.  that definitely needs comments and a docstring
to explain!

then, when qemustate.py is created, it calls the factory-function
to add QemuState (again, comments/docstrings explaining that this
is unusual) rather than having files accumulate more and more
dependence.

ultimately, a third party should be able to create a completely
independent project and add themselves to the list of things to
test against... *WITHOUT* needing to demand write-access to the
libre-soc source code in order to do so, and *WITHOUT* needing
to create a forked copy of it, as a poor substitute.

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


More information about the Libre-SOC-ISA mailing list