Skip to content

Commit 20cb2ba

Browse files
rv-jenkinsrv-auditorStevengretothtamas28
authored
Update dependency: deps/k_release (#55)
* deps/k_release: Set Version 7.1.178 * Set Version: 0.1.46 * pyproject.toml: sync pyk version 7.1.178 * deps/k_release: Set Version 7.1.179 * pyproject.toml: sync pyk version 7.1.179 * deps/k_release: Set Version 7.1.180 * pyproject.toml: sync pyk version 7.1.180 * deps/k_release: Set Version 7.1.181 * pyproject.toml: sync pyk version 7.1.181 * deps/k_release: Set Version 7.1.182 * pyproject.toml: sync pyk version 7.1.182 * deps/k_release: Set Version 7.1.183 * pyproject.toml: sync pyk version 7.1.183 * deps/k_release: Set Version 7.1.184 * deps/k_release: Set Version 7.1.186 * pyproject.toml: sync pyk version 7.1.186 * deps/k_release: Set Version 7.1.187 * pyproject.toml: sync pyk version 7.1.187 * deps/k_release: Set Version 7.1.191 * pyproject.toml: sync pyk version 7.1.191 * deps/k_release: Set Version 7.1.193 * pyproject.toml: sync pyk version 7.1.193 * deps/k_release: Set Version 7.1.194 * pyproject.toml: sync pyk version 7.1.194 * pyproject.toml: sync pyk version 7.1.194 * deps/k_release: Set Version 7.1.195 * pyproject.toml: sync pyk version 7.1.195 * pyproject.toml: sync pyk version 7.1.195 * pyproject.toml: sync pyk version 7.1.195 * deps/k_release: Set Version 7.1.198 * pyproject.toml: sync pyk version 7.1.198 * pyproject.toml: sync pyk version 7.1.198 * deps/k_release: Set Version 7.1.199 * pyproject.toml: sync pyk version 7.1.199 * deps/k_release: Set Version 7.1.201 * pyproject.toml: sync pyk version 7.1.201 * deps/k_release: Set Version 7.1.202 * pyproject.toml: sync pyk version 7.1.202 * deps/k_release: Set Version 7.1.203 * pyproject.toml: sync pyk version 7.1.203 * pyproject.toml: sync pyk version 7.1.203 * deps/k_release: Set Version 7.1.204 * pyproject.toml: sync pyk version 7.1.204 * pyproject.toml: sync pyk version 7.1.204 * deps/k_release: Set Version 7.1.205 * pyproject.toml: sync pyk version 7.1.205 * deps/k_release: Set Version 7.1.207 * pyproject.toml: sync pyk version 7.1.207 * deps/k_release: Set Version 7.1.208 * pyproject.toml: sync pyk version 7.1.208 * pyproject.toml: sync pyk version 7.1.208 * deps/k_release: Set Version 7.1.211 * pyproject.toml: sync pyk version 7.1.211 * deps/k_release: Set Version 7.1.212 * pyproject.toml: sync pyk version 7.1.212 * test_unit.py: Update byte representation in memory test data * pyproject.toml: sync pyk version 7.1.212 * tools.py: Improve error handling for krun pattern execution - Capture stdout, stderr, and input configuration when krun pattern fails - Write error details to separate files for debugging - Preserve original exception raising * riscv-semantics: Improve memory byte handling and error logging - Update loadByte rule to convert MaybeByte to Int - Add MaybeByte2Int function to handle byte conversion - Enhance debug logging for krun pattern execution with resolved file paths * tools.py: Refactor debug file generation and import order - Reorganize import statements for better readability - Standardize string quotes to single quotes - Minor formatting improvements in debug file logging * Update src/kriscv/tools.py Co-authored-by: Tamás Tóth <[email protected]> * Update src/kriscv/kdist/riscv-semantics/sparse-bytes.md Co-authored-by: Tamás Tóth <[email protected]> --------- Co-authored-by: devops <[email protected]> Co-authored-by: Stevengre <[email protected]> Co-authored-by: Tamás Tóth <[email protected]>
1 parent f29a607 commit 20cb2ba

File tree

8 files changed

+686
-279
lines changed

8 files changed

+686
-279
lines changed

deps/k_release

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.1.174
1+
7.1.212

package/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.45
1+
0.1.46

poetry.lock

+651-265
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "kriscv"
7-
version = "0.1.45"
7+
version = "0.1.46"
88
description = "K tooling for the RISC-V architecture"
99
authors = [
1010
"Runtime Verification, Inc. <[email protected]>",
@@ -18,7 +18,7 @@ riscv-semantics = "kriscv.kdist.plugin"
1818

1919
[tool.poetry.dependencies]
2020
python = "^3.10"
21-
kframework = "7.1.174"
21+
kframework = "7.1.212"
2222
pyyaml = "^6.0.1"
2323
types-pyyaml = "^6.0.12.20240311"
2424
filelock = "^3.14.0"

src/kriscv/kdist/riscv-semantics/riscv.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ module RISCV-MEMORY
103103
We abstract the particular memory representation behind `loadByte` and `storeByte` functions.
104104
```k
105105
syntax Int ::= loadByte(memory: Memory, address: Word) [function, symbol(Memory:loadByte)]
106-
rule loadByte(MEM, W(ADDR)) => { readByte(MEM, ADDR) }:>Int
106+
rule loadByte(MEM, W(ADDR)) => MaybeByte2Int(readByte(MEM, ADDR))
107107
108108
syntax Memory ::= storeByte(memory: Memory, address: Word, byte: Int) [function, total, symbol(Memory:storeByte)]
109109
rule storeByte(MEM, W(ADDR), B) => writeByte(MEM, ADDR, B)

src/kriscv/kdist/riscv-semantics/sparse-bytes.md

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ We provide helpers to prepend either data or an empty region to an existing `Spa
5454
syntax MaybeByte ::=
5555
Int
5656
| ".Byte"
57+
58+
syntax Int ::= MaybeByte2Int(MaybeByte) [function, total]
59+
rule MaybeByte2Int(I:Int) => I
60+
rule MaybeByte2Int(.Byte) => 0
5761
5862
syntax MaybeByte ::=
5963
readByte (SparseBytes , Int) [function, total]

src/kriscv/tools.py

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
from pathlib import Path
4+
from subprocess import CalledProcessError
35
from typing import TYPE_CHECKING
46

57
from elftools.elf.elffile import ELFFile # type: ignore
@@ -13,7 +15,6 @@
1315
from kriscv.term_manip import kore_sparse_bytes, kore_word, match_map
1416

1517
if TYPE_CHECKING:
16-
from pathlib import Path
1718

1819
from pyk.kast.inner import KInner
1920
from pyk.kllvm.runtime import Runtime
@@ -46,7 +47,23 @@ def init_config(self, config_vars: dict[str, KInner]) -> KInner:
4647

4748
def run_config(self, config: KInner) -> KInner:
4849
config_kore = self.krun.kast_to_kore(config, sort=GENERATED_TOP_CELL)
49-
final_config_kore = self.krun.run_pattern(config_kore, check=True)
50+
try:
51+
final_config_kore = self.krun.run_pattern(config_kore, check=True)
52+
except CalledProcessError as e:
53+
path = Path.cwd()
54+
stdout_path = path / 'krun_stdout.txt'
55+
stderr_path = path / 'krun_stderr.txt'
56+
input_path = path / 'krun_input.txt'
57+
58+
stdout_path.write_text(e.stdout)
59+
stderr_path.write_text(e.stderr)
60+
input_path.write_text(config_kore.text)
61+
62+
print('Generated debug files:')
63+
print(f'- {stdout_path.resolve()}: KRun standard output')
64+
print(f'- {stderr_path.resolve()}: KRun error output')
65+
print(f'- {input_path.resolve()}: Input configuration in Kore format')
66+
raise
5067
return self.krun.kore_to_kast(final_config_kore)
5168

5269
def run_elf(self, elf_file: Path, *, end_symbol: str | None = None) -> KInner:

src/tests/unit/test_unit.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,13 @@ def test_disassemble(instr_bits: str, expected: KInner) -> None:
262262
MEMORY_TEST_DATA: Final[tuple[tuple[str, dict[int, bytes], int, int], ...]] = (
263263
('empty_start', {}, 0, 0x1A),
264264
('empty_later', {}, 10, 0x1A),
265-
('mid_bytes', {1: b'\x7F\x7F'}, 2, 0x1A),
266-
('start_pre_bytes', {1: b'\x7F\x7F'}, 0, 0x1A),
267-
('empty_pre_bytes', {2: b'\x7F\x7F'}, 1, 0x1A),
268-
('end_post_bytes', {2: b'\x7F\x7F'}, 4, 0x1A),
269-
('empty_post_bytes', {2: b'\x7F\x7F', 6: b'\x7F'}, 4, 0x1A),
270-
('end', {2: b'\x7F\x7F'}, 5, 0x1A),
271-
('merge_bytes', {1: b'\x7F\x7F', 4: b'\x7F'}, 3, 0x1A),
265+
('mid_bytes', {1: b'\x7f\x7f'}, 2, 0x1A),
266+
('start_pre_bytes', {1: b'\x7f\x7f'}, 0, 0x1A),
267+
('empty_pre_bytes', {2: b'\x7f\x7f'}, 1, 0x1A),
268+
('end_post_bytes', {2: b'\x7f\x7f'}, 4, 0x1A),
269+
('empty_post_bytes', {2: b'\x7f\x7f', 6: b'\x7f'}, 4, 0x1A),
270+
('end', {2: b'\x7f\x7f'}, 5, 0x1A),
271+
('merge_bytes', {1: b'\x7f\x7f', 4: b'\x7f'}, 3, 0x1A),
272272
)
273273

274274

0 commit comments

Comments
 (0)