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

[CfToHandshake] External function bug in CfToHandshake conversion #108

Closed
Carmine50 opened this issue Aug 2, 2024 · 0 comments
Closed

Comments

@Carmine50
Copy link
Collaborator

After the last change in the file CfToHandshake, it is impossible to declare external functions. During the application of applyFullConversion, the pattern ConvertCalls is executed on the calls of external functions before transforming the external functions into handshake functions in the LowerFuncToHandshake pattern. During the ConvertCalls, there is a check to ensure that the call refers to a handshake function. This check fails. There are 2 possible solutions to this problem:

  1. The check is skipped in the ConvertCalls pattern
  2. The LowerFuncToHandshake pattern is executed with a partial conversion before executing all the other patterns
pcineverdies pushed a commit that referenced this issue Sep 16, 2024
The commit 582684a
re-structured the `CfToHandshake` conversion pass, after which
external functions could no longer be used. This commit fixes
this issue. A template benchmark to evaluate this feature is the
following one.

```cpp
#include "dynamatic/Integration.h"
int external_1(in_int_t a);
int external(in_int_t a) {
  int c = a >> 5;
  external_1( c );
  return (c+2);
}
```

In the previous commit, the frontend's `compile` command
fail, now it works correctly.

Fixes #108.
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

No branches or pull requests

1 participant