Skip to content

Add v1 backward-compatibility layer#330

Merged
phsauter merged 21 commits into
v2-devfrom
v2-test
Jul 2, 2026
Merged

Add v1 backward-compatibility layer#330
phsauter merged 21 commits into
v2-devfrom
v2-test

Conversation

@colluca

@colluca colluca commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This PR restores the old modules, defines and functions defined from common_cells v1, rewritten as wrappers around the new v2 modules, defines and functions.

Coexistence of v2 and v1 IPs allows larger projects (e.g. Cheshire) to gradually transition to common_cells v2, one IP at a time, significantly simplifying regression testing.
A project can enforce strict v2 compliance with the bender target cc_no_deprecated.
All v1 IPs print a warning about the deprecated status to inform the user that the replacement is needed.

See discussion initiated by @ricted98 in #287.

TODO

  • Check that still works in Cheshire

@colluca colluca force-pushed the v2-test branch 2 times, most recently from 7d81e83 to a89a636 Compare July 2, 2026 09:30
@colluca colluca added the v2 label Jul 2, 2026
@colluca colluca marked this pull request as ready for review July 2, 2026 11:26
ricted98 and others added 20 commits July 2, 2026 17:00
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All deprecated legacy wrappers in src/deprecated/ now correctly
instantiate their cc_* counterparts with the renamed v2 parameters
and ports:

- ALL_CAPS params → UpperCamelCase (Width, Depth, NumInp, etc.)
- Type params T/dtype/DataType → data_t
- clr_i added to all modules that gained synchronous clear
- flush_i → clr_i in rr_arb_tree, stream_omega_net, stream_xbar
- ARBITER string → cc_pkg::arb_mode_e enum in stream_arbiter(s)
- Port renames: onehot→onehot_i, bin→bin_o, clear_i→clr_i, etc.
- New deprecated stubs: cc_sync (moved to tech_cells_generic),
  cc_stream_arbiter_flushable (merged into cc_stream_arbiter)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Lint fixes:
- Add explicit `string` type to ARBITER params in stream_arbiter{,_flushable}
- Rename CC_ARB_MODE localparam to ArbMode (UpperCamelCase)
- Rename CC_MODE localparam to LzcMode (UpperCamelCase) and split long line
- Fix encoded_data_t struct in ecc_{encode,decode} to match original v1 definition
  ({logic parity; code_word_t code_word;} instead of wrong fields)
- Add typedef-structs-unions waivers for ecc_{encode,decode} deprecated wrappers

Cleanup:
- Remove cc_stream_arbiter_flushable: spurious module with no v1 or v2-dev name;
  stream_arbiter_flushable now maps flush_i directly to cc_stream_arbiter.clr_i
- Remove cc_sync stub; inline synchronizer logic in sync deprecated wrapper and
  update warning to reference tc_sync from tech_cells_generic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Preserve the v1 signature (integer return type, signed longint inputs)
while forwarding to cc_pkg::ceil_div. Use $unsigned() to convert inputs
and integer'() cast for the return value to avoid W416 in SpyGlass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@phsauter phsauter merged commit 4f62c83 into v2-dev Jul 2, 2026
5 checks passed
@phsauter phsauter deleted the v2-test branch July 2, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants