Verible-verilog-format

445 views
Skip to first unread message

Pratyush Jain

unread,
Jan 6, 2022, 12:23:16 AM1/6/22
to Verible Users
Hi Verible Users
      I tried to use the formatter for formatting system verilog files and I am able to do so successfully. However what I see is that when I run the formatter on the input file the output comes on the console or I can pipe it to some other file by giving a new file name. Is there an option, such that it can format the existing file itself.

Example: 
verible-verilog-format riscv.sv

Can it update the riscv.sv file itself ?

Thanks
Pratyush

Henner Zeller

unread,
Jan 6, 2022, 12:55:37 AM1/6/22
to Pratyush Jain, Verible Users
On Wed, 5 Jan 2022 at 21:23, Pratyush Jain <pj...@tenstorrent.com> wrote:
Hi Verible Users
      I tried to use the formatter for formatting system verilog files and I am able to do so successfully. However what I see is that when I run the formatter on the input file the output comes on the console or I can pipe it to some other file by giving a new file name. Is there an option, such that it can format the existing file itself.

If you want the output in a different file, you can use the redirect functionality of your shell

  verible-verilog-format riscv.sv > formatted-output.sv

With the --inplace flag, you can modify the file directly, your second question:

  verible-verilog-format --inplace riscv.sv

This will format the file and replace the original file with the formatted version.

There are a few options you can play with to adapt the output to your liking:

Cheers,
  Henner.


Example: 
verible-verilog-format riscv.sv

Can it update the riscv.sv file itself ?

Thanks
Pratyush

--
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/CAKkScAdYHPGa%2BiEiFZK%3D6FSAECKGqYsY6S3H_JqeZzK%3DQKfCLw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages