介绍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. 王颖奇 20171010129《面向对象程序设计(java)》第十四周学习总结

    实验十四  Swing图形界面组件 理论知识知识点: 1.Swing和MVC设计模式2.布局管理器3.文本输入4.选择组件5.菜单6.对话框 实验时间 2018-11-29 1.实验目的与要求 (1) ...

  2. 关于51单片机IO引脚的驱动能力与上拉电阻设计方案

    转载自:http://bbs.dianyuan.com/article/20312-2 单片机的引脚,可以用程序来控制,输出高.低电平,这些可算是单片机的输出电压.但是,程序控制不了单片机的输出电流. ...

  3. [hdu5360]贪心

    题意:一个人想邀请n个人出去玩,假设当前同意和他一起去的人数为cnt,那么他去邀请i的时候,i同意的条件是L[i]<=cnt<=R[i],L[i],R[i]是给定的,问怎样安排邀请顺序,使 ...

  4. layui批量传值到后台操作时出现传值为空的问题

    如图,前台的样子,data的参数为 [ {"good_id":1,"good_name":"标样-总磷","good_num&qu ...

  5. 「从零单排HBase 12」HBase二级索引Phoenix使用与最佳实践

    Phoenix是构建在HBase上的一个SQL层,能让我们用标准的JDBC APIs对HBase数据进行增删改查,构建二级索引.当然,开源产品嘛,自然需要注意“避坑”啦,阿丸会把使用方式和最佳实践都告 ...

  6. percona 5.6的安装

    yum 安装, 1 如果已经安装过mysql 的东西,先卸载了.yum remove mysql* 包括 /etc/my.cnf 这个东西卸载的时候不会删除. mv /etc/my.cnf /etc/ ...

  7. 旧版flexbox局部填坑

    本来昨晚要写一篇react的小笔记,恰好同学小聚的时候附近有个ios维修,把我的4s拿去修好,早上用我还是ios5.1系统的4s打开自己的页面,发现flexbox布局的部分是乱的,眼前一黑. what ...

  8. 3.8 Go Array数组

    3.8 Go Array数组 数组是固定长度的特定类型元素组成的序列. 一个数组由零或多个相同类型元素组成. 数组的长度是固定,因此Go更常用Slice(切片,动态增长或收缩序列). 数组是值类型,用 ...

  9. Hyperledger Fabric开发(二):创建网络

    运行fabric-samples项目中的一个例子:first-network,创建第一个网络(Building Your First Network). 该网络共有4个peer节点,划分为2个组织(o ...

  10. 【python爬虫】scrapy入门8:发送POST请求

    scrapy基础知识之发送POST请求与使用 FormRequest.from_response() 方法模拟登陆 https://blog.csdn.net/qq_33472765/article/ ...