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 formatter does not line wrap proc instantiation parametrics #1970

Open
mikex-oss opened this issue Mar 1, 2025 · 0 comments
Open

DSLX formatter does not line wrap proc instantiation parametrics #1970

mikex-oss opened this issue Mar 1, 2025 · 0 comments
Labels
bug Something isn't working or is incorrect dslx:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end

Comments

@mikex-oss
Copy link
Collaborator

Describe the bug

If you have a long list of parametric bindings for a spawned proc, it will not line wrap at all. E.g.

import xls.examples.ram as ram_model;

const DATA_WIDTH = u32:32;
const RAM_ADDR_WIDTH = u32:7;
const RAM_DEPTH = u32:128;
const WORD_PARTITION_SIZE = DATA_WIDTH;
const INITIALIZED = false;
const ASSERT_VALID_READ = false;

type RamModelReadReq = ram_model::ReadReq<RAM_ADDR_WIDTH, 1>;
type RamModelReadResp = ram_model::ReadResp<DATA_WIDTH>;
type RamModelWriteReq = ram_model::WriteReq<RAM_ADDR_WIDTH, DATA_WIDTH, 1>;
type RamModelWriteResp = ram_model::WriteResp;

proc Foo {
    config() {
        let (ram_model_rd_req_s, ram_model_rd_req_r) = chan<RamModelReadReq>("ram_model_rd_req");
        let (ram_model_rd_resp_s, ram_model_rd_resp_r) =
            chan<RamModelReadResp>("ram_model_rd_resp");
        let (ram_model_wr_req_s, ram_model_wr_req_r) = chan<RamModelWriteReq>("ram_model_wr_req");
        let (ram_model_wr_resp_s, ram_model_wr_resp_r) =
            chan<RamModelWriteResp>("ram_model_wr_resp");

        spawn ram_model::RamModel<
            DATA_WIDTH, RAM_DEPTH, WORD_PARTITION_SIZE, ram_model::SimultaneousReadWriteBehavior::ASSERT_NO_CONFLICT, false, false>(
            ram_model_rd_req_r, ram_model_rd_resp_s, ram_model_wr_req_r, ram_model_wr_resp_s);
    }

    init { () }

    next(state: ()) {  }
}

To Reproduce
The above code is already formatted.

Expected behavior
The parametrics between < and > should be line wrapped as appropriate to fit in the line length constraint.

@mikex-oss mikex-oss added bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end dslx:fmt DSLX auto-formatter labels Mar 1, 2025
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:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end
Projects
Status: No status
Development

No branches or pull requests

1 participant