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

Refactor type dag #1144

Closed

Conversation

taichi-ishitani
Copy link
Contributor

@taichi-ishitani taichi-ishitani commented Dec 13, 2024

To fix #1131 and #1070, we need to create tag table after resolving references.
For this purpose dependencies property is added to Symbol.
This contains typed entries below which are refered from the entry.

  • Module
  • Interface
  • Modport
  • Package
  • Enum
  • Typedef
  • Struct
  • Unit
  • Function

pub dependencies: Vec<SymbolId>,

dependencies are collected duaring resolving reference by create_referecne.

self.add_dependency_to_parent_scope(&symbol.found);

add_dependency(&symbol.found, &arg_symbol.found);

Following dependencies example is for Veryl code below.

package foo_pkg {
  enum Foo {
    foo_member
  }
}

package bar_pkg {
  struct Bar {
    bar: foo_pkg::Foo
  }
}

package baz_pkg {
  enum Baz {
    baz_member
  }
}

module qux {
  var bar: bar_pkg::Bar;
  var baz: baz_pkg::Baz;
}
qux
+-- bar_pkg::Bar
|   `-- foo_pkg::foo
`-- baz_pkg::Baz

After collecting dependencies, type tag will be created by interating dependencies and their parent symbols.

self.add_type_dag(symbol);

fix #1131
fix #1070

@taichi-ishitani taichi-ishitani marked this pull request as ready for review December 13, 2024 13:05
@taichi-ishitani
Copy link
Contributor Author

#1147 is more simple way so this PR is clonsed.

@taichi-ishitani taichi-ishitani deleted the refactor_type_dag branch December 15, 2024 05:57
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.

generic interface file is empty Reference through expression is not affected to filelist order
1 participant