OR-1 dataflow CPU sketch

fix: address Phase 1 code review feedback

CRITICAL (Issue 1): - SM token pack/unpack corrupting Tier 2 MemOps (values > 7) - Added validation in pack_token to raise ValueError for Tier 2 MemOps - Added documentation explaining 3-bit encoding limit - Added tests verifying ValueError is raised for RD_DEC, CMP_SW, RAW_READ, SET_PAGE, WRITE_IMM IMPORTANT (Issue 2): - _encode_mode silently accepting invalid dest_count for CHANGE_TAG and SINK - Added validation: CHANGE_TAG requires dest_count == 1 - Added validation: SINK requires dest_count == 0 - Added tests verifying ValueError is raised for invalid combinations IMPORTANT (Issue 3): - Flit1 round-trip test not verifying act_id - Added assertion that act_id round-trips for DYADIC and MONADIC tokens - INLINE tokens have act_id=0 (not encoded), so excluded from assertion IMPORTANT (Issue 4): - Tasks 5-6 tests using file content string matching instead of actual imports - Replaced string-based tests with actual type construction tests for frame events - Replaced string-based tests with source code inspection for PEConfig (due to import chain issues) - Tests now directly verify event structure and field existence MINOR (Issue 5): - DyadToken.wide silently set to False in unpack_token - Added detailed comment explaining why wide flag is not encoded in wire format - Documented that wide is stored separately in IRAM Instruction, not transmitted with token MINOR (Issue 6): - No @example decorators on Hypothesis property-based tests - Added @example decorators to TestInstructionRoundTrip (6 boundary examples) - Added @example decorators to TestFlit1RoundTrip (4 boundary examples) - Covers critical values: fref=0/63, target_pe=0/3, act_id=0/7, all token kinds


Author Orual Date Commit Parent 1651b034 Change ID
+175 -51
3 changed files
+175 -51
3 changed files