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

Implement Matrix Load #1

Merged
merged 13 commits into from
May 12, 2024
Merged

Implement Matrix Load #1

merged 13 commits into from
May 12, 2024

Conversation

Beanavil
Copy link
Owner

Implement load of two $2\times 2$ matrices 🎉 .
Relevant changes are:

  • New vx_mload intrinsic. It inserts a new custom R-type RISCV instruction with two addresses as input (inside registers), one for each matrix to load.
    • This new instruction is at warp level. Each thread loads the two rows that it will need to compute one of the output values of the matrix multiplication (for instance, thread 0 loads the first row of the first matrix and the first column of the second matrix).
  • New INST_LSU_MLOAD macro with value 4b'1110 for the op_type of the new instruction. The combination of op_type=INST_LSU_MLOAD and ex_type=01 is unique, which allows to uniquely identify the new instruction added.
  • Modified VX_lsu_unit.sv so that when an INST_LSU_MLOAD arrives, 3 additional "instructions" are spawned in the pipeline so that the threads do their corresponding four memory requests and the pipeline is stalled until the requests are made.
  • Modified the commit procedure by only decreasing the count of scheduled instructions when the last of the new instructions generated is committed. This solves the problem that one mload instruction is scheduled at the beginning but 4 of them are committed afterwards.

@Beanavil Beanavil merged commit 1f8c400 into master May 12, 2024
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