Skip to content

Commit

Permalink
fixup! feat: implement hypervisor extension
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmikhalevich committed Oct 29, 2023
1 parent 799e5ce commit 9e21789
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2203,7 +2203,7 @@ bool machine::read_uarch_halt_flag(void) const {
return m_uarch.read_halt_flag();
}

/// \brief Sets the value ofthe microarchitecture halt flag.
/// \brief Sets the value of the microarchitecture halt flag.
void machine::set_uarch_halt_flag() {
m_uarch.set_halt_flag();
}
Expand Down
2 changes: 1 addition & 1 deletion src/test-machine-c-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ class access_log_machine_fixture : public incomplete_machine_fixture {

uint32_t test_uarch_ram[] = {
0x07b00513, // li a0,123
0x32800293, // li t0, UARCH_HALT_FLAG_SHADDOW_ADDR_DEF (0x328)
0x3C000293, // li t0, UARCH_HALT_FLAG_SHADDOW_ADDR_DEF (0x3C0)
0x00100313, // li t1,1
0x0062b023, // sd t1,0(t0) Halt microarchitecture at uarch cycle 4
};
Expand Down
16 changes: 8 additions & 8 deletions src/tests/machine-bind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -773,16 +773,16 @@ do_test("dumped log content should match", function()
local output = p:read(2000)
p:close()
local expected_output = "begin step\n"
.. " 1: read uarch.cycle@0x320(800): 0x0(0)\n"
.. " 2: read uarch.halt_flag@0x328(808): 0x0(0)\n"
.. " 3: read uarch.pc@0x330(816): 0x70000000(1879048192)\n"
.. " 4: read memory@0x70000000(1879048192): 0x3280029307b00513(3638911329427784979)\n"
.. " 1: read uarch.cycle@0x3b8(952): 0x0(0)\n"
.. " 2: read uarch.halt_flag@0x3c0(960): 0x0(0)\n"
.. " 3: read uarch.pc@0x3c8(968): 0x70000000(1879048192)\n"
.. " 4: read memory@0x70000000(1879048192): 0x3c00029307b00513(4323458472788100371)\n"
.. " begin addi\n"
.. " 5: read uarch.x@0x340(832): 0x0(0)\n"
.. " 6: write uarch.x@0x390(912): 0x0(0) -> 0x7b(123)\n"
.. " 7: write uarch.pc@0x330(816): 0x70000000(1879048192) -> 0x70000004(1879048196)\n"
.. " 5: read uarch.x@0x3d8(984): 0x0(0)\n"
.. " 6: write uarch.x@0x428(1064): 0x0(0) -> 0x7b(123)\n"
.. " 7: write uarch.pc@0x3c8(968): 0x70000000(1879048192) -> 0x70000004(1879048196)\n"
.. " end addi\n"
.. " 8: write uarch.cycle@0x320(800): 0x0(0) -> 0x1(1)\n"
.. " 8: write uarch.cycle@0x3b8(952): 0x0(0) -> 0x1(1)\n"
.. "end step\n"

print("Output of dump log:")
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mcycle-overflow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ for _, proofs in ipairs({ true, false }) do
assert(machine:read_uarch_cycle() == MAX_UARCH_CYCLE)
assert(#log.accesses == 1)
assert(log.accesses[1].type == "read")
assert(log.accesses[1].address == 0x320) -- address of uarch_cycle in shadow
assert(log.accesses[1].address == 0x3b8) -- address of uarch_cycle in shadow
assert(log.accesses[1].read == string.pack("J", MAX_UARCH_CYCLE))
assert((log.accesses[1].proof ~= nil) == proofs)
end)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ local ZERO_PAGE = string.rep("\x00", PAGE_SIZE)

test_util.uarch_programs = {
halt = {
0x32800293, -- li t0, UARCH_HALT_FLAG_SHADDOW_ADDR_DEF (0x328)
0x3C000293, -- li t0, UARCH_HALT_FLAG_SHADDOW_ADDR_DEF (0x3C0)
0x00100313, -- li t1,1 UARCH_MMIO_HALT_VALUE_DEF
0x0062b023, -- sd t1,0(t0) Halt uarch
},
Expand Down
2 changes: 1 addition & 1 deletion src/uarch-solidity-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ using uint32 = uint32_t;
using int64 = int64_t;
using uint64 = uint64_t;

// Wrapperfunctions used to access data from the uarch state accessor
// Wrapper functions used to access data from the uarch state accessor

template <typename UarchState>
static inline uint64 readWord(UarchState &a, uint64 paddr) {
Expand Down

0 comments on commit 9e21789

Please sign in to comment.