-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add tensor core to SimX #142
Changes from 4 commits
99c6a1a
0e3badf
a378aed
5b0fc8c
5e63b8f
09028d8
4a60606
d1175a0
6c72597
b7531c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good to document the additional instructions. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please undo the whitespace changes to this file. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ static const std::unordered_map<Opcode, InstType> sc_instTable = { | |
{Opcode::EXT2, InstType::R4}, | ||
{Opcode::R_W, InstType::R}, | ||
{Opcode::I_W, InstType::I}, | ||
{Opcode::TCU, InstType::I}, | ||
}; | ||
|
||
enum Constants { | ||
|
@@ -405,6 +406,16 @@ static const char* op_string(const Instr &instr) { | |
default: | ||
std::abort(); | ||
} | ||
|
||
case Opcode::TCU: | ||
switch(func3) | ||
{ | ||
case 0: return "ML"; // Matrix Load | ||
case 1: return "MS"; // Matrix Store | ||
case 2: return "MATMUL"; // Matrix Multiply | ||
default: | ||
std::abort(); | ||
} | ||
default: | ||
std::abort(); | ||
} | ||
|
@@ -543,6 +554,14 @@ std::shared_ptr<Instr> Emulator::decode(uint32_t code) const { | |
|
||
case InstType::I: { | ||
switch (op) { | ||
case Opcode::TCU: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which instruction does this correspond to? |
||
instr->setDestReg(rs1, RegType::Integer); | ||
instr->addSrcReg(rs1, RegType::Integer); | ||
instr->setFunc3(func3); | ||
instr->setFunc7(func7); | ||
auto imm = code >> shift_rs2; | ||
instr->setImm(sext(imm, width_i_imm)); | ||
} break; | ||
case Opcode::I: | ||
case Opcode::I_W: | ||
case Opcode::JALR: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the empty change: