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

eDSL, docs: new eDSL example showing the usage of guards, and a correction in syntax in docs #2133

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

anshumanmohan
Copy link
Contributor

@anshumanmohan anshumanmohan commented Jun 11, 2024

This PR contributes a little example showing how to generate the various kinds of guards using the eDSL.

This is not yet documented; I will leave that to @KabirSamsi in a separate PR. When you do document it, please point to my little example!

@rachitnigam I want to flag something. The docs say that conjunction looks like foo && bar and disjunction like foo || bar. However, in reality you'd get an error like:

[fud] ERROR: `/scratch/anshuman/calyx/target/debug/calyx -l /scratch/anshuman/calyx -b verilog' failed:
=====STDERR=====
Error: Failed to parse buffer:   --> 14:35
   |
14 |       mult_pipe_1.right = (foo || bar) ? 32'd7;
   |                                 ^---
   |
   = expected term

Is the doc wrong? Am I using it incorrectly? FWIW the eDSL generates single & and single | and therefore works.

@rachitnigam
Copy link
Contributor

It should be | and & instead

@anshumanmohan
Copy link
Contributor Author

Great, changed the docs too.

@anshumanmohan anshumanmohan changed the title eDSL: guard example eDSL, docs: new eDSL example showing the usage of guards, and a correction in syntax in docs Jun 12, 2024
@anshumanmohan anshumanmohan enabled auto-merge (squash) June 13, 2024 13:24
@anshumanmohan anshumanmohan merged commit e18da1b into main Jun 13, 2024
18 checks passed
@anshumanmohan anshumanmohan deleted the guard-example branch June 13, 2024 13:41
ethanuppal added a commit that referenced this pull request Jun 15, 2024
* eDSL, docs: new eDSL example showing the usage of guards, and a correction in syntax in docs (#2133)

* Get the builder to generate ops between ports

* Small example showing various forms of guards

* Tweak & and | docs for guards

* No more guard conjunction to declare group `done` signals (#2131)

* One less guard disjunct in gen_exp

* No guard conj in sdn.py

* No more & in ntt

* No more guard conj in tuple

* No more group conj in gen_exp

* Stray expect file

* Prefer `seq_mem`s to `comb_mem`s all over (#2127)

* Port Python code to seq mems

* Update expect files to deal with new seq mems

* Fix gen_exp to use seq mems

* Catch up expect files to seq mems

* Trigger Build

* Silly mistake

* Expect files chasing after silly mistake

* Preprocessor mockup

* Integrate preprocessor with LSP

---------

Co-authored-by: Anshuman Mohan <[email protected]>
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.

2 participants