Chisel 教程翻译 之 本书目录《Digital Design with Chisel》

 

Contents
内容
Foreword xi

Preface xiii
前言

1 Introduction 1
第一章: 概述

1.1 Installing Chisel and FPGA Tools . . . . . . . . . . . . . . . . . . . . 2
1.1 安装Chisel和FPGA Tools
1.1.1 macOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.1 MacOS上的方法
1.1.2 Linux/Ubuntu . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.2 Linux/Ubuntu上的方法
1.1.3 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.3 Windows上的方法
1.1.4 FPGA Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.4 FPGA Tools
1.2 Hello World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 第一个程序:Hello World
1.3 Chisel Hello World . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Chisel的Hello World
1.4 An IDE for Chisel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 支持Chisel的一个IDE
1.5 Source Access and eBook Features . . . . . . . . . . . . . . . . . . . . 5
1.5 源的访问和电子书的特点
1.6 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 进一步阅读
1.7 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.7 练习
2 Basic Components 9
第二章:基本组件

2.1 Signal Types and Constants . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1 信号类型和常量
2.2 Combinational Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 组合电路
2.2.1 Multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.1 多路器
2.3 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3 寄存器
2.3.1 Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3.1 计数
2.4 Structure with Bundle and Vec . . . . . . . . . . . . . . . . . . . . . . 15
2.4 Bundle和Vec的应用
2.5 Chisel Generates Hardware . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5 Chisel产生电路
2.6 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.6 练习
3 Build Process and Testing 21
第三章:一个Chisel程序的构建流程与测试

3.1 Building your Project with sbt . . . . . . . . . . . . . . . . . . . . . . 21
3.1 用SBT构建你的项目
3.1.1 Source Organization . . . . . . . . . . . . . . . . . . . . . . . 21
3.1.1 源代码的组织
3.1.2 Running sbt . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.1.2 运行sbt
3.1.3 Tool Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.1.3 运行Chisel的工具流
3.2 Testing with Chisel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2 测试Chisel程序
3.2.1 PeekPokeTester . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2.1 Chisel的Test Benches: PeekPokeTester
3.2.2 Using ScalaTest . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.2.2 使用ScalaTest
3.2.3 Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.2.3 波形测试
3.2.4 printf Debugging . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2.4 打印调试
3.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.3 练习
3.3.1 A Minimal Project . . . . . . . . . . . . . . . . . . . . . . . . 32
3.3.1 一个最小的项目
3.3.2 A Testing Exercise . . . . . . . . . . . . . . . . . . . . . . . . 34
3.3.2 一个测试练习
4 Components 35
第四章:组件

4.1 Components in Chisel are Modules . . . . . . . . . . . . . . . . . . . . 35
4.1 Chisel中的组件时模块
4.2 An Arithmetic Logic Unit . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2 一个算术逻辑单元
4.3 Bulk Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.3 体连接符
4.4 Lightweight Components with Functions . . . . . . . . . . . . . . . . . 41
4.4 用函数表示轻量硬件组件

5 Combinational Building Blocks 43
第五章:组合电路设计

5.1 Combinational Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.1 组合电路
5.2 Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2 解码器
5.3 Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.3 编码器
5.4 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.4 练习

6 Sequential Building Blocks 49
第六章:时序电路设计

6.1 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.1 寄存器
6.2 Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.2 计数器
6.2.1 Counting Up and Down . . . . . . . . . . . . . . . . . . . . . 54
6.2.1 计数的增减
6.2.2 Generating Timing with Counters . . . . . . . . . . . . . . . . 55
6.2.2 计数器循环定时
6.2.3 The Nerd Counter . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2.3 美丽心灵计数器
6.2.4 A Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.2.4 一个定时器
6.2.5 Pulse-Width Modulation . . . . . . . . . . . . . . . . . . . . . 58
6.2.5 脉冲宽度调制
6.3 Shift Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.3 移位寄存求
6.3.1 Shift Register with Parallel Output . . . . . . . . . . . . . . . . 61
6.3.1 并行输出移位寄存器
6.3.2 Shift Register with Parallel Load . . . . . . . . . . . . . . . . . 62
6.3.2 并行加载移位寄存器
6.4 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.4 存储器
6.5 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.5 练习
7 Input Processing 69
第七章:输入处理

