• Chisel3


    https://mp.weixin.qq.com/s/rI-CJM6GyI6EUHPZ3uYiFg

     
    如同Verilog中的众多运算符,Chisel也针对自身的数据类型,提供了很多运算符。
     
    Chisel语言内嵌于Scala。在Scala中,基本上所有的运算符都被当做一般的字符,可以作为命名符号(identifier)的一部分。并且Scala支持省略函数调用时,括在参数两边的括号。所以Scala中定义运算符重载很简单,可以很大的提高代码的可读性。
     
     
    1. 运算符
     
    参考链接:
     
    a. Bitwise operators
     
     
    ~ & | ^ 这些其实都是方法名,如:
     
    b. Bitwise reductions
     
     
    c. Equality comparison.
     
     
    d. Shifts
     
     
    e. Bitfield manipulation
     
     
    f. Logical Operations
     
     
    g. Arithmetic operations
     
     
    h. Arithmetic comparisons
     
     
    2. 位宽推断
     
    两个相同类型但位宽不同的变量,也可以进行运算。运算参数以及运算结果的位宽会进行自动推断拓展。
     
    参考链接:
     
     
    Chisel provides bit width inference to reduce design effort. Users are encouraged to manually specify widths of ports and registers to prevent any surprises, but otherwise unspecified widths will be inferred by the Firrtl compiler.
    For all circuit components declared with unspecified widths, the FIRRTL compiler will infer the minimum possible width that maintains the legality of all its incoming connections. Implicit here is that inference is done in a right to left fashion in the sense of an assignment statement in chisel, i.e. from the left hand side from the right hand side. If a component has no incoming connections, and the width is unspecified, then an error is thrown to indicate that the width could not be inferred.
    For module input ports with unspecified widths, the inferred width is the minimum possible width that maintains the legality of all incoming connections to all instantiations of the module. The width of a ground-typed multiplexor expression is the maximum of its two corresponding input widths. For multiplexing aggregate-typed expressions, the resulting widths of each leaf subelement is the maximum of its corresponding two input leaf subelement widths. The width of a conditionally valid expression is the width of its input expression. For the full formal description see the Firrtl Spec.
  • 相关阅读:
    python3中Requests将verify设置为False后,取消警告的方式
    unicode编码转换中文_python
    base64编解码_python
    数据结构学习之二叉树
    springboot全能框架学习之旅
    数据结构之树
    经典的猴子分香蕉问题
    求n个数的排列
    三元运算的应用
    将正整数分解成质因数乘积
  • 原文地址:https://www.cnblogs.com/wjcdx/p/10053075.html
Copyright © 2020-2023  润新知