[AVM]跨层次连接
上一篇 /
下一篇 2008-06-12 17:05:57
[AVM]跨层次连接
对于port-to-port连接(如上图中的C), 连接方向如下:
subcomponent.port.connect(port)
对于export-to-export连接(如上图中的E), 连接方向如下:
export.connect(subcomponent.export)
由上可以看出, 连接的方向是: 从producer到comsumer, 从左到右
代码如下 :

- Producer
1 class producer extends avm_named_component;
2
3 avm_blocking_put_port #(transaction) put_port;
4
5 gen g;
6 conv c;
7 tlm_fifo #(transaction) f;
8
9 function new(string name, avm_named_component parent);
10 super.new(name, parent);
11 put_port = new(“put_port”, this);
12 g = new(“gen”, this);
13 c = new(“conv”, this);
14 f = new(“fifo”, this);
15 endfunction
16
17 function void connect();
18 g.put_port.connect(f.blocking_put_export); // A
19 c.get_port.connect(f.blocking_get_export); // B
20 endfunction
21
22 function void import_connections();
23 c.put_port.connect(put_port); // C
24 endfunction
25
26 endclass
- Comsumer
1 class consumer extends avm_named_component;
2
3 avm_blocking_put_export #(transaction) put_export;
4
5 bfm b;
6 tlm_fifo #(transaction) f;
7
8 function new(string name, avm_named_component parent);
9 super.new(name, parent);
10 put_export = new(“put_export”, this);
11 f = new(“fifo”, this);
12 b = new(“bfm”, this);
13 endfunction
14
15 function void export_connections();
16 put_export.connect(f.blocking_put_export); // E
17 endfunction
18
19 function void connect();
20 b.get_port.connect(f.blocking_get_export); // F
21 endfunction
22
23 endclass
导入论坛
引用链接
收藏
分享给好友
推荐到圈子
管理
举报
TAG: