随笔分类 - Scala
摘要:https://mp.weixin.qq.com/s/3uUIHW8DmisYARYmNzUZeg 介绍如何构建由模块组成的硬件模型。 1. 子模块 一个模块可以有一个或多个子模块,创建子模块时,需要使用Module(...)包裹: Module()实现如下: bc是一个call-by-
阅读全文
摘要:https://mp.weixin.qq.com/s/THqyhoLbbuXXAtdQXRQDdA 介绍构建硬件模型的Builder。 1. DynamicContext 动态上下文,供构建硬件模型时,存放上下文状态信息。 2. Builder Builder使用DynamicConte
阅读全文
摘要:https://mp.weixin.qq.com/s/fgCvIFt0RdEajhJVSy125w 介绍模块的输入输出端口的定义与管理。 1. _ports 1) 模块的输入输出端口,在BaseModule中管理: 2) 添加输入输出端口 使用IO(...)添加: 3) 使用 所有
阅读全文
摘要:https://mp.weixin.qq.com/s/w8NqM3GVlF0NydpsB65KPg 介绍创建模块顺序逻辑的connect命令。 0. 这里先简单对 "=" 和 ":="做一个讨论。 假设 a & b 的结果输出到一个匿名变量,记为anonymousVariable。 a & b的用法
阅读全文
摘要:https://mp.weixin.qq.com/s/YGTXky4wff7LXUphUxISQg 介绍创建模块判断逻辑的when命令。 1. when/elsewhen/otherwise 伴生对象when中的工厂方法,会创建一个WhenContext: WhenContext含有方法els
阅读全文
摘要:https://mp.weixin.qq.com/s/KkkqvekWHG6yrqwHUECRIw 介绍如何定义Wire/Reg/Memory/Prim。 1. DefWire Wire()表明内括的Data的容器为线,用法为: Wire()定义如下: a. 获取一个t的克隆x; b.
阅读全文
摘要:https://mp.weixin.qq.com/s/0ECca6XyFyEri0B4ckOZ4A 介绍UserModule类中,如何管理构建硬件模型所需的命令。 1. _commands private val _commands = ArrayBuffer[Command]() _comm
阅读全文
摘要:https://mp.weixin.qq.com/s/x6j7LZg7i7i_KcNEA8YCQw Chisel作为领域专用语言(DSL),用于构建硬件模型。待硬件模型建立后,再基于模型进行仿真、验证,以及转换。硬件模型可以转换为firrtl,也可以转换为verilog。 接下来介绍Chisel如何
阅读全文
摘要:https://mp.weixin.qq.com/s/F_08jKFMoX9Gf_J_YpsDpg 两个数据变量进行某个操作(op),产生一个输出,这个输出存在一个匿名变量中。这个匿名变量就是以OpBinding的形式绑定到hardware graph中的。 0. 这里先简单对 "=" 和 ":="
阅读全文
摘要:https://mp.weixin.qq.com/s/AxYlRtAXjd55eoGX5l1W-A 模块(Module)从输入端口(input ports)接收输入,经过内部实现的转换逻辑,从输出端口(output ports)输出。 在Chisel3中,模块的输入输出端口,通过IO(new Bun
阅读全文
摘要:https://mp.weixin.qq.com/s/NaInHsJgOwG03BLNF-wlxQ 介绍Module输入输出端口如何进行绑定。 1. IO() 在定义一个模块时,使用Bundle的匿名子类型来定义模块的输入输出端口,然后将其传递给IO()方法。 IO()方法定义在BaseMod
阅读全文
摘要:https://mp.weixin.qq.com/s/ENJVkz88sGgyODRNCu9jhQ 介绍Data类中的binding的定义和用法。 Binding stores information about this node's position in the hardware graph.
阅读全文
摘要:https://mp.weixin.qq.com/s/2318e6VJ4wFGpWwBOmTikA Chisel数据类型(Data)与Module的绑定关系,根据Data的使用方式不同,而有多种绑定类型。 参考链接: https://github.com/freechipsproject/chise
阅读全文
摘要:https://mp.weixin.qq.com/s/Jsy8P3m9W2EYKwneGVekiw 独热码相关的电路生成器。 参考链接: https://github.com/freechipsproject/chisel3/blob/master/src/main/scala/chisel3/ut
阅读全文
摘要:https://mp.weixin.qq.com/s/mO648yx4_ZRedXSWX4Gj2g 可以容纳不同类型的变量的向量。 参考链接: https://github.com/freechipsproject/chisel3/blob/master/src/main/scala/chisel3
阅读全文
摘要:https://mp.weixin.qq.com/s/TK1mHqvDpG9fbLJyNxJp-Q Mux相关电路生成器。 参考链接: https://github.com/freechipsproject/chisel3/blob/master/src/main/scala/chisel3/uti
阅读全文
摘要:https://mp.weixin.qq.com/s/g85Si6n37D9PYfR5hEoRQQ 实现一个查找逻辑。 参考链接: https://github.com/freechipsproject/chisel3/blob/master/src/main/scala/chisel3/util/
阅读全文
摘要:https://mp.weixin.qq.com/s/8lC8vQnBdKW9C39H0QFFkA 对数相关的辅助方法,Math通过软件方法实现,CircuitMath通过硬件方法实现。 参考链接: https://github.com/freechipsproject/chisel3/blob/m
阅读全文
摘要:https://mp.weixin.qq.com/s/DSdb4tmRwDTOki7mbyuu9A 实现16位线性反馈移位寄存器。可用于生成简单的伪随机数。 参考链接: https://github.com/freechipsproject/chisel3/blob/master/src
阅读全文
摘要:https://mp.weixin.qq.com/s/MQzX1Ned35ztz0vusPdkdQ 比特相关的操作。 参考链接: https://github.com/freechipsproject/chisel3/blob/master/src/main/scala/chisel3/util/B
阅读全文

浙公网安备 33010602011771号