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

Added Vector Uop Generation Support for Mask Generation and Widening Instructions #181

Merged
merged 16 commits into from
Jul 25, 2024

Conversation

kathlenemagnus
Copy link
Collaborator

Continuing to add support for more and more vector instructions.

  • Expanded vector uop generation to support vector instructions with single destinations (e.g. integer compare instructions which generates masks) and vector widening instructions.
  • Enabled several new categories of vector instructions by adding them to the vector uarch JSON
    • Vector Widening Integer Add/Subtract
    • Vector Bitwise Logical Instructions
    • Vector Integer Compare Instructions
    • Vector Integer Min/Max Instructions
    • Vector Widening Integer Multiply Instructions
    • Vector Mask-Register Logical Instructions
  • Major refactor of the vector unit tester and improved the existing vector tests
  • Added new tests for a widening vector instruction and a mask generation instruction
  • Fixed bug in calculation to determine number of passes needed to execute a vector integer instruction (tail elements now considered)
  • Added vector mask pipe target
  • Added stat in the ROB for the total number of uops retired
  • Refactored printing operators for pipe targets and stall reasons

@kathlenemagnus
Copy link
Collaborator Author

@aarongchan and @klingaard there is still a lot to do here, but I wanted to start this PR before it got any larger. I have a couple of questions for Aaron, but I'll put them in separate comments.

@@ -72,14 +75,14 @@ namespace olympia
// will truncate, but we have each adder support the largest SEW possible
if (ex_inst->getPipe() == InstArchInfo::TargetPipe::VINT)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to define some additional resources for other types of vector resources like boolean logicals, compares, min/max, multiplies and divides. I'm not sure which operations should be supported by the VALU adder.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can just support all under VALU adder, and then have a separate unit for masks, slides, and more complex computations like scatter/gather. I guess in the case of scatter/gathers, we just define a new unit that has a state machine to track for the VALU that is used only by that unit.

core/InstArchInfo.hpp Outdated Show resolved Hide resolved
core/ROB.cpp Outdated
@@ -159,6 +162,7 @@ namespace olympia
out_rob_retire_ack_rename_.send(ex_inst_ptr);

++num_retired_;
num_uops_retired_ += ex_inst_ptr->getUOpCount();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI I'm counting every instruction as 1 uop.

sparta_assert(uop_gen_type != InstArchInfo::UopGenType::NONE,
"Inst: " << current_inst_ << " uop gen type is unknown");
auto x = uop_gen_function_map_.at(uop_gen_type);
return x(this);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably a cleaner way to do this. Open to suggestions...

@@ -18,7 +18,7 @@
{0000000000 00000000 top.dispatch info} Dispatch: mapping target: F2Iiq3
{0000000000 00000000 top.dispatch info} Dispatch: mapping target: BRiq4
{0000000000 00000000 top.dispatch info} Dispatch: mapping target: VINTiq5
{0000000000 00000000 top.dispatch info} Dispatch: mapping target: VINTiq5
{0000000000 00000000 top.dispatch info} Dispatch: mapping target: VSETiq5
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change is just from a bug fix in the print operator.

@aarongchan
Copy link
Collaborator

Did you want to remove the Uop checking code from rename in this PR, since you're already removing all old Uop requirements from ROB?

if (inst_ptr->hasUOps())

@kathlenemagnus
Copy link
Collaborator Author

Did you want to remove the Uop checking code from rename in this PR, since you're already removing all old Uop requirements from ROB?

if (inst_ptr->hasUOps())

Yes that would be great. We should just treat all instructions/uops the same way.

core/Inst.hpp Outdated Show resolved Hide resolved
core/Inst.hpp Outdated Show resolved Hide resolved
@kathlenemagnus
Copy link
Collaborator Author

@aarongchan I'm going to go ahead and merge this PR. Can you remove the uop checking code from rename in your VLSU PR?

@kathlenemagnus kathlenemagnus merged commit 56ecf7a into riscv-software-src:master Jul 25, 2024
5 checks passed
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