7.1 Asynchronous Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.1 异步输入
7.2 Debouncing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
7.2 消除抖动
7.3 Filtering of the Input Signal . . . . . . . . . . . . . . . . . . . . . . . . 72
7.3 过滤输入信号
7.4 Combining the Input Processing with Functions . . . . . . . . . . . . . 73
7.4 用函数表示输入处理
7.5 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.5 练习
8 Finite-State Machines 77
第八章:有限状态机

8.1 Basic Finite-State Machine . . . . . . . . . . . . . . . . . . . . . . . . 77
8.1 基本的有限状态机
8.2 Faster Output with a Mealy FSM . . . . . . . . . . . . . . . . . . . . . 81
8.2 用一个Mealy FSM实现更快速的输出
8.3 Moore versus Mealy . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
8.3 Moore 与 Mealy对比
8.4 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
8.4 练习
9 Communicating State Machines 89
第九章:通信状态机

9.1 A Light Flasher Example . . . . . . . . . . . . . . . . . . . . . . . . . 89
9.1 一个闪光灯示例
9.2 State Machine with Datapath . . . . . . . . . . . . . . . . . . . . . . . 94
9.2 与数据通路协同的状态机
9.2.1 Popcount Example . . . . . . . . . . . . . . . . . . . . . . . . 94
9.2.1 记跳示例
9.3 Ready-Valid Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
9.3 Valid/Ready握手接口
10 Hardware Generators 103
第十章:硬件生成

10.1 Configure with Parameters . . . . . . . . . . . . . . . . . . . . . . . . 103
10.1 用参数配置
10.1.1 Simple Parameters . . . . . . . . . . . . . . . . . . . . . . . . 103
10.1.1简单参数
10.1.2 Functions with Type Parameters . . . . . . . . . . . . . . . . . 104
10.1.2 带类型参数的函数
10.1.3 Modules with Type Parameters . . . . . . . . . . . . . . . . . . 105
10.1.3 带类型参数的模块
10.1.4 Parameterized Bundles . . . . . . . . . . . . . . . . . . . . . . 106
10.1.4 参数化的Bundle类
10.2 Generate Combinational Logic . . . . . . . . . . . . . . . . . . . . . . 107
10.2 生成组合逻辑
10.3 Use Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
10.3 使用继承
11 Example Designs 115
第十一章:一些设计例子

11.1 FIFO Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
11.1 FIFO 缓冲
11.2 A Serial Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
11.2 一个串行端口
11.3 FIFO Design Variations . . . . . . . . . . . . . . . . . . . . . . . . . . 125
11.3 FIFO设计变种
11.3.1 Parameterizing FIFOs . . . . . . . . . . . . . . . . . . . . . . 125
11.3.1 参数化的FIFOs
11.3.2 Redesigning the Bubble FIFO . . . . . . . . . . . . . . . . . . 126
11.3.2 重新设计 Bubble FIFO
11.3.3 Double Buffer FIFO . . . . . . . . . . . . . . . . . . . . . . . 128
11.3.3 双缓冲FIFO
11.3.4 FIFO with Register Memory . . . . . . . . . . . . . . . . . . . 130
11.3.4 带寄存器存储的FIFO
11.3.5 FIFO with On-Chip Memory . . . . . . . . . . . . . . . . . . . 132
11.3.5 带片内存储的FIFO
11.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
11.4 练习
11.4.1 Explore the Bubble FIFO . . . . . . . . . . . . . . . . . . . . . 135
11.4.1 探索Bubble FIFO
11.4.2 The UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
11.4.2 UART
11.4.3 FIFO Exploration . . . . . . . . . . . . . . . . . . . . . . . . . 137
11.4.3 FIFO探索
12 Design of a Processor 139
第十二章:处理器设计

12.1 Start with an ALU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
12.1 从一个ALU开始设计
12.2 Decoding Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
12.2 解码指令
12.3 Assembling Instructions . . . . . . . . . . . . . . . . . . . . . . . . . 145
12.3 汇编指令
12.4 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
12.4 练习
13 Contributing to Chisel 149
第十三章:加入Chisel的进化

13.1 Setup the Development Environment . . . . . . . . . . . . . . . . . . . 149
13.1 设置开发环境
13.2 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
13.2 测试
13.3 Contribute with a Pull Request . . . . . . . . . . . . . . . . . . . . . . 150
13.3 用Pull Request 组织贡献代码
13.4 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
13.4 练习
14 Summary 153
14 总结
A Chisel Projects 155
A 使用Chisel的开源项目
B Chisel 2 157
B 如何把Chisel 2项目迁移到Chisel 3
Bibliography 161
参考文献
Index 16
术语的索引

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值