簡體   English   中英

需要幫助關閉端口列表中信號后重新對齊注釋。 (Verilog的模式)

[英]Need Help Turning off re-align comments after signals in port list. (Verilog-Mode)

這是我的問題,我將端口列表定義為:

module spi_jstk ( 
                  input        clk,     // System Clock (40MHz)
                  input        reset,   // Async Reset
                  input        START,   // Initialize SPI Transfer
                  input [39:0] DATA,    // Input Data to Transfer
                  input        SS,      // Chip Select
                  output       SCLK,    // Serial Clock
                  input        MISO,    // Master In Slave Out
                  output       MOSI );  // Master Out Slave In

看起來很不錯。

現在讓我說我在這個列表中添加一個新信號,或者只是點擊TAB,這就是:

module spi_jstk ( 
                  input        clk, // System Clock (40MHz)
                  input        reset, // Async Reset
                  input        START, // Initialize SPI Transfer
                  input [39:0] DATA, // Input Data to Transfer
                  input        SS, // Chip Select
                  output       SCLK, // Serial Clock
                  output       NEW, // NEW SIGNAL
                  input        MISO, // Master In Slave Out
                  output       MOSI );  // Master Out Slave In

不知道為什么它對我的評論這樣做,有誰知道我如何關閉它? 它真的很令人沮喪。

另一件我不明白的事情是,如果我在常規信號列表(而不是端口列表)中點擊TAB,它就不會弄亂我的評論。 選項卡后這些注釋保持對齊。

   // Signals
   reg [2:0]  q_state, n_state;
   reg        q_clk;
   reg        q_sck;    //1 MHz ticks
   reg [7:0]  q_mosi;   //1 MHz ticks  
   reg [7:0]  q_miso;   //1 MHz ticks

任何人都知道如何解決這個問題? 謝謝。

這似乎是auto-lineup行為的副作用。 Ch v verilog-auto-lineup enter的文檔描述了該行為

Type of statements to lineup across multiple lines.
If 'all' is selected, then all line ups described below are done.

If 'declarations', then just declarations are lined up with any
preceding declarations, taking into account widths and the like,
so or example the code:
    reg [31:0] a;
    reg b;
would become
    reg [31:0] a;
    reg        b;

If 'assignment', then assignments are lined up with any preceding
assignments, so for example the code
    a_long_variable <= b + c;
    d = e + f;
would become
    a_long_variable <= b + c;
    d                = e + f;

然而,在這個過程中它似乎刪除了代碼和注釋之間的額外空格,我找不到一種方法來防止它搞亂評論(你可能想向其維護者報告一個錯誤做Mx verilog-submit-bug -report RET )。 一種選擇可能是通過自定義變量verilog-auto-lineup來禁用此行為。 有幾種方法可以做到這一點

1)您可以使用emacs的自定義UI來執行此操作。 只做Mx自定義變量RET verilog-auto-lineup RET 並為變量選擇所需的值。

2)您可以在init文件中添加以下內容之一

(setq verilog-auto-lineup nil)  ;; disable completely

(setq verilog-auto-lineup 'assignment)  ;; disable only for declarations

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM