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

add Annotations/Attributes to InstDecl #1482

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

hcab14
Copy link
Contributor

@hcab14 hcab14 commented Aug 19, 2020

This PR is related to #1423

I hope I did not break anything. stack test does not show errors related to this PR (I think):

Test suite failure for package clash-prelude-1.3.0
doctests:  exited with: ExitFailure 1

and

clash-prelude> /home/cmayer/Software/clash-compiler/clash-prelude/src/Clash/XException.hs:141: failure in expression `h' (errorX "QQ") 3'                                                                          
clash-prelude> expected: 0000_0011                                                                                                                                                                                 
clash-prelude>  but got:                                                                                                                                                                                           
clash-prelude>           ^                                                                                                                                                                                         
clash-prelude>           <interactive>:13170:1: error:                                                                                                                                                             
clash-prelude>               Variable not in scope: h' :: t0 -> Integer -> t                                                                                                                                       
clash-prelude>                                                                                                                                                                                                     
clash-prelude> /home/cmayer/Software/clash-compiler/clash-prelude/src/Clash/XException.hs:197: failure in expression `h' (errorX "QQ") 3'                                                                          
clash-prelude> expected: 0000_0011                                                                                                                                                                                 
clash-prelude>  but got:                                                                                                                                                                                           
clash-prelude>           ^                                                                                                                                                                                         
clash-prelude>           <interactive>:13200:1: error:                                                                                                                                                             
clash-prelude>               Variable not in scope: h' :: t0 -> Integer -> t                                                                                                                                       
clash-prelude>                                                                                                                                                                                                     
clash-prelude> Examples: 806  Tried: 804  Errors: 0  Failures: 2                                                                                                                                                   

@martijnbastiaan
Copy link
Member

martijnbastiaan commented Aug 19, 2020

Hi @hcab14. Thanks for the PR, looks good!

A couple of things:

@hcab14
Copy link
Contributor Author

hcab14 commented Aug 20, 2020

HI @martijnbastiaan

thank you for your review.

Done. I am not sure under which category this change should be, e.g., "new feature (API)" or "new internal feature".

  • It would be nice if you could add an example to tests/shouldwork/SynthesisAttributes. Writing an actual tests is a bit annoying for this kind of stuff, so I wouldn't mind taking over from there.

See tests/shouldwork/SynthesisAttributes/InstDeclAnnotations.hs for a first attempt.

testsuite/Main.hs Outdated Show resolved Hide resolved
@alex-mckenna
Copy link
Contributor

Done. I am not sure under which category this change should be, e.g., "new feature (API)" or "new internal feature".

As the change is mostly to InstDecl, I would say internal feature. Although I would defer to @martijnbastiaan if he disagrees :)

@martijnbastiaan
Copy link
Member

Agreed @alex-mckenna!

@hcab14 Looks real nice, thanks again :).

Allows BlackBox Haskell functions to specify synthesis attributes on
component instantations.
@martijnbastiaan martijnbastiaan merged commit 5c3c211 into clash-lang:master Aug 21, 2020
martijnbastiaan added a commit that referenced this pull request Aug 24, 2020
martijnbastiaan added a commit that referenced this pull request Aug 24, 2020
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.

None yet

3 participants