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

Implement function calls #168

Closed
12 tasks done
tampler opened this issue May 21, 2020 · 3 comments
Closed
12 tasks done

Implement function calls #168

tampler opened this issue May 21, 2020 · 3 comments
Labels
C-tracking-issue Category: A tracking issue for a set of features or large code changes. L-vlog Language: Verilog and SystemVerilog.

Comments

@tampler
Copy link

tampler commented May 21, 2020

Tracking issue for the implementation of function calls.

Todo

  • Fix parser issue for test/svlog/funcs/std_example.sv
  • Add ambiguity resolution for subroutine port declarations, e.g. test/svlog/funcs/std_example.sv
  • Add query to distill ANSI/non-ANSI function arguments into a canonicalized form
  • Fix parsing of function calls as statements (Fix parsing of function calls as statements #213)
  • Resolve simple function calls (free and in package scopes)
  • Add query to pair up function call arguments with function definition arguments
  • Add verbosity option to show function resolution and type checking (visitor over AST)
  • Impose type context on call arguments based on definition
  • Emit function definitions as LLHD funcs
  • Lower calls to MIR
  • Emit calls as LLHD calls
  • Fix tests broken by tighter argument type computation

Hello Fabian

Started to learn about this project. This work is awesome! Thanks for contributing a lot of effort and building this!

I tried to compile an example from your paper with moore and got a bug. Just to let you know about this issue. Here's the file

bku@lap:~/work/hw/llhd/moore/0$ moore -O4 tb.sv -e acc_tb
compiler bug: lowering of call to expression not implemented
  --> tb.sv:13:3-8: 
   |   check(i, q);
@fabianschuiki
Copy link
Owner

Hi @tampler, thanks for the heads up. There are a few parts of the examples in the paper that moore does not yet fully support, but was in the paper for the sake of completeness (and show how things would map to LLHD). I'm working on getting this done though 👍. Changing this into a tracking issue for function calls.

@fabianschuiki fabianschuiki changed the title Compile Implement function calls May 22, 2020
@fabianschuiki fabianschuiki added C-enhancement Category: Adding or improving on features. L-vlog Language: Verilog and SystemVerilog. labels May 22, 2020
@tampler
Copy link
Author

tampler commented May 22, 2020

Sure take your time. I'll be keeping my eye on this project and your awesome work

@fabianschuiki
Copy link
Owner

Thanks! Any SystemVerilog code snippets that you find which are rejected by moore are very welcome here on the issue tracker 😃 !

@fabianschuiki fabianschuiki added C-tracking-issue Category: A tracking issue for a set of features or large code changes. and removed C-enhancement Category: Adding or improving on features. labels May 23, 2020
@fabianschuiki fabianschuiki added this to the v0.11 milestone Jun 18, 2020
@fabianschuiki fabianschuiki modified the milestones: v0.11, v0.12 Sep 2, 2020
fabianschuiki added a commit that referenced this issue Oct 31, 2020
Add a resolution query for the type/name ambiguity in subroutine ports.
This currently needs to be called manually for visitors, which is a bit
annoying. This should be improved in #211 later.

Contributes towards function calls in #168.
fabianschuiki added a commit that referenced this issue Oct 31, 2020
Add a resolution query for the type/name ambiguity in subroutine ports.
This currently needs to be called manually for visitors, which is a bit
annoying. This should be improved in #211 later.

Contributes towards function calls in #168.
fabianschuiki added a commit that referenced this issue Nov 3, 2020
Add a resolution query for the type/name ambiguity in subroutine ports.
This currently needs to be called manually for visitors, which is a bit
annoying. This should be improved in #211 later.

Contributes towards function calls in #168.
fabianschuiki added a commit that referenced this issue Nov 3, 2020
Implement a simple function/task argument canonicalization query. The
query gathers a function or task's argument list either from the list
provided as part of the function/task prototype, or by extracting them
from the body.

The `-Vfunc-args` verbosity option shows a list of canonicalized
arguments for each subroutine.

Contributes towards #168.
fabianschuiki added a commit that referenced this issue Nov 4, 2020
fabianschuiki added a commit that referenced this issue Nov 5, 2020
Add query to determine the mapping of the arguments passed to a call
expression, to the arguments of the corresponding function or task
declaration.

Contributes to #168.
fabianschuiki added a commit that referenced this issue Jan 8, 2021
Add a resolution query for the type/name ambiguity in subroutine ports.
This currently needs to be called manually for visitors, which is a bit
annoying. This should be improved in #211 later.

Contributes towards function calls in #168.
fabianschuiki added a commit that referenced this issue Jan 8, 2021
Implement a simple function/task argument canonicalization query. The
query gathers a function or task's argument list either from the list
provided as part of the function/task prototype, or by extracting them
from the body.

The `-Vfunc-args` verbosity option shows a list of canonicalized
arguments for each subroutine.

Contributes towards #168.
fabianschuiki added a commit that referenced this issue Jan 8, 2021
fabianschuiki added a commit that referenced this issue Jan 8, 2021
Add query to determine the mapping of the arguments passed to a call
expression, to the arguments of the corresponding function or task
declaration.

Contributes to #168.
fabianschuiki added a commit that referenced this issue Jan 9, 2021
Add a resolution query for the type/name ambiguity in subroutine ports.
This currently needs to be called manually for visitors, which is a bit
annoying. This should be improved in #211 later.

Contributes towards function calls in #168.
fabianschuiki added a commit that referenced this issue Jan 9, 2021
Implement a simple function/task argument canonicalization query. The
query gathers a function or task's argument list either from the list
provided as part of the function/task prototype, or by extracting them
from the body.

The `-Vfunc-args` verbosity option shows a list of canonicalized
arguments for each subroutine.

Contributes towards #168.
fabianschuiki added a commit that referenced this issue Jan 9, 2021
fabianschuiki added a commit that referenced this issue Jan 9, 2021
Add query to determine the mapping of the arguments passed to a call
expression, to the arguments of the corresponding function or task
declaration.

Contributes to #168.
@fabianschuiki fabianschuiki removed this from the v0.12 milestone Jan 9, 2021
fabianschuiki added a commit that referenced this issue Jan 16, 2022
Add a resolution query for the type/name ambiguity in subroutine ports.
This currently needs to be called manually for visitors, which is a bit
annoying. This should be improved in #211 later.

Contributes towards function calls in #168.
fabianschuiki added a commit that referenced this issue Jan 16, 2022
Implement a simple function/task argument canonicalization query. The
query gathers a function or task's argument list either from the list
provided as part of the function/task prototype, or by extracting them
from the body.

The `-Vfunc-args` verbosity option shows a list of canonicalized
arguments for each subroutine.

Contributes towards #168.
fabianschuiki added a commit that referenced this issue Jan 16, 2022
fabianschuiki added a commit that referenced this issue Jan 16, 2022
Add query to determine the mapping of the arguments passed to a call
expression, to the arguments of the corresponding function or task
declaration.

Contributes to #168.
fabianschuiki added a commit that referenced this issue Jan 16, 2022
Add a resolution query for the type/name ambiguity in subroutine ports.
This currently needs to be called manually for visitors, which is a bit
annoying. This should be improved in #211 later.

Contributes towards function calls in #168.
fabianschuiki added a commit that referenced this issue Jan 16, 2022
Implement a simple function/task argument canonicalization query. The
query gathers a function or task's argument list either from the list
provided as part of the function/task prototype, or by extracting them
from the body.

The `-Vfunc-args` verbosity option shows a list of canonicalized
arguments for each subroutine.

Contributes towards #168.
fabianschuiki added a commit that referenced this issue Jan 16, 2022
fabianschuiki added a commit that referenced this issue Jan 16, 2022
Add query to determine the mapping of the arguments passed to a call
expression, to the arguments of the corresponding function or task
declaration.

Contributes to #168.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for a set of features or large code changes. L-vlog Language: Verilog and SystemVerilog.
Projects
None yet
Development

No branches or pull requests

2 participants