welcome, Verible users!

468 views
Skip to first unread message

David Fang

unread,
Dec 18, 2019, 5:31:59 PM12/18/19
to veribl...@googlegroups.com
Welcome, friends, to the Verible project user's forum!  This introduction is long overdue after the establishment of this list.  

Verible is a toolset that revolves around supporting SystemVerilog, and today consists of a parser, style linter, and formatter (in various stages of maturity).  The project originated at Google, but we made a conscious decision to share these tools, in the hopes that others might find them useful, or contribute back.  The developer list is equally open to all.  

Please use this mailing list to ask questions and discuss tool use matters.  Don't be shy!

David, a.k.a "fangism"
Message has been deleted

Юля Половнева

unread,
Mar 11, 2020, 8:48:32 AM3/11/20
to Verible Users

Hello!
My name is Yuliya and I've found recently your tool Verible. I like it, but i have one question.

Is it possible to change output style of formatter (ex. put everywhere tabs instead of spaces)? Or this tool uses only google style guide and nothing could be changed?

Thank you!

David Fang

unread,
Mar 11, 2020, 1:27:07 PM3/11/20
to Юля Половнева, Verible Users
Hello and welcome, Yuliya.

It is possible, but at this time we have no run-time configurability.
Here's where you'd make modifications:

This is where code finally get printed:

You would need to alter that printing loop to re-interpret the indentation amount before the first token.
The indentation amount is in spaces, which is computed in terms of indentation levels, where "indenting" is + 2 spaces and "wrapping" is +4 spaces, as determined:

If it so happens that your tab-indentation is equivalent to 2 spaces, you could calculate the number of tabs and print them.
This class may be useful in printing spaces or tabs:

Caveats: 
The above, however, only takes care of left-side indentations, but not wrappings of long lines.
If your tab size != 2, then you'll need to also adjust the internal spacing calculations in the wrapping optimization code:

Or... (maybe I should have suggested this first)
You could pipe the output of the current formatter through a transformer like sed to convert left-side spaces into tabs.
There is also a UNIX unexpand command:, e.g. unexpand --first-only --tabs=N

Mind you, for N != 2, you'd want to adjust indent and wrap amounts (using spaces) before piping into unexpand.

Hope this helps.

--
You received this message because you are subscribed to the Google Groups "Verible Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to verible-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/verible-users/4137de1e-9c26-464c-9235-6e5430719966%40googlegroups.com.

Tim 'mithro' Ansell

unread,
Mar 12, 2020, 11:57:58 AM3/12/20
to David Fang, Юля Половнева, Verible Users, Henner Zeller
I believe that Henner Zeller was looking at options to enable more configurability in verible however I don't know the current state of that work.

Tim 'mithro' Ansell

David Fang

unread,
Mar 12, 2020, 5:15:30 PM3/12/20
to Tim 'mithro' Ansell, Юля Половнева, Verible Users, Henner Zeller
Henner is working on configurability for the style linter, but not the formatter at this time.

Reply all
Reply to author
Forward
0 new messages