Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move global signal declaration from toplevel to the sail_toplevel module #917

Open
wants to merge 1 commit into
base: sail2
Choose a base branch
from

Conversation

NicolasVanPhan
Copy link
Contributor

This is a v2 of the former pull request : #886
Since I restarted from a new branch, I figured it would be more adequate to open a new PR.

The approach used in the v2 is :

  • Introducing a new id node for global references
    • E_gid for AST
    • AV_gid for ANF
    • V_id for JIB
    • Global_var (in addition to Var) for the SMT expression
  • Add a AST rewriter pass to change E_id global references into E_gid.
  • Remove the former prepend_globals optional argument from the pretty-printer functions
  • Augment spec_info.global_lets with the ctyp to declare the globals in module sail_toplevel (thus removing the global state introduced in the v1 of the PR).

First, a rewrite pass in the AST distinguishes global from local signals
by splitting E_id nodes into E_id or E_gid for local or global references.

Then the SV generation changes as follows :
- All signal declaration at toplevel (i.e. no parent module) are removed
- These signals are all added as 'sail_toplevel' internal signals instead
- All references to globals are prepended with the SAIL_GLOBALS macro

This prevents unresolved signal paths in EDA tools,
since now all existing signals are declared in a module.
Copy link

Test Results

   12 files  ±0     24 suites  ±0   0s ⏱️ ±0s
  757 tests ±0    757 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 501 runs  ±0  2 501 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit de18990. ± Comparison against base commit 45f2974.

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.

1 participant