MikePopoloski / slang

SystemVerilog compiler and language services
MIT License
550 stars 117 forks source link

SystemVerilog source formatting tool #291

Closed atkenny15 closed 4 years ago

atkenny15 commented 4 years ago

Hi @MikePopoloski,

I am very interested in a clang-format-like tool for SystemVerilog and looking through the rewriter code, it looks like this project provides great support for building such a tool. Before I start writing this, I wanted to talk to you and see if you had any plans for development in this area. Some initial questions

Thanks, Andy

mithro commented 4 years ago

@atkenny15 You should check out Google's veribile.

Formatter

The formatter is a transformative tool that manages whitespace in accordance with a particular style. The main goal is to relieve humans of having to manually manage whitespace, wrapping, and indentation, and to provide a tool that can be integrated into any editor to enable editor-independent consistency.

atkenny15 commented 4 years ago

@mithro Thanks for the pointer, that looks like it will solve my problem

mithro commented 4 years ago

slang is pretty cool too -- Takes a look at how it goes in our sv-test suite.

MikePopoloski commented 4 years ago

Yes, slang's API is designed to make it very easy to write a clang-format kind of tool, I simply haven't had time to work on that. I'd be happy to accept such a tool into the repo if you wanted. If you're happy to just use verible that's fine, but if you still want pointers on slang's API I'd be happy to help.

atkenny15 commented 4 years ago

@MikePopoloski Thanks for the reply. Verible's style is not what I'm looking for so it might be easier to add formatting support to slang. I'm still evaluating the effort to add my coding style to Verible's formatter vs. adding a formatter to slang. I appreciate your help and will let you know when I've decided on a direction. Thanks again!

MikePopoloski commented 4 years ago

I'm going to close out this issue; feel free to open another or message me on gitter if you decide to come back to this.