介绍Data类中的binding的定义和用法。
 
Binding stores information about this node's position in the hardware graph.
This information is supplemental (more than is necessary to generate FIRRTL) and is used to
perform checks in Chisel, where more informative error messages are possible.
 
 
 
1. Data类的成员binding
 
a. binding基于另一个数据成员:_binding,这是一个Option类型;
b. getter: private[core] def binding = _binding.get
 
因为_binding是一个Option,所以_binding.get报错或者target。
 
c. setter: protected def binding_=(target: Binding)
 
Scala的特性,名称如"binding_="的方法,可以直接使用“binding = xxx”的方式调用和赋值。
 
 
2. Data类中的topBinding
 
从提示可以看出,这是一个递归调用的方法。
 
topBinding返回最顶层的Binding。如果是一个ChildBinding,则向上回溯继续获取上一层的topBinding。
 
3. Data子类中的bind
 
Data中的bind方法是一个抽象方法,需要在子类中加以实现。
 
1) Element中的bind方法
 
这个方法把传入的Binding赋值给自己的binding成员(调用binding_=方法)。
 
2) Aggregate中的bind方法
 
Aggregate是Bundle的父父类。Bundle被用来定义各种自定义的数据类型,如:
 
Aggregate的bind方法定义如下:
a. 调用"binding_="方法,赋值binding:binding = target
 
b. 把Aggregate中的数据成员也逐个进行绑定,其绑定是Aggregate的子绑定
 
当获取topBinding的时候,Aggregate会直接返回target;而Aggregate中的数据成员,会先拆开ChildBinding,最终获取到target。
 
 
 

Chisel3 - bind - Data的更多相关文章

  1. How to bind data to a user control

    http://support.microsoft.com/kb/327413 Create a user control  by inheriting from the System.Windows. ...

  2. Chisel3 - bind - Op, ReadOnly, 左值

    https://mp.weixin.qq.com/s/F_08jKFMoX9Gf_J_YpsDpg   两个数据变量进行某个操作(op),产生一个输出,这个输出存在一个匿名变量中.这个匿名变量就是以O ...

  3. Chisel3 - bind - Wire, Reg, MemPort

    https://mp.weixin.qq.com/s/AxYlRtAXjd55eoGX5l1W-A   模块(Module)从输入端口(input ports)接收输入,经过内部实现的转换逻辑,从输出 ...

  4. Chisel3 - bind - Binding

    https://mp.weixin.qq.com/s/2318e6VJ4wFGpWwBOmTikA   Chisel数据类型(Data)与Module的绑定关系,根据Data的使用方式不同,而有多种绑 ...

  5. Chisel3 - bind - PortBinding

    https://mp.weixin.qq.com/s/NaInHsJgOwG03BLNF-wlxQ   介绍Module输入输出端口如何进行绑定.   ​​     1. IO()   在定义一个模块 ...

  6. 【R读取报错】解决: Can't bind data because some arguments have the same name

    最近读取一个数据时,报如标题的错误. args[1] <- "RT_10-VS-RT_0" all <- read.delim(paste0(args[1]," ...

  7. 更新补丁Bind

    1.查询补丁版本信息 (1) rpm -qa|grep bind (2) dig @localhost version.bind 2.下载安装 BIND最新漏洞和升级解决办法 现在有非常多的公司的都有 ...

  8. SliverLight(how to show data point on the column series)

    You should know that Silverlight comes with win form drawing software is different, it has no the la ...

  9. ISC BIND9 - 最详细、最认真的从零开始的BIND 9 服务讲解

    DNS and BIND 服务的搭建说明 目录 目录 DNS and BIND 服务的搭建说明 1. 背景 1.1 DNS 1.2 FQDN 1.3 BIND 1.4 本文中搭建模拟DNS服务网络虚拟 ...

随机推荐

  1. OpenWrt R2020.3.19 反追踪 抗污染 加速 PSW 无缝集成 UnPnP NAS

    固件说明 基于Lede OpenWrt R2020.3.19版本Lienol Feed及若干自行维护的软件包 结合家庭x86软路由场景需要定制 按照家庭应用场景对固件及软件进行测试,通过后发布 设计目 ...

  2. RabbitMQ的发布订阅模式(Publish/Subscribe)

    一.发布/订阅(Publish/Subscribe)模式 发布订阅是我们经常会用到的一种模式,生产者生产消息后,所有订阅者都可以收到.RabbitMQ的发布/订阅模型图如下: 1.该模式下生产者并不是 ...

  3. Android广播时间——实现强制下线功能

    目录 思路:强制下线功能需要先关闭掉所有的活动,然后回到登录界面. 步骤 1.关闭所有活动 2.创建BaseActivity类作为所有活动的父类,因为需要用ActivityCollector管理所有活 ...

  4. swagger集成遇到的坑一个

    SpringBoot项目集成swagger项目遇到一个问题: 访问swagger-ui.html 没有加载到数据,也没有加载到页面的html和css资源 除了 1.添加swagger的pom依赖 2. ...

  5. Redis的几种集群方式分析

    一 单机版 分析: 无论多少用户,都访问这一台服务器 .服务器一旦挂了,所有用户都无法访问.风险很大,一般不会有人使用. 二 主从模式(master/slaver) 分析: 主从模式中, 无论多少用户 ...

  6. spring中<context:property-placeholder/>一个坑

    <context:property-placeholder location="classpath:db.properties" ></context:prope ...

  7. vue element-ui el-form-item 循环渲染,验证表单内容

    data里面如下图:

  8. flex布局学习总结--阮一峰

    基本概念:   采用 Flex 布局的元素,称为 Flex 容器(flex container),简称"容器".它的所有子元素自动成为容器成员,称为 Flex 项目(flex it ...

  9. 7.2 Go type assertion

    7.2 Go type assertion 类型断言是使用在接口值上的操作. 语法x.(T)被称为类型断言,x代表接口的类型,T代表一个类型检查. 类型断言检查它操作对象的动态类型是否和断言类型匹配. ...

  10. redis的哨兵集群,自动切换主从库

    Redis-Sentinel是redis官方推荐的高可用性解决方案,当用redis作master-slave的高可用时,如果master本身宕机,redis本身或者客户端都没有实现主从切换的功能. 而 ...