Skip to content

Conversation

AliAlaa88
Copy link
Contributor

This pull request adds a new Python generator script and a corresponding Rake task to automate the detection of overlapping instruction encodings for simulators (such as Spike). The generator analyzes instruction definitions and outputs declarations for instructions whose encodings overlap, which is important for proper simulator handling. The Rake task integrates this generator into the build process, allowing easy regeneration of overlap declarations as needed.

New Overlap Detection Feature:

  • Added overlap_list_generator.py script to backends/generators/overlap_list/, which loads instruction YAML files, analyzes their encoding patterns, and generates a list of overlapping instruction declarations for use in simulators.
  • Implemented logic in the Python script to extract extension names, compare instruction encodings, and group overlaps by general instruction, outputting results in a C header format.

Build System Integration:

  • Created a new output directory gen/overlap_list to store generated overlap declarations.
  • Added a gen:overlap_list Rake task that runs the Python generator, passing the correct instruction directory and output location. The task supports configuration via environment variables for output directory and filename.

Copy link

codecov bot commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.05%. Comparing base (d6d9b9a) to head (775e0fc).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1185   +/-   ##
=======================================
  Coverage   46.05%   46.05%           
=======================================
  Files          11       11           
  Lines        4942     4942           
  Branches     1345     1345           
=======================================
  Hits         2276     2276           
  Misses       2666     2666           
Flag Coverage Δ
idlc 46.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@AFOliveira AFOliveira left a comment

Choose a reason for hiding this comment

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

Thanks for contributing!

I have a question: What's the use-case for this? To check if instruction inside UDB overlap encodings? I think this is already done and integrated with UDB in ./do.

I do prefer python for it instead of ruby, but I am not sure if that alone is a good enough reason to duplicate the way of doing this task.

@AFOliveira
Copy link
Collaborator

AFOliveira commented Oct 10, 2025

Thinking about this again, having duplicate tools inside UDB isn't that big of an issue, as long as there's a good reason for this. This specific test would be something downstream users could rely on instead of using the main ruby code structure as they could run the python script directly. I am not sure about what I think of this. Would like to hear your opinion @AliAlaa88

@AliAlaa88 AliAlaa88 changed the title ISA-sim Overlap List Generator feat: ISA-sim Overlap List Generator Oct 13, 2025
@AliAlaa88
Copy link
Contributor Author

Thinking about this again, having duplicate tools inside UDB isn't that big of an issue, as long as there's a good reason for this. This specific test would be something downstream users could rely on instead of using the main ruby code structure as they could run the python script directly. I am not sure about what I think of this. Would like to hear your opinion @AliAlaa88

I didn't notice the duplication but it was a suggestion from Paul so I did it.
If it will not change in the future i think it is not necessary to have it.

@AliAlaa88 AliAlaa88 changed the title feat: ISA-sim Overlap List Generator feat: isa sim overlap list generator Oct 13, 2025
@AFOliveira
Copy link
Collaborator

AFOliveira commented Oct 13, 2025

@AliAlaa88 Maybe it's not a duplication - but it would be good to understand that. Please do ./do --tasks and follow the tips to understand it. Moreover, maybe it's fine to have duplication, but if you understand this reasoning it will be benificial to both you and the project :)

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.

2 participants