mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-13 23:51:34 +09:00
verilog-mode : FSM snippets fix
This commit is contained in:
29
.doom.d/snippets/verilog-mode/AUTO State ASCII
Executable file
29
.doom.d/snippets/verilog-mode/AUTO State ASCII
Executable 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
|
||||
Reference in New Issue
Block a user