Skip to content

FetchQueue credit count fails for multi-uop vector inst #302

Description

@ADI-ROXX

Part of #290

adi@adi:~/Desktop/riscv-perf-model/debug/test$ ctest -R Vector_test_bug_fetchqueue_credit_overflow -V
...
208: Exception while running
208: total_valid_ != capacity(): FetchQueue: Queue is full: in file: '/home/adi/map/sparta/local-install/include/sparta/resources/Queue.hpp', on line: 703
208:   [out] Writing error dump file 'error-dump.dbg'
208:   [out] Debug state written to "error-dump.dbg"
208: terminate called after throwing an instance of 'sparta::SpartaException'
208:   what():  total_valid_ != capacity(): FetchQueue: Queue is full: in file: '/home/adi/map/sparta/local-install/include/sparta/resources/Queue.hpp', on line: 703
208: Received Signal 6 (Aborted), address is 0x3e80004c719 from (nil)
208: ( 1) /home/adi/Desktop/riscv-perf-model/debug/test/core/vector/Vector_test(+0x921500) [0xb53e62851500]

Cause of this error:

When decode converts a single vector ins to multi-uop, it returns incorrect number of credits to fetch. This cause the above error.

Reproduction

Working test:

[
  { "mnemonic": "vsetivli", "rd": 0, "imm": 16, "vtype": "0x12", "vl": 16, "vta": 1 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 }
]

Failing test

[
  { "mnemonic": "vsetivli", "rd": 0, "imm": 16, "vtype": "0x12", "vl": 16, "vta": 1 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 },
  { "mnemonic": "vfwmacc.vv", "vd": 0, "vs1": 4, "vs2": 8 }
]

You can see that the commands are the same, just that in the failing test, the number is large.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions