Skip to content

[AUTOMATED] [PROPOSAL] Add an initial Infineon Carmel lift - #1936

Draft
thotypous wants to merge 82 commits into
Noelo-Lab:mainfrom
thotypous:carmel-initial-lift
Draft

thotypous wants to merge 82 commits into
Noelo-Lab:mainfrom
thotypous:carmel-initial-lift

Conversation

@thotypous

@thotypous thotypous commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Kuna can list and decompile canonical Infineon Carmel CODE. This fixture is linked TASKING -O2 output from original C89 sources:

d=specs/Ghidra/Processors/Carmel/data/languages
decompiler/target/release/slacomp "$d/carmel.slaspec"
xxd -r -p tests/fixtures/carmel/compiler-o2.hex /tmp/carmel-o2.bin
KUNA_SPECS="$PWD/specs" decompiler/target/release/kuna disassemble \
  /tmp/carmel-o2.bin 0x2e --addr --raw-image --target Carmel:BE:24:default:default --base 0 --count 2

Before: No sleigh specification for Carmel:BE:24:default. After: inc(a0l); and return; at CODE words 0x2e and 0x2f.

  • Preserve Carmel's word addresses, independent sequential slots, parallel old-state reads, and issue-counted delays. Lift the covered arithmetic, control, stack, CE, peripheral, and immutable CLIW forms; unsupported effects stop lift.
  • Load native TASKING objects and located images. The Carmel profile uses separate IEEE-695/TIOF, Motorola S-record, and Intel HEX readers.
  • The checked-in fixtures exercise raw CODE, relocated calls, banked images, and emitted C.

Extensive testing was made possible by Ambiente Computacional Marie Curie (FINEP 01.22.181.00).

Model: openai-codex/gpt-6.2-sol

[AUTOMATED]

Frame canonical three-byte CODE words and paint issue and immutable CLIW
context before lifting. Lift the verified subset with normal p-code, and
preserve unsupported issues as explicit stops.

Add original compiler and assembler fixtures, emulator and stage regression
tests, and fixed-entry compiler and wild coverage measurements.
@mahaloz

mahaloz commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

[AUTOMATED] I pushed three commits on top of ed446b6:

  • c9f36ec merges main (f429aa5). Only the stage corpus count (now 903) and docs/baseline-stages.json (5306) needed resolving.

  • a142831 fixes the return site of a CALL delayed by a three-byte issue. It pushes the word after the post-delay address, so the return skips the delay slot's sequential partner, but the lift fell through into that slot:

    printf '2b20422bec00a1ac2021ac202bd8002bec002bec002bec002bd8002bec00' | xxd -r -p > /tmp/callskip.bin
    KUNA_SPECS="$PWD/specs" decompiler/target/release/kuna decompile /tmp/callskip.bin 0 --addr \
      --raw-image --target Carmel:BE:24:default:default --base 0

    Before, the skipped INC A0L at word 3 ran after the call: v1 = sub_8(...); return (v1 + 1) - ...;. The five carmel_next_issue_size=3 CALL constructors now end with a goto to the pushed word, and verify_carmel_raw::a_call_delayed_by_one_compact_slot_resumes_at_its_pushed_word covers it. carmel.slaspec is generated, so the generator needs the same change. The ignored verify_carmel_wild probe will now see CALL plus BRANCH on those issues.

  • 2fefdd9 adds a sentence to spec §2.5 on which languages the new translator and emulator checks apply to.

mahaloz and others added 13 commits November 26, 2026 04:21
Resolve the stage corpus count (main 902 + carmel-constructors = 903) and
synthesize docs/baseline-stages.json from both sides (main 5303 + 3 Carmel
assertions = 5306).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
The delay-issue checks in the SLEIGH translator and the emulator's
CODE-word conversion key on alignment 3, a three-byte-word code space and
the carmel_issue context field; state that in the owning spec chapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
…ushed word

A CALL with a one-issue delay pushes the undelayed next word plus two
(inst_start + 3 in a sequential slot, + 4 in a parallel fetch). When the
delay issue is a three-byte sequential slot, that word is one past the
post-delay address, so the return skips the delay slot's sequential
partner. The five carmel_next_issue_size=3 CALL constructors fell through
to the post-delay address instead, and the decompiled caller executed the
skipped slot after the call (for example an extra INC of the returned A0L).
They now end with a goto to the pushed word. The six-byte delay forms
already resume there. Carmel-only; no other language reads this spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
[AUTOMATED]

List exact CrossView syntax from the framed fetch and recovered operand
fields. Keep supported SLEIGH p-code independent of presentation. Add raw
listing and raw-p-code CLI coverage and a pinned three-way parity runner.

