Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. {
  2. // Place your snippets for systemverilog here. Each snippet is defined under a snippet name and has a prefix, body and
  3. // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
  4. // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
  5. // same ids are connected.
  6. // Example:
  7. // "Print to console": {
  8. // "prefix": "log",
  9. // "body": [
  10. // "console.log('$1');",
  11. // "$2"
  12. // ],
  13. // "description": "Log output to console"
  14. // }
  15.  
  16. "UVM Info": {
  17. "prefix": "uinfo",
  18. "body": ["`uvm_info(get_name(),$sformatf(\"$1\"),UVM_${2:LOW});"]
  19. },
  20.  
  21. "UVM Error": {
  22. "prefix": "uerror",
  23. "body": ["`uvm_error(get_name(),$sformatf(\"$1\"));"]
  24. },
  25.  
  26. "UVM Fatal": {
  27. "prefix": "ufatal",
  28. "body": ["`uvm_fatal(get_name(),$sformatf(\"$1\"));"]
  29. },
  30.  
  31. "Variable with comments" : {
  32. "prefix": "uvar",
  33. "body": [
  34. "// Variable: ${1:name}",
  35. "// ${2:Variable Description}",
  36. "${3:int} ${1};"
  37. ]
  38. },
  39.  
  40. "Task SystemVerilog" : {
  41. "prefix": "utask",
  42. "body": [
  43. "/*",
  44. " * Task: ${1}",
  45. " *",
  46. " * ${2}",
  47. " *",
  48. " * Parameters:",
  49. " *",
  50. " */",
  51. "task ${1}();",
  52. " ${0}",
  53. "endtask // ${1}"
  54. ]
  55. },
  56.  
  57. "Function SystemVerilog" : {
  58. "prefix" : "ufunction",
  59. "body": [
  60. "/*",
  61. " * Function: ${1}",
  62. " *",
  63. " * ${2}",
  64. " *",
  65. " * Parameters:",
  66. " *",
  67. " */",
  68. "function ${1}();",
  69. " ${0}",
  70. "endfunction // ${1}"
  71. ]
  72. },
  73.  
  74. "UVM object": {
  75. "prefix": "uobj",
  76. "body": [
  77. "/*",
  78. " * Class: ${1}",
  79. " *",
  80. " * ${2:Class Description}",
  81. " *",
  82. " */",
  83. "class ${1} extends ${3:uvm_object}",
  84. " `uvm_object_utils($1)",
  85. "",
  86. " // ***************************",
  87. " // Group: State variables",
  88. " // ***************************",
  89. "",
  90. " // ***************************",
  91. " // Group: Random variables",
  92. " // ***************************",
  93. "",
  94. " // Constructor: new",
  95. " function new(string name=\"$1\");",
  96. " super.new(name);",
  97. " endfunction",
  98. "",
  99. " ${0}",
  100. "endclass // ${1}",
  101. ]
  102. },
  103.  
  104. "UVM component": {
  105. "prefix": "ucomp",
  106. "body": [
  107. "/*",
  108. "* Class: ${1}",
  109. "*",
  110. "* ${2:Component Description}",
  111. "*",
  112. "*/",
  113. "class ${1} extends ${3:uvm_component}",
  114. " `uvm_component_utils($1)",
  115. "",
  116. " // ***************************",
  117. " // Group: State variables",
  118. " // ***************************",
  119. "",
  120. " // ***************************",
  121. " // Group: Random variables",
  122. " // ***************************",
  123. "",
  124. " // Constructor: new",
  125. " function new(string name=\"$1\", uvm_component parent);",
  126. " super.new(name, parent);",
  127. " endfunction",
  128. "",
  129. " ${0}",
  130. "endclass // ${1}"
  131. ]
  132. },
  133.  
  134. "UVM Phase Function": {
  135. "prefix": "uphase_func",
  136. "body": [
  137. "/**",
  138. "* Function: ${1:build}_phase",
  139. "*",
  140. "* ${2:Method description needed}",
  141. "*",
  142. "* Parameters:",
  143. "* - uvm_phase phase",
  144. "*/",
  145. "function void ${1}_phase(uvm_phase phase);",
  146. " super.${1}_phase(phase);",
  147. " ${0}",
  148. "endfunction // ${1}_phase"
  149. ]
  150. },
  151.  
  152. "UVM Phase Task": {
  153. "prefix": "uphase_task",
  154. "body": [
  155. "/**",
  156. "* Task: ${1:build}_phase",
  157. "*",
  158. "* ${2:Method description needed}",
  159. "*",
  160. "* Parameters:",
  161. "* - uvm_phase phase",
  162. "*/",
  163. "task ${1}_phase(uvm_phase phase);",
  164. " super.${1}_phase(phase);",
  165. " ${0}",
  166. "endtask // ${1}_phase"
  167. ]
  168. },
  169.  
  170. "UVM Config DB set": {
  171. "prefix": "udbset",
  172. "body": [
  173. "uvm_config_db #(${1:uvm_object})::set(${2:this}, \"${3}\", \"${4:name}\" , ${5:variable}))"
  174. ]
  175. },
  176.  
  177. "UVM Config DB get": {
  178. "prefix": "udbget",
  179. "body": [
  180. "if (!uvm_config_db #(${1:uvm_object})::get(${2:this}, \"${3}\", \"${4:name}\" , ${5:variable})) begin",
  181. "`uvm_error(get_name(),\"Failed to find ${2:this}.${3}.${4:name} of type ${1:uvm_object}\");",
  182. "end"
  183. ]
  184. }
  185. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement