Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE: Experiments with instruction encoding extraction #15

Open
wants to merge 1 commit into
base: sof-gcc10.2
Choose a base branch
from

Conversation

andyross
Copy link

@andyross andyross commented Sep 5, 2022

Not for merge yet, but all the data these scripts operate on is here, so it's a logical place to put it for now.

Fundamentally this is a data extraction project to recover a first-principles description of the Xtensa instruction formats from the executable C code in their existing overlay files.

The tools in this directory product JSON files describing instruction
encodings based on the binutils overlay file xtensa-modules.c.  The
input format accepted is a .tar.gz or .tar.bz2 overlay tarball as
accepted by a crosstools-ng build.  Just run "make" in this directory
to produce a JSON file for each machine description.  (It takes
surprisingly long to compile these files, so feel free to build in
parallel to speed the process!).

Signed-off-by: Andy Ross <[email protected]>
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @andyross - does Maciej need to review ?

@andyross
Copy link
Author

andyross commented Sep 6, 2022

Indeed, this is going to take a few passes to get right and Maciej (I couldn't find his github handle, though I've pointed him and @cujomalainey here) will need to figure out how to apply this and what needs to change. Really this was a weekend hack to see what could be recovered (turns out... almost everything I think, it wasn't so much difficult as it was obtuse).

@cujomalainey
Copy link
Member

Wow this is awesome, if Maciej gives this the thumbs up we can stop banging our heads on license headers.

@cujomalainey
Copy link
Member

@andyross can you convert this to a WIP so it doesn't get merged?

@lgirdwood
Copy link
Member

@andyross also thinking would this go in Zephyr SDK directly or does Zephyr SDK clone this repo as part of SDK build ?

@andyross
Copy link
Author

andyross commented Sep 7, 2022

Nothing this generates is going to be useful except to produce a toolchain. So somewhere along the path to a HiFi-enabled SDK toolchain is where this wants to live, but I'm no llvm expert (nor gcc for that matter, nor SDK build/CI person). I submitted it here just to have somewhere to discuss it and because this is the best single source for overlay files (Zephyr's SDK lacks the Mediatek and AMD files still).

@lgirdwood
Copy link
Member

@andyross this should probably upstream with Maciej's work in LLVM after the xtensa core is merged, but it can be carried here until that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants