-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuvm_env.sublime-snippet
32 lines (26 loc) · 1.01 KB
/
uvm_env.sublime-snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<snippet>
<name>UVM env</name>
<content><![CDATA[class ${1:${TM_FILENAME/(.+)\..+|.*/$1/:name}} extends uvm_env;
`uvm_component_utils(${1})
$2_agent m_agent;
$2_scoreboard m_sb;
$2_config m_cfg;
$0
function new(string name = "${1}", uvm_component parent=null);
super.new(name, parent);
endfunction
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
m_agent = $2_agent::type_id::create("$2_agent",this);
m_bd_agent = $2_bd_agent::type_id::create("$2_bd_agent",this);
m_sb = $2_scoreboard::type_id::create("$2_scoreboard",this);
m_agent.m_cfg = m_cfg;
endfunction
virtual function void connect_phase(uvm_phase phase);
m_agent.m_driver.drvn_to_sb.connect(m_sb.from_driver);
m_agent.m_driver.mtrd_to_sb.connect(m_sb.from_monitor);
endfunction : connect_phase
endclass]]></content>
<tabTrigger>uvm_env</tabTrigger>
<scope>source.systemverilog</scope>
</snippet>