Skip to content

Commit

Permalink
re-organized before merging with master for ghdl#32
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Nicholls authored and Glen Nicholls committed Nov 15, 2019
1 parent 8ae5ce5 commit 0ef984e
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 64 deletions.
36 changes: 18 additions & 18 deletions vscode-client/snippets/snippets.generate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
{
"Generate If": {
"prefix": "generate_if",
"body": [
"gen_${1:generateName} : if ${2:expression} generate",
"\t$0",
"end generate;"
],
"description": "if generate instantiation"
},
"Generate For": {
"prefix": "generate_for",
"body": [
"gen_loop_${1:generateName} : for ${2:i} in ${3:range} generate",
"\t$0",
"end generate;"
],
"description": "for generate loop instantiation (vhdl 2008)"
},
"Generate Case 2008": {
"prefix": "generate_case_2008",
"body": [
Expand All @@ -10,15 +28,6 @@
],
"description": "case generate instantiation (vhdl 2008)"
},
"Generate If": {
"prefix": "generate_if",
"body": [
"gen_${1:generateName} : if ${2:expression} generate",
"\t$0",
"end generate;"
],
"description": "if generate instantiation"
},
"Generate Elsif 2008": {
"prefix": "generate_elsif_2008",
"body": [
Expand All @@ -34,14 +43,5 @@
"\t\t$0"
],
"description": "else generate instantiation (vhdl 2008)"
},
"Generate For": {
"prefix": "generate_for",
"body": [
"gen_loop_${1:generateName} : for ${2:i} in ${3:range} generate",
"\t$0",
"end generate;"
],
"description": "for generate loop instantiation (vhdl 2008)"
}
}
39 changes: 1 addition & 38 deletions vscode-client/snippets/snippets.vhdl.declaration.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@
],
"description": "synthesizable attributes (high,low,left,right,range,reverse_range,length,event)"
},
"Assert": {
"prefix": "assert",
"body": [
"assert ${1:expression}",
"\treport \"${2:string}\"",
"\tseverity ${3|note,warning,error,failure|};",
"$0"
],
"description": "assert declaration"
},
"Constant": {
"prefix": "constant",
"body": [
Expand Down Expand Up @@ -78,7 +68,7 @@
],
"description": "procedure body declaration"
},
"Record Type": {
"Record": {
"prefix": "record",
"body": [
"type ${1:name} is record",
Expand Down Expand Up @@ -126,33 +116,6 @@
"body": [ "unsigned(${1} ${2|downto,to|} ${3})${4| := ,;|}$0" ],
"description": "unsigned declaration"
},
"When": {
"prefix": "when",
"body": [
"when ${1:others} =>",
"\t$0"
],
"description": "when declaration"
},
"When Else": {
"prefix": "when_else",
"body": [
"${1:signal} <= ${2:first_value} when ${3:expression}",
"\telse ${4:final_value};",
"$0"
],
"description": "concurrent when else declaration"
},
"With Select": {
"prefix": ["select", "with_select"],
"body": [
"with ${1:select} select",
"\t${2:signal} <= ${3:first_value} when ${4:select_value},",
"\t\t${5:last_value} when others;",
"$0"
],
"description": "concurrent with select declaration"
},
"Variable": {
"prefix": "variable",
"body": [
Expand Down
63 changes: 57 additions & 6 deletions vscode-client/snippets/snippets.vhdl.interface.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// TODO: package generics
// TODO: configuration
"Architecture Interface": {
"Architecture": {
"prefix": "architecture",
"body": [
"architecture ${1:behav} of ${2:$TM_FILENAME_BASE} is",
Expand All @@ -11,7 +11,7 @@
],
"description": "architecture interface"
},
"Block Interface": {
"Block": {
"prefix": "block",
"body": [
"blk_${1:blockName} : block ${2| ,optional_guard_expression|}",
Expand All @@ -21,7 +21,22 @@
],
"description": "block interface"
},
"Component Interface": {
"Component": {
"prefix":"component",
"body": [
"${1:instanceName}_inst: ${2:entity work.compName}",
"\tgeneric map (",
"\t\t${3:generics}",
"\t)",
"\tport map (",
"\t\t${4:clk => clk,}",
"\t\t${5:reset => reset,}",
"\t\t$0",
"\t);"
],
"description": "component instantiation"
},
"Component": {
"prefix":"component",
"body": [
"component ${1:comp_name} is",
Expand All @@ -37,7 +52,7 @@
],
"description": "component interface"
},
"Entity Interface": {
"Entity": {
"prefix": "entity",
"body": [
"entity ${1:$TM_FILENAME_BASE} is",
Expand All @@ -53,7 +68,25 @@
],
"description": "entity interface"
},
"Package Interface": {
"Generic": {
"prefix": "generic",
"body": [
"generic (",
"\t${2:generics}",
");"
],
"description": "generic interface"
},
"Generic Map": {
"prefix": "generic_map",
"body": [
"generic map (",
"\t${2:generics}",
")"
],
"description": "generic map interface"
},
"Package": {
"prefix": "package",
"body": [
"package ${1:$TM_FILENAME_BASE} is",
Expand All @@ -62,13 +95,31 @@
],
"description": "package interface"
},
"Package Body Interface": {
"Package Body": {
"prefix": "package_body",
"body": [
"package body ${1:$TM_FILENAME_BASE} is",
"\t$0",
"end package;"
],
"description": "package body interface"
},
"Port": {
"prefix": "port",
"body": [
"port (",
"\t${2:ports}",
");"
],
"description": "port interface"
},
"Port Map": {
"prefix": "port_map",
"body": [
"port map (",
"\t${2:ports}",
");"
],
"description": "port map interface"
}
}
2 changes: 1 addition & 1 deletion vscode-client/snippets/snippets.vhdl.library.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
"$0"
],
"description": "context clause for IEEE standard contexts (ieee_bit_context,ieee_std_context) (vhdl 2008)"
},
}
}
39 changes: 38 additions & 1 deletion vscode-client/snippets/snippets.vhdl.logic.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
{
"Assert": {
"prefix": "assert",
"body": [
"assert ${1:expression}",
"\treport \"${2:string}\"",
"\tseverity ${3|note,warning,error,failure|};",
"$0"
],
"description": "assert declaration"
},
"Case": {
"prefix": "case",
"body": [
"case ${1:select} is",
"case ${1:sel} is",
"\twhen ${2:others} =>",
"\t\t${3:null;}",
"\t$0",
Expand Down Expand Up @@ -106,6 +116,23 @@
],
"description": "combinatorial process block (vhdl 2008)"
},
"When": {
"prefix": "when",
"body": [
"when ${1:others} =>",
"\t$0"
],
"description": "when declaration"
},
"When Else": {
"prefix": "when_else",
"body": [
"${1:signal} <= ${2:first_value} when ${3:expression}",
"\telse ${4:final_value};",
"$0"
],
"description": "concurrent when else declaration"
},
"While": {
"prefix": "while",
"body": [
Expand All @@ -114,5 +141,15 @@
"end loop;"
],
"description": "while loop block"
},
"With Select": {
"prefix": ["select", "with_select"],
"body": [
"with ${1:sel} select",
"\t${2:signal} <= ${3:first_value} when ${4:select_value},",
"\t\t${5:last_value} when others;",
"$0"
],
"description": "concurrent with select declaration"
}
}

0 comments on commit 0ef984e

Please sign in to comment.