imicman的个人空间 https://blog.eetop.cn/1518355 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

bind

已有 863 次阅读| 2016-8-10 22:32 |个人分类:验证杂谈

From ieee 1800

bind_directive ::= 
bind  bind_target_scope [ :  bind_target_instance_list] bind_instantiation  ;  
| bind  bind_target_instance bind_instantiation  ;  

bind_target_scope ::=  module_identifier  | interface_identifier 
bind_target_instance ::=  hierarchical_identifier constant_bit_select 
bind_target_instance_list ::=  bind_target_instance {  ,  bind_target_instance } 
bind_instantiation ::=   program_instantiation  | module_instantiation  | interface_instantiation | checker_instantiation

The  bind  directive can be specified in any of the following:
— A module 
— An interface 
— A compilation-unit scope 
There are two forms of bind syntax. In the first form, bind_target_scope specifies a target scope into which
the bind_instantiation should be inserted. A bind target scope shall be a module or an interface. A bind
target instance shall be an instance of a module or an interface. In the absence of a bind_target_instance_list,
the  bind_instantiation  is  inserted  into  all  instances  of  the  specified  target  scope,  designwide.  If  a
bind_target_instance_list is present, the bind_instantiation is only inserted into the specified instances of
the target scope. The bind_instantiation is effectively a complete module, interface, program, or checker
instantiation statement. 

The second form. of bind syntax can be used to specify a single instance into which the bind_instantiation
should be inserted. If the second form. of bind syntax is used and the bind_target_instance identifier resolves
to both an instance name and a module name, binding shall only occur to the specified instance.


点赞

发表评论 评论 (1 个评论)

回复 imicman 2016-8-10 22:40
Example of binding a program instance to a module: bind cpu fpu_props fpu_rules_1(a,b,c); where — cpu is the name of the target module. — fpu_props is the name of the program to be instantiated. — fpu_rules_1 is the program instance name to be created in the target scope. — An instance named fpu_rules_1 is instantiated in every instance of module cpu . — The first three ports of program fpu_props get bound to objects a , b , and c in module cpu (these objects are viewed from module cpu ’s point of view, and they are completely distinct from any objects named a , b , and c that are visible in the scope that contains the bind directive). Example of binding a program instance to a specific instance of a module: bind cpu: cpu1 fpu_props fpu_rules_1(a, b, c); In the example above, the fpu_rules_1 instance is bound into the cpu1 instance of module cpu . Example of binding a program instance to multiple instances of a module: bind cpu: cpu1, cpu2, cpu3 fpu_props fpu_rules_1(a, b, c); In the example above, the fpu_rules_1 instance is bound into instances cpu1 , cpu2 , and cpu3 of module cpu . By binding a program to a module or an instance, the program becomes part of the bound object. The names of assertion-related declarations can be referenced using the SystemVerilog hierarchical naming conventions. The bind_instantiation portion of the bind statement allows the complete range of SystemVerilog instantiation syntax. In other words, both parameter and port associations may appear in the bind_instantiation. All actual ports and parameters in the bind_instantiation refer to objects from the viewpoint of the bind_target_instance. When an instance is bound into a target scope, the effect will be as if the instance was present at the very end of the target scope. In other words, all declarations present in the target scope or imported into the target scope are visible to the bound instance. Wildcard import candidates that have been imported into the scope are visible, but a bind statement cannot cause the import of a wildcard candidate. Declarations present or imported into $unit are not visible in the bind statement. The following is an example of a module containing a bind statement with complex instantiation syntax. All identifiers in the bind instantiation are referenced from the bind target’s point of view in the overall design hierarchy. bind targetmod mycheck #(.param1(const4), .param2(8’h44)) i_mycheck(.*, .p1(f1({v1, 1’b0, b1.c}, v2 & v3)), .p2(top.v4));

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 1

    粉丝
  • 0

    好友
  • 8

    获赞
  • 34

    评论
  • 访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-3-29 06:23 , Processed in 0.041253 second(s), 19 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部