1
0
Fork 0
mirror of synced 2024-11-10 11:18:58 -05:00
ultimate-vim/sources_non_forked/vim-snippets/snippets/verilog.snippets

100 lines
1.4 KiB
Text
Raw Normal View History

2016-02-20 08:13:10 -05:00
# if statement
snippet if
if (${1}) begin
${0}
end
# If/else statements
snippet ife
if (${1}) begin
${2}
end
else begin
2020-12-04 16:15:32 -05:00
${3}
2016-02-20 08:13:10 -05:00
end
# Else if statement
snippet eif
else if (${1}) begin
${0}
end
#Else statement
snippet el
else begin
${0}
end
# While statement
snippet wh
while (${1}) begin
${0}
end
# Repeat Loop
snippet rep
repeat (${1}) begin
${0}
end
# Case statement
snippet case
case (${1:/* variable */})
${2:/* value */}: begin
${3}
end
default: begin
${4}
end
endcase
# CaseZ statement
snippet casez
casez (${1:/* variable */})
${2:/* value */}: begin
${3}
end
default: begin
${4}
end
endcase
# Always block
snippet al
always @(${1:/* sensitive list */}) begin
${0}
end
# Module block
snippet mod
2021-05-05 04:25:00 -04:00
module ${1:`vim_snippets#Filename('$1', 'name')`} (${2});
2016-02-20 08:13:10 -05:00
${0}
endmodule
2019-12-12 17:01:41 -05:00
# For
snippet for
for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) begin
${4}
end
# Forever
snippet forev
forever begin
${0}
end
# Function
snippet fun
function ${1:void} ${2:name}(${3});
${0}
endfunction: $2
# Task
snippet task
task ${1:name}(${2});
${0}
endtask: $1
2021-05-05 04:25:00 -04:00
# Initial
snippet ini
initial begin
${0}
end
# typedef struct packed
snippet tdsp
typedef struct packed {
int ${2:data};
} ${1:`vim_snippets#Filename('$1_t', 'name')`};
# typedef eum
snippet tde
typedef enum ${2:logic[15:0]}
{
${3:REG = 16'h0000}
} ${1:my_dest_t};