verilog-mode : FSM snippets fix

This commit is contained in:
2022-07-27 13:50:47 +09:00
parent dce99092c5
commit 8e73183e41

View File

@ -0,0 +1,29 @@
# -*- mode: snippet -*-
# name: AUTO State ASCII
# uuid:
# key: trigger-key
# condition: t
# --
localparam // auto enum state_info
S_IDLE = 0;
reg [2:0] // auto enum state_info
cstate, nstate;
// synthesis translate_off
/*AUTOASCIIENUM("cstate", "cstate_ascii_r", "")*/
// synthesis translate_on
always@(posedge clk) begin
if(rst) begin
cstate <= S_IDLE;
end
else begin
cstate <= nstate;
end
end
always@* begin
case(cstate)
S_IDLE : nstate = S_IDLE;
default : nstate = S_IDLE;
endcase
end