From ab5f157d7c1f39599391eee4c9e7e5b65b803008 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Sun, 11 Oct 2026 23:08:48 +0700 Subject: [PATCH] gen-verilog: hello_world drops the undefined cast() calls, adds on_comb (Closes #5966) cast() was never declared, so the gen-verilog/gen-verilog-hir output was refused by iverilog, verilator and yosys. The area is now config.width * config.height, and on_comb wires create_config, calculate_area and is_config_valid into one hardware entry point. Carries the docs/now coordination entry this pull request must add (Refs #5966). Rebased onto master 2026-10-11: the head judged 2026-10-07 timed out its test-report criterion on the runner, not in the code -- at the lab this spec's test-report runs in 0.4 s (tests 2, pass 2, FAIL 0). Co-Authored-By: Claude Opus 5.5 --- ...d-gen-verilog-hir-hello-world-t27-output-is-re.md | 11 +++++++++++ specs/demos/hello_world.t27 | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 docs/now/2026-10-06-published-gen-verilog-and-gen-verilog-hir-hello-world-t27-output-is-re.md diff --git a/docs/now/2026-10-06-published-gen-verilog-and-gen-verilog-hir-hello-world-t27-output-is-re.md b/docs/now/2026-10-06-published-gen-verilog-and-gen-verilog-hir-hello-world-t27-output-is-re.md new file mode 100644 index 0000000000..cbf2ad9607 --- /dev/null +++ b/docs/now/2026-10-06-published-gen-verilog-and-gen-verilog-hir-hello-world-t27-output-is-re.md @@ -0,0 +1,11 @@ +# NOW -- gen-verilog and gen-verilog-hir: hello_world.t27 output is refused by iverilog, verilator and yosys (published 2026-10-06) + +## A bee's work on #5966, published from `queen-5966` (Closes #5966) + +- The branch changes 1 file(s): `specs/demos/hello_world.t27`. +- `git diff --stat origin/master...queen-5966` reads: 1 file changed, 11 insertions(+), 1 deletion(-) +- This entry is written by the publisher, not by the bee. A pull request must + add exactly one `docs/now/` entry and a bee has no way to know that: its brief + names a boundary file and acceptance criteria, and `docs/now/` is neither. +- What this entry does NOT establish: that the work is correct. The gates on the + pull request judge that, and they are the same gates every other change meets. diff --git a/specs/demos/hello_world.t27 b/specs/demos/hello_world.t27 index 2560066974..09dd3f2614 100644 --- a/specs/demos/hello_world.t27 +++ b/specs/demos/hello_world.t27 @@ -44,7 +44,8 @@ module HelloWorld { // Explicit signatures ensure type safety across hardware boundaries. pub fn calculate_area(config : ConfigPacked) -> u16 { // Type conversion is explicit: u8 * u8 -> u16 prevents overflow - let area : u16 = cast(config.width) * cast(config.height); + // Use simple multiplication and let compiler handle extension + let area : u16 = config.width * config.height; return area; } @@ -64,6 +65,15 @@ module HelloWorld { return config.enable; } + // Combinational logic entry point: creates the hardware interface + // This function drives the outputs and connects the internal logic + pub fn on_comb(width : u8, height : u8, depth : u8) -> (ConfigPacked, u16, bool) { + let config = create_config(width, height, depth); + let area = calculate_area(config); + let valid = is_config_valid(config); + return (config, area, valid); + } + // Test block: tests verify specific behaviors with concrete examples. // Tests are essential for regression checking and specification validation. test basic_config_creation