Open
Conversation
added 3 commits
June 15, 2021 12:46
I'm not sure this is actually better than current setup, but it does allow you to avoid passing some strings around I'm not sure how to test this code, so you'd want to take this as a starting point/make sure I got it right, rather than just merging this
If you want to check if it's a specific architecture, just do `isinstance(app, X86Access)` or whathaveyou. This has the advantage of telling the type system the type you're looking at -- if you do that, you can do app.x86dictionary without having to assert that it's an X86Access or cast to x86Access or something
be replaced with isinstance checks I did them for x86SimulationState's set_register and set, but I think if you did it for the rest of the SimLocation stuff, you'd avoid a looot of casts. I think you could probably go so far as to remove the is_<foo> methods entirely, but that's totally up to you Note that if you're suuuuper concerned with performance of the python, you miiight want to disregard this one? I think the bool-check cast is going to be ever so slightly faster? But if you're super concerned with performance, this stuff should probably just be in ocaml :P
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've got three seperate commits of things that might be good ideas (to varying extents)
I wouldn't suggest actually taking any of them directly, since I did them more for ease-of-explanation than with intent that they would actually be correct -- I didn't exactly check them to make sure I didn't miss anything/I don't really understand the code enough to say for sure I'm not breaking something with any of these