Include the native-verified unconditional wide relative CALL without delay.
Keep the contributed compact delay continuation and its flow regression.
Lift register compares, direct signed conditions, wide accumulator and address moves, and absolute DATA loads. Keep the signed CLIW MAC in portable C widths.
Preserve an explicit post-CALL continuation and reject unknown sequential families before issue without changing listing boundaries.
Support processor-space qualified typed globals for Harvard fixtures. Measured 147 native emitted-C matches; general DATA port timing and the remaining simulator fixtures are not verified.
Keep shifted ALU status, guard bytes and status carry across physical lanes.
Resolve only one register-only repeat body; do not replay memory or transfers.
Respect register widths, original AGU modulus and DATA read-before-write dependencies.
Keep architectural issue counts separate from SLEIGH byte widths and report verified compact decode stops without changing canonical listings.
Keep the build and verification steps runnable from the Kuna checkout.
Remove references to unpublished inputs, external scripts, and execution infrastructure from the source tree.
Lift selected logic, unary arithmetic, divide and register bank exchanges.
Count delay issues independently of fetch width and reject unbound EXTRACT descriptors without changing disassembly.
Add raw CODE and execution checks for flags, address-enable sampling, and paired shadow registers.
- Sample EQ before executing counted delays; check the emitted C for an odd-slot transfer.
- Preserve separate stack address and store gates and simultaneously sample both static CE latches.
- Lift witnessed absolute IO and EXT moves without aliasing DATA.
Keep CODE, DATA, CLIW, IO, and EXT distinct. Apply supported relocated
fields in a checked synthetic layout; frame only executable CODE bytes.
Require explicit instruction-only mapping for Motorola and Intel text.
Exercise original compiler and locator outputs in Kuna console and CLI.
Describe the immutable-bank requirement without restricting it to XML.
…IW lanes

Preserve lane and address-bank effects in the newly admitted forms.
Exercise raw p-code and emitted C at independent machine-state projections.
[AUTOMATED]

Preserve the old input on the selected store port and route the extrema result to the actual accumulator destination.
[AUTOMATED]

Exercise nested return-address stacking, including resumes at odd parcels.
[AUTOMATED]

Distinguish left, parallel-right, and sequential-right X routing in compact ALU forms.
[AUTOMATED]

Use the physical input frame across nested block-loop transitions without changing issue ordering.
[AUTOMATED]

Align low and high literals before the 40-bit adjustment. Keep the full result and gate only sticky E on saturation configuration.
[AUTOMATED]

Fetch the extended operand through the active implicit DATA ports before applying CE writeback.
[AUTOMATED]

Retain all 5,520 upstream expectations and the three independently verified Carmel constructor expectations.
[AUTOMATED]

Keep the selected accumulator input at full width and route quotient and remainder to their connected result views.
[AUTOMATED]

Sample the word and carry before updating the paired generators. Only the issue form that owns the destination publishes the rotated word.
[AUTOMATED]

Preserve physical multiply operand order, shared address generation, and explicit X1 writeback priority over the input latch.
[AUTOMATED]

Keep both address updates when the secondary extract does not consume the data ports, and lift the neighboring X selector by its physical lane.
[AUTOMATED]

Keep address-enabled execution outputs separate from conditional late backtrace writes, including the retired status seen by the next issue.
[AUTOMATED]

Separate the implicit DATA source from the selected word or accumulator output and keep the sticky clamp flags on the connected path.
[AUTOMATED]

Compare signed accumulator lanes and write MINBTR/MAXBTR only on improvements. The memory form uses the old postmodify address and preserves the upper accumulator lanes.
[AUTOMATED]

Program the PACFG lane before pointer publication. Dual writes retain the right decode value and stop before either pointer write.
[AUTOMATED]

Keep independent lane widths, guard retention, separate backtrace bits, and the connected result ports.
[AUTOMATED]

Use the target’s short word and descriptor lanes, retaining the different shift and extract result widths.
[AUTOMATED]

Separate address-stage qualification from the late DATA result, refresh the live loop from the saved frame, and leave transient EX status outside the retired state.
[AUTOMATED]

Use the incoming DATA address before postmodify, preserve flags for a disconnected short ROR, and route connected carry and guard bits at their physical widths.
[AUTOMATED]

Use the physical signed FF1 or zero source and preserve address updates when the result is vetoed. Keep carry and DATA width on separate routes.
[AUTOMATED]
Sample both source ports and the incoming result latch before extended template writeback. Preserve the rounded ALU layouts, accumulator lanes and flag-only destinations.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants