Skip to content

Commit 04cb5c7

Browse files
authored
vhdl: add multiple snippets (rafamadriz#464)
extend basic types, initialisation and while loop
1 parent da45b45 commit 04cb5c7

File tree

1 file changed

+77
-6
lines changed

1 file changed

+77
-6
lines changed

snippets/vhdl.json

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@
107107
"end generate $1;"
108108
]
109109
},
110+
"if_else": {
111+
"prefix": "ifelse",
112+
"description": "If else Statement",
113+
"body": [
114+
"if ${1:condition} then",
115+
"\t$0",
116+
"else",
117+
"\t",
118+
"end if;"
119+
]
120+
},
110121
"for": {
111122
"prefix": "for",
112123
"description": "For Loop",
@@ -201,34 +212,94 @@
201212
"end process $1;"
202213
]
203214
},
204-
"std_logic_vector": {
215+
"std_logic": {
205216
"prefix": "std",
217+
"description": "std_logic Type",
218+
"body": "std_logic;"
219+
},
220+
"std_logic initialised": {
221+
"prefix": "stdi",
222+
"description": "std_logic Type",
223+
"body": "std_logic := '0';"
224+
},
225+
"std_logic_vector": {
226+
"prefix": "stdv",
227+
"description": "std_logic_vector Type",
228+
"body": "std_logic_vector(${1:7} ${2|downto,to|} ${3:0});"
229+
},
230+
"std_logic_vector initialised": {
231+
"prefix": "stdvi",
206232
"description": "std_logic_vector Type",
207-
"body": "std_logic_vector(${1:7} ${2|downto,to|} ${3:0})"
233+
"body": "std_logic_vector(${1:7} ${2|downto,to|} ${3:0}) := (others => '0');"
208234
},
209235
"std_ulogic_vector": {
210-
"prefix": "stdu",
236+
"prefix": "stduv",
237+
"description": "std_ulogic_vector Type",
238+
"body": "std_ulogic_vector(${1:7} ${2|downto,to|} ${3:0});"
239+
},
240+
"std_ulogic_vector initialised": {
241+
"prefix": "stduvi",
211242
"description": "std_ulogic_vector Type",
212-
"body": "std_ulogic_vector(${1:7} ${2|downto,to|} ${3:0})"
243+
"body": "std_ulogic_vector(${1:7} ${2|downto,to|} ${3:0}) := (others => '0');"
213244
},
214245
"signed": {
215246
"prefix": "si",
216247
"description": "signed Type",
217248
"body": "signed(${1:7} ${2|downto,to|} ${3:0})"
218249
},
250+
"signed initialised": {
251+
"prefix": "sii",
252+
"description": "signed Type initialised",
253+
"body": "signed(${1:7} ${2|downto,to|} ${3:0}) := (others => '0');"
254+
},
219255
"unsigned": {
220256
"prefix": "uns",
221257
"description": "unsigned Type",
222258
"body": "unsigned(${1:7} ${2|downto,to|} ${3:0})"
223259
},
260+
"unsigned initialised": {
261+
"prefix": "unsi",
262+
"description": "unsigned Type",
263+
"body": "unsigned(${1:7} ${2|downto,to|} ${3:0}) := (others => '0');"
264+
},
224265
"zeroes": {
225266
"prefix": "oth",
226267
"description": "Zero Others",
227-
"body": "others => '0'"
268+
"body": "(others => '0')"
269+
},
270+
"zeroes_arr": {
271+
"prefix": "otharr",
272+
"description": "Zero Others Array",
273+
"body": "(others => (others => '0'))"
274+
},
275+
"ones": {
276+
"prefix": "oth1",
277+
"description": "Zero Others",
278+
"body": "(others => '1')"
279+
},
280+
"ones_arr": {
281+
"prefix": "otharr1",
282+
"description": "Zero Others Array",
283+
"body": "(others => (others => '1'))"
284+
},
285+
"zeroes": {
286+
"prefix": "oth",
287+
"description": "Zero Others",
288+
"body": "(others => '0')"
289+
},
290+
"zeroes_arr": {
291+
"prefix": "otharr",
292+
"description": "Zero Others Array",
293+
"body": "(others => (others => '0'))"
228294
},
229295
"integer_range_limitation": {
230296
"prefix": "intr",
231297
"description": "Integer (Range Limitation)",
232298
"body": "integer range ${1:0} ${2|downto,to|} ${3:255}"
299+
},
300+
"while loop": {
301+
"prefix": "while",
302+
"description": "While Loop",
303+
"body": ["while ${1:condition} loop", "\t$0", "end loop;"]
233304
}
234-
}
305+
}

0 commit comments

Comments
 (0)