介绍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. LeetCode--LinkedList--203. Remove Linked List Elements(Easy)

    203. Remove Linked List Elements(Easy) 题目地址https://leetcode.com/problems/remove-linked-list-elements ...

  2. 字节码编程,Javassist篇一《基于javassist的第一个案例helloworld》

    作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 目录 @ 目录 目录 一.前言 二.开发环境 三.案例目标 四.技术实现 五.测试结果 1. ...

  3. 排序算法整理(Python实现)

    目录 1. 冒泡排序 2. 选择排序 3. 插入排序 4. 归并排序 5. 快速排序 1. 冒泡排序   冒泡排序(Bubble Sort)是稳定排序,其基本思想是:遍历待排序列,依次两两比较,如果顺 ...

  4. 搞懂js中小数运算精度问题原因及解决办法

    js小数运算会出现精度问题 js number类型 JS 数字类型只有number类型,number类型相当于其他强类型语言中的double类型(双精度浮点型),不区分浮点型和整数型. number类 ...

  5. .Net Core3.0 WebApi 项目框架搭建 二:API 文档神器 Swagger

    .Net Core3.0 WebApi 项目框架搭建:目录 为什么使用Swagger 随着互联网技术的发展,现在的网站架构基本都由原来的后端渲染,变成了:前端渲染.后端分离的形态,而且前端技术和后端技 ...

  6. 关于react的一些总结

    之前为了学习redux买了一本<深入浅出react和redux>,只看了redux部分.最近重新一遍,还是很有收获,这里结合阅读文档时的一些理解,记下一些初学者可能不太注意的东西. 原则: ...

  7. P5410 【模板】扩展 KMP

    P5410 [模板]扩展 KMP #include<bits/stdc++.h> using namespace std; ; int q, nxt[maxn], extend[maxn] ...

  8. Djano之ORM多表查询操作

    # 把 model 转化为 迭代器去循环 MODEL.objects.all().iterator() # 等同于 values, values_list, 但是 only 这种方式 获取字段属性依旧 ...

  9. DPDK LPM库(学习笔记)

    1 LPM库 DPDK LPM库组件为32位的key实现了最长前缀匹配(LPM)表查找方法,该方法通常用于在IP转发应用程序中找到最佳路由匹配. 2 LPM API概述 LPM组件实例的主要配置参数是 ...

  10. Postgres基础操作

    显示数据库\l \l+ dw=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ...