Skip to content

Commit

Permalink
GUI: rework of coreview graphics to correspond to Mr. Stepanovsky slides
Browse files Browse the repository at this point in the history
  • Loading branch information
jdupak committed Mar 10, 2022
1 parent a922b74 commit 2886e50
Show file tree
Hide file tree
Showing 7 changed files with 5,120 additions and 3,614 deletions.
1,990 changes: 1,116 additions & 874 deletions extras/core_graphics/diagram.drawio

Large diffs are not rendered by default.

77 changes: 42 additions & 35 deletions src/gui/coreview/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,36 +73,41 @@ using MultiTextData = pair<const unsigned &, const std::unordered_map<unsigned,
*/
const struct {
const unordered_map<QStringView, Lens<CoreState, bool>> BOOL {
{ QStringLiteral("alu-zero"), LENS(CoreState, pipeline.execute.result.alu_zero) },
{ QStringLiteral("decode-alu-src"), LENS(CoreState, pipeline.decode.result.alusrc) },
{ QStringLiteral("decode-branch"), LENS(CoreState, pipeline.decode.result.branch) },
{ QStringLiteral("decode-mem-read"), LENS(CoreState, pipeline.decode.result.memread) },
{ QStringLiteral("decode-mem-to-reg"), LENS(CoreState, pipeline.decode.result.memwrite) },
{ QStringLiteral("decode-mem-write"), LENS(CoreState, pipeline.decode.result.memwrite) },
{ QStringLiteral("decode-reg-write"), LENS(CoreState, pipeline.decode.result.regwrite) },
{ QStringLiteral("decode-jump"), LENS(CoreState, pipeline.decode.result.jump) },
{ QStringLiteral("decode-pc-to-alu"), LENS(CoreState, pipeline.decode.result.alu_pc) },
{ QStringLiteral("decode-bj-not"), LENS(CoreState, pipeline.decode.result.bj_not) },
{ QStringLiteral("exec-alu-src"), LENS(CoreState, pipeline.execute.internal.alu_src) },
{ QStringLiteral("exec-pc-to-alu"), LENS(CoreState, pipeline.execute.internal.alu_pc) },
{ QStringLiteral("exec-branch"), LENS(CoreState, pipeline.execute.internal.branch) },
{ QStringLiteral("exec-mem-read"), LENS(CoreState, pipeline.execute.result.memread) },
{ QStringLiteral("exec-mem-to-reg"), LENS(CoreState, pipeline.execute.result.memread) },
{ QStringLiteral("exec-mem-write"), LENS(CoreState, pipeline.execute.result.memwrite) },
{ QStringLiteral("exec-reg-write"), LENS(CoreState, pipeline.execute.result.regwrite) },
{ QStringLiteral("exec-branch"), LENS(CoreState, pipeline.execute.internal.branch) },
{ QStringLiteral("exec-jump"), LENS(CoreState, pipeline.execute.result.jump) },
{ QStringLiteral("exec-bj-not"), LENS(CoreState, pipeline.execute.result.bj_not) },
{ QStringLiteral("mem-mem-read"), LENS(CoreState, pipeline.memory.internal.memread) },
{ QStringLiteral("mem-mem-to-reg"), LENS(CoreState, pipeline.memory.result.memtoreg) },
{ QStringLiteral("mem-mem-write"), LENS(CoreState, pipeline.memory.internal.memwrite) },
{ QStringLiteral("mem-reg-write"), LENS(CoreState, pipeline.memory.result.regwrite) },
{ QStringLiteral("mem-jump"), LENS(CoreState, pipeline.memory.internal.jump) },
{ QStringLiteral("mem-branch"), LENS(CoreState, pipeline.memory.internal.branch) },
{ QStringLiteral("mem-branch-or-jump"),
{ QStringLiteral("decode-RegWrite"), LENS(CoreState, pipeline.decode.result.regwrite) },
{ QStringLiteral("decode-MemToReg"), LENS(CoreState, pipeline.decode.result.regwrite) },
{ QStringLiteral("decode-MemWrite"), LENS(CoreState, pipeline.decode.result.memwrite) },
{ QStringLiteral("decode-MemRead"), LENS(CoreState, pipeline.decode.result.memread) },
{ QStringLiteral("decode-BranchBxx"), LENS(CoreState, pipeline.decode.result.branch) },
{ QStringLiteral("decode-BranchJal"), LENS(CoreState, pipeline.decode.result.jump) },
{ QStringLiteral("decode-BranchJalr"),
LENS(CoreState, pipeline.decode.result.branch_jalr) },
{ QStringLiteral("decode-BranchVal"), LENS(CoreState, pipeline.decode.result.bj_not) },
{ QStringLiteral("decode-AluMul"), LENS(CoreState, pipeline.decode.internal.alu_mul) },
{ QStringLiteral("decode-AluSrc"), LENS(CoreState, pipeline.decode.result.alusrc) },
{ QStringLiteral("decode-AuiPC"), LENS(CoreState, pipeline.decode.result.alu_pc) },
{ QStringLiteral("exec-RegWrite"), LENS(CoreState, pipeline.execute.result.regwrite) },
{ QStringLiteral("exec-MemToReg"), LENS(CoreState, pipeline.execute.result.memread) },
{ QStringLiteral("exec-MemWrite"), LENS(CoreState, pipeline.execute.result.memwrite) },
{ QStringLiteral("exec-MemRead"), LENS(CoreState, pipeline.execute.result.memread) },
{ QStringLiteral("exec-BranchBxx"), LENS(CoreState, pipeline.execute.internal.branch) },
{ QStringLiteral("exec-BranchJal"), LENS(CoreState, pipeline.execute.result.jump) },
{ QStringLiteral("exec-BranchJalr"), LENS(CoreState, pipeline.execute.result.branch_jalr) },
{ QStringLiteral("exec-BranchVal"), LENS(CoreState, pipeline.execute.result.bj_not) },
{ QStringLiteral("exec-AluMul"), LENS(CoreState, pipeline.execute.internal.alu_mul) },
{ QStringLiteral("exec-AluSrc"), LENS(CoreState, pipeline.execute.internal.alu_src) },
{ QStringLiteral("exec-AuiPC"), LENS(CoreState, pipeline.execute.internal.alu_pc) },
{ QStringLiteral("exec-AluZero"), LENS(CoreState, pipeline.execute.result.alu_zero) },
{ QStringLiteral("mem-RegWrite"), LENS(CoreState, pipeline.memory.result.regwrite) },
{ QStringLiteral("mem-MemToReg"), LENS(CoreState, pipeline.memory.result.memtoreg) },
{ QStringLiteral("mem-MemWrite"), LENS(CoreState, pipeline.memory.internal.memwrite) },
{ QStringLiteral("mem-MemRead"), LENS(CoreState, pipeline.memory.internal.memread) },
{ QStringLiteral("mem-BranchOutcome"),
LENS(CoreState, pipeline.memory.internal.branch_or_jump) },
{ QStringLiteral("wb-reg-write"), LENS(CoreState, pipeline.writeback.internal.regwrite) },
{ QStringLiteral("wb-mem-to-reg"), LENS(CoreState, pipeline.writeback.internal.memtoreg) },
{ QStringLiteral("mem-BranchJalx"),
LENS(CoreState, pipeline.memory.internal.branch_or_jump) },
{ QStringLiteral("mem-BranchJalr"), LENS(CoreState, pipeline.memory.internal.branch_jalr) },
{ QStringLiteral("wb-RegWrite"), LENS(CoreState, pipeline.writeback.internal.regwrite) },
{ QStringLiteral("wb-MemToReg"), LENS(CoreState, pipeline.writeback.internal.memtoreg) },
};
const unordered_map<QStringView, Lens<CoreState, RegisterValue>> REG {
{ QStringLiteral("alu-res"), LENS(CoreState, pipeline.execute.result.alu_val) },
Expand Down Expand Up @@ -130,13 +135,15 @@ const struct {
{ QStringLiteral("rs2"), LENS(CoreState, pipeline.decode.result.num_rt) },
};
const unordered_map<QStringView, Lens<CoreState, unsigned>> DEBUG_VAL {
{ QStringLiteral("cycle-count"), LENS(CoreState, cycle_count) },
{ QStringLiteral("stall-count"), LENS(CoreState, stall_count) },
{ QStringLiteral("decode-alu-op"), LENS(CoreState, pipeline.decode.internal.alu_op_num) },
{ QStringLiteral("exec-alu-op"), LENS(CoreState, pipeline.execute.internal.alu_op_num) },
{ QStringLiteral("exec-forward-a"),
{ QStringLiteral("CycleCount"), LENS(CoreState, cycle_count) },
{ QStringLiteral("StallCount"), LENS(CoreState, stall_count) },
{ QStringLiteral("decode-AluControl"),
LENS(CoreState, pipeline.decode.internal.alu_op_num) },
{ QStringLiteral("exec-AluControl"),
LENS(CoreState, pipeline.execute.internal.alu_op_num) },
{ QStringLiteral("exec-ForwardA"),
LENS(CoreState, pipeline.execute.internal.forward_from_rs1_num) },
{ QStringLiteral("exec-forward-b"),
{ QStringLiteral("exec-ForwardB"),
LENS(CoreState, pipeline.execute.internal.forward_from_rs2_num) },
};
const unordered_map<QStringView, Lens<CoreState, Address>> PC {
Expand Down
Loading

0 comments on commit 2886e50

Please sign in to comment.