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

std-bit-slice implementation #1906

Merged
merged 12 commits into from
Feb 15, 2024
Merged

std-bit-slice implementation #1906

merged 12 commits into from
Feb 15, 2024

Conversation

anthonyabeo
Copy link
Collaborator

This PR addresses the implementation of the proposed bit-slicing operation per #497 .

@rachitnigam
Copy link
Contributor

Okay, there are failures in the interpreter and the compiler. @anthonyabeo can you take a shot at fixing the compiler errors? With runt, you can run a specific test using:

runt -i <test path> -d

If the output looks correct, you can save the updated file using the -s flag. You can read more in the runt documentation. The failure in the interpreter comes from the missing implementation of the new primitive. By default, the interpreter tries to run all of the tests that the compiler runs. You can disable this by adding a .skip file in the location corresponding to the interpreter's expected output location.

@EclecticGriffin
Copy link
Collaborator

Zulip message about how to implement a new primitive in Cider: https://calyx.zulipchat.com/#narrow/stream/423600-development/topic/please-review/near/420297504

@anthonyabeo
Copy link
Collaborator Author

@EclecticGriffin thanks for the assist. I was able to resolve the interpreter's issue.

@rachitnigam noted.

My main issue appears to be creating the local environment so I can get the tests to pass. On Mac, even the core tests are failing. I tried using Ubuntu 22.04 and cannot run fud (see the screenshot)

Screenshot from 2024-02-08 12-58-53

@rachitnigam
Copy link
Contributor

You need to install the calyx-py module: https://docs.calyxir.org/builder/calyx-py.html

@anthonyabeo
Copy link
Collaborator Author

@rachitnigam @EclecticGriffin I have been able to install most of the dependencies. see screenshot
Screenshot from 2024-02-12 09-15-07

However, some of the tests are still failing and I am not sure how to go about debugging them. See the screenshot below for the output of runt -i tests/frontend/dahlia/memory.fuse -d
Screenshot from 2024-02-12 09-28-15

@rachitnigam
Copy link
Contributor

That seems to be because your branch is out of date from main. Can you merge with main: git merge main and resolve the conflicts?

@anthonyabeo
Copy link
Collaborator Author

@rachitnigam I managed to resolve the failing tests. Not sure why but I still get failing tests locally when I merged main in this branch.


wires {
group bit_slice {
slice.in = 32'd206256;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we write this number in binary so its more obvious what the slicing is doing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax in Calyx is 32'b0101011 (note the b instead of d)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@@ -0,0 +1,10 @@
{
"mem": {
"data": [10],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is never used because we simply write to the memory right? If that is the case, lets make this 0 instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure.

@rachitnigam
Copy link
Contributor

Ah, I can really help debug those without the outputs but this PR seems to be passing all tests! There is one comment about updating the test but after that we can merge!

@anthonyabeo
Copy link
Collaborator Author

Ah, I can really help debug those without the outputs but this PR seems to be passing all tests! There is one comment about updating the test but after that we can merge!

sure. Will do

@anthonyabeo anthonyabeo merged commit cf547b4 into main Feb 15, 2024
7 checks passed
@anthonyabeo anthonyabeo deleted the std-bit-slice branch February 15, 2024 13:57
rachitnigam pushed a commit that referenced this pull request Feb 16, 2024
* add docs entry for std_bit_slice module

* add implementation of std_bit_slice module

* add test case for std_bit_slice module

* add test data for testing std_bit_slice module

* fix backward ordering of range extract parameters

* add 'std_bit_slice' implementation to interpreter

* change the Value.slice method to accept &self

* Update std-bit-slice test to use the new 'comb_mem_d1'

* Fix failing test

* Add 'std_bit_slice' definition to 'tests/import/a.expect'

* update std-bit-slice test
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.

3 participants