Add verilog snippets and refactor systemverilog removing duplicates

This commit is contained in:
Paolo Cretaro 2015-12-29 15:48:20 +01:00 committed by Melko
parent cb063bed37
commit b563fa7a10
2 changed files with 66 additions and 57 deletions

View File

@ -1,37 +1,6 @@
# if statement extends verilog
snippet if
if (${1}) begin # Foreach Loop
${0}
end
# If/else statements
snippet ife
if (${1}) begin
${2}
end
else begin
${1}
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
# Foreach Loopo
snippet fe snippet fe
foreach (${1}) begin foreach (${1}) begin
${0} ${0}
@ -41,24 +10,6 @@ snippet dowh
do begin do begin
${0} ${0}
end while (${1}); end while (${1});
# Case statement
snippet case
case (${1})
{$2}: begin
${0}
end
default: begin
end
endcase
# CaseZ statement
snippet casez
casez (${1})
{$2}: begin
${0}
end
default: begin
end
endcase
# Combinational always block # Combinational always block
snippet alc snippet alc
always_comb begin ${1:: statement_label} always_comb begin ${1:: statement_label}
@ -74,11 +25,6 @@ snippet all
always_latch begin ${1:: statement_label} always_latch begin ${1:: statement_label}
${0} ${0}
end $1 end $1
# Module block
snippet mod
module ${1:module_name} (${2});
${0}
endmodule : $1
# Class # Class
snippet cl snippet cl
class ${1:class_name}; class ${1:class_name};

63
snippets/verilog.snippets Normal file
View File

@ -0,0 +1,63 @@
# if statement
snippet if
if (${1}) begin
${0}
end
# If/else statements
snippet ife
if (${1}) begin
${2}
end
else begin
${1}
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
module ${1:module_name} (${2});
${0}
endmodule