-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Type checking analysis pass #378
Comments
Another note: Currently, veryl allows declaration of variably lengthed logic vectors:
produces
I think this is likely because the
These are arbitrary expressions, and no checking is done to determine if they are evaluable, either directly into an explicit constant natural number, or parametrically. |
A primitive type evaluation is implemented at https://github.com/dalance/veryl/blob/master/crates/analyzer/src/handlers/check_enum.rs. I implemented it as a checker, but I think it should be more generic framework.
About cycle of DAG, I think it should be reported as error at creating DAG phase. The current implementation of evaluator https://github.com/dalance/veryl/blob/master/crates/analyzer/src/evaluator.rs can handle fixed value only. |
How is the symbol table currently used? greping the analyzer crate shows that It looks like to use the symbol table in a separate pass, I would need to implement Perhaps a Does this make sense? |
The symbol table is used at some analyzer handlers and language server. https://github.com/dalance/veryl/blob/9571195d062834f9c0b365e06344660c45c31191/crates/analyzer/src/handlers/check_function.rs#L39
To avoid re-implementation of pushing/poping SymbolPath and Namespace, I implemented It holds pairs of |
Sorry for the late reply. |
Dalance,
I would like to add a type checking pass which has a primary goal of evaluating the size (in bits) and packedness of each datatype.
The way I see this working is that a graph whose nodes are types, and whose edges represent dependencies.
For example,
Would contain three nodes and two edges:
(logic<2>) -> (k) -> (m).
In addition to allowing us to identify the packed size of
m
, this also allows us to do dependency analysis. The type-graph should be a DAG. If a cycle exists, we have a problem. However, currentlypasses on this mutually recurssive, but not inductive package
p
.Any thoughts on this approach?
The text was updated successfully, but these errors were encountered: