-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #81 --------- Co-authored-by: mmamayka <[email protected]>
Showing
30 changed files
with
1,141 additions
and
1,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
*.gch | ||
|
||
# CMake build files | ||
build/ | ||
build* | ||
|
||
# ide stuff | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,4 +50,4 @@ start: | |
.finish: | ||
ld ra, 0(sp) | ||
add sp, sp, 8 | ||
jalr zero, ra, 0 | ||
ebreak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#pragma once | ||
|
||
#include <array> | ||
#include <cstddef> | ||
#include <functional> | ||
#include <vector> | ||
|
||
#include "besm-666/instruction.hpp" | ||
#include "besm-666/util/math.hpp" | ||
|
||
namespace besm::exec { | ||
|
||
class BasicBlock { | ||
public: | ||
static constexpr size_t kCapacity = 8; | ||
using InstrStorage = std::array<Instruction, kCapacity>; | ||
|
||
BasicBlock(); | ||
|
||
RV64Ptr getPC() const noexcept { return pc_; } | ||
Instruction const *getInstructions() const noexcept { | ||
return instrs_.data(); | ||
} | ||
|
||
private: | ||
friend class BasicBlockRebuilder; | ||
|
||
InstrStorage instrs_; | ||
RV64Ptr pc_; | ||
}; | ||
|
||
class BasicBlockCache { | ||
public: | ||
static constexpr size_t kSetBits = 7; | ||
static constexpr size_t kWayBits = 3; | ||
|
||
static constexpr size_t kSets = (1ull << kSetBits); | ||
static constexpr size_t kWays = (1ull << kWayBits); | ||
|
||
static constexpr size_t kSetMask = kSets - 1; | ||
static constexpr size_t kWayMask = kWays - 1; | ||
|
||
BasicBlockCache(); | ||
|
||
std::pair<bool, BasicBlock &> lookup(RV64Ptr pc); | ||
|
||
private: | ||
std::array<BasicBlock, kSets * kWays> bbs_; | ||
std::array<size_t, kSets> lruRowers_; | ||
}; | ||
|
||
class BasicBlockRebuilder { | ||
public: | ||
BasicBlockRebuilder(BasicBlock &targetBB, size_t pc); | ||
|
||
bool append(Instruction const &instr) noexcept; | ||
|
||
private: | ||
BasicBlock &bb_; | ||
size_t count_; | ||
}; | ||
|
||
} // namespace besm::exec |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
a0d1106
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.
Puzzle
82-d0f6b6a9
disappeared fromsrc/sim/hart.cpp
), that's why I closed #85. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.a0d1106
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.
Puzzle
39-909bf924
discovered ininclude/besm-666/sim/hart.hpp
) and submitted as #88. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.a0d1106
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.
Puzzle
81-442096c2
discovered ininclude/besm-666/sim/hart.hpp
) and submitted as #89. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.