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

Float to Integer instructions cause assertion: "Got an I2F instruction in an ExecutionPipe that does not source the integer RF" #93

Closed
danbone opened this issue Oct 5, 2023 · 2 comments · Fixed by #94
Labels
bug Something isn't working

Comments

@danbone
Copy link
Contributor

danbone commented Oct 5, 2023

All of the float to integer instructions cause this assertion to fire within the execute pipe:

if(SPARTA_EXPECT_FALSE(ex_inst->getPipe() == InstArchInfo::TargetPipe::I2F)) {
sparta_assert(reg_file_ == core_types::RegFile::RF_INTEGER,
"Got an I2F instruction in an ExecutionPipe that does not source the integer RF");

If the intention is that these instructions use the i2f target pipe (not a new f2i type), then I think the code just needs to be changed to handle f2i, and the assertion removed.

Test trace:

[
    {
        "mnemonic": "fcvt.w.s",
        "rs1": 1,
        "rs2": 2,
        "rd": 3
    }
]
@ghost ghost self-assigned this Oct 5, 2023
@ghost ghost added the bug Something isn't working label Oct 5, 2023
@ghost
Copy link

ghost commented Oct 5, 2023

Yep, appears to not have been tested. Thanks for letting us know.

Better to support an f2i target to allow for future pipe assignments (maybe f2i is handled by FP pipes and i2f is handled by IEX pipes).

A tweak to your JSON input:

[
    {
        "mnemonic": "fcvt.w.s",
        "fs1": 1,
        "rd": 3
    }
]

frm is ignored...

Got a fix I'm testing now.

@ghost
Copy link

ghost commented Oct 5, 2023

PR up. Please take a look.

@ghost ghost closed this as completed in #94 Oct 6, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant