From 351d6ef40cb9744d64cef472d7616a2aca740697 Mon Sep 17 00:00:00 2001 From: chentianya Date: Sat, 22 Aug 2026 10:45:26 +0800 Subject: [PATCH] =?UTF-8?q?executor:=20main=20=E5=86=85=E9=83=A8=E6=AD=A5?= =?UTF-8?q?=E9=AA=A4=E5=9D=97=E6=B3=A8=E9=87=8A=E8=A1=A5=E5=85=85=EF=BC=88?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=A7=A3=E6=9E=90/=E8=AF=BB=E6=98=A0?= =?UTF-8?q?=E5=83=8F/=E4=BF=A1=E4=BB=BB=E9=93=BE/sidecar=20=E8=B7=AF?= =?UTF-8?q?=E5=BE=84/=E5=9B=9E=E6=94=BE=E6=89=93=E5=BC=80=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- executor/src/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/executor/src/main.cpp b/executor/src/main.cpp index 22157cd..938969f 100644 --- a/executor/src/main.cpp +++ b/executor/src/main.cpp @@ -234,6 +234,7 @@ int main(int argc, char** argv) { } const std::string stb_path = argv[1]; + // 参数:--cycles N / --replay / --step(缺省 cycles=10、无回放、非单步) uint32_t cycles = 10; bool step_mode = false; std::string replay; @@ -247,6 +248,7 @@ int main(int argc, char** argv) { } } + // 读 .stb 映像(二进制)到字节缓冲 std::string err; std::vector bytes; { @@ -257,6 +259,7 @@ int main(int argc, char** argv) { } bytes.assign(std::istreambuf_iterator(in), std::istreambuf_iterator()); } + // 结构校验(Image::from)+ 型号/SHA-256 校验(Machine::create) const vm::Image img = vm::Image::from(bytes); if (!img.ok()) { std::fprintf(stderr, "error: %s\n", img.error().c_str()); @@ -268,7 +271,7 @@ int main(int argc, char** argv) { return 1; } - // sidecar:.runtime.toml + // sidecar 路径推导:.stb → .runtime.toml std::string sidecar_path = stb_path; const size_t dot = sidecar_path.find_last_of('.'); if (dot != std::string::npos) { @@ -281,7 +284,7 @@ int main(int argc, char** argv) { return 1; } - // 回放缓冲 + // 回放缓冲(当前行 0/1 序列)+ 打开回放文件;打不开 → 报错退出 std::vector replay_line; std::ifstream replay_in; if (!replay.empty()) {