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

dslx_fmt breaks files with arrays of channels #1233

Closed
rw1nkler opened this issue Dec 19, 2023 · 0 comments
Closed

dslx_fmt breaks files with arrays of channels #1233

rw1nkler opened this issue Dec 19, 2023 · 0 comments
Labels
bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end

Comments

@rw1nkler
Copy link
Contributor

When a file with a Proc that contains an array of channels is passed to dslx_fmt, the tool formats it incorrectly.
As a result, the file can no longer be parsed correctly by the DSLX interpreter.

diff --git a/xls/examples/bug.x b/xls/examples/bug.x
index a36002d8b..188823d81 100644
--- a/xls/examples/bug.x
+++ b/xls/examples/bug.x
@@ -15,12 +15,12 @@ proc Passthrough {
 #[test_proc]
 proc SimpleTest {
     terminator: chan<bool> out;
-    input_s: chan<u32>[2] out;
-    output_r: chan<u32>[2] in;
+    input_s: chan<u32> out2;
+    output_r: chan<u32> in2;

     config(terminator: chan<bool> out) {
-        let (input_s, input_r) = chan<u32>[2];
-        let (output_s, output_r) = chan<u32>[2];
+        let (input_s, input_r) = chan<u32>2;
+        let (output_s, output_r) = chan<u32>2;

         spawn Passthrough(input_r[0], output_s[0]);
         spawn Passthrough(input_r[1], output_s[1]);

Here is the input file that I used: bug.x.
Tested on current main branch (8aacd820)

@cdleary cdleary added bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end labels Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end
Projects
None yet
Development

No branches or pull requests

2 participants