diff --git a/src/Makefile b/src/Makefile index 0c26e7c50..d4819122e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,7 +20,7 @@ EMULATOR_MARCHID=17 EMULATOR_VERSION_MAJOR=0 EMULATOR_VERSION_MINOR=18 EMULATOR_VERSION_PATCH=0 -EMULATOR_VERSION_LABEL= +EMULATOR_VERSION_LABEL=-test5 TARGET_OS?=$(shell uname) diff --git a/tests/lua/uarch-riscv-tests.lua b/tests/lua/uarch-riscv-tests.lua index d2ef4fd6f..148ccbbf1 100755 --- a/tests/lua/uarch-riscv-tests.lua +++ b/tests/lua/uarch-riscv-tests.lua @@ -389,18 +389,16 @@ local function write_access_to_log(access, out, indent, last) util.indentout(out, indent + 1, '"type": "%s",\n', access.type) util.indentout(out, indent + 1, '"address": %u,\n', access.address) util.indentout(out, indent + 1, '"log2_size": %u,\n', access.log2_size) + local read_value = '""' -- Solidity JSON parser breaks, if this field is null + if access.read then read_value = '"' .. util.hexstring(access.read) .. '"' end + util.indentout(out, indent + 1, '"read_value": %s,\n', read_value) + util.indentout(out, indent + 1, '"read_hash": "%s",\n', util.hexhash(access.read_hash)) if access.type == "write" then - local value = "null" - if access.written then value = '"' .. util.hexstring(access.written) .. '"' end - util.indentout(out, indent + 1, '"value": %s,', value) - util.indentout(out, indent + 1, '"hash": "%s",', util.hexhash(access.written_hash)) - util.indentout(out, indent + 1, '"read_hash": "%s"', util.hexhash(access.read_hash)) + util.indentout(out, indent + 1, '"written_hash": "%s"', util.hexhash(access.written_hash)) else - local value = "null" - if access.read then value = '"' .. util.hexstring(access.read) .. '"' end - util.indentout(out, indent + 1, '"value": %s,', value) - util.indentout(out, indent + 1, '"hash": "%s",', util.hexhash(access.read_hash)) - util.indentout(out, indent + 1, '"read_hash": "%s"', util.hexhash(access.read_hash)) + -- This field must always be present and can't be null, in order to allow the Solidity JSON + -- parser to read log correctly. + util.indentout(out, indent + 1, '"written_hash": ""') end if access.sibling_hashes then out:write(",\n")