Skip to content

RV32I 处理器:全定制 datapath 与物理实现

Virtuoso 手绘的 bit-sliced RV32I datapath,基于 FreePDK45 走完 Design Compiler 和 Innovus 流程,集成 32 个定制的 register file macro。

Physical Design RTL Virtuoso Innovus RISC-V
Contents

项目简介

  • 一颗混合方式实现的 RV32I 处理器:在 Cadence Virtuoso 中手绘 full-custom cell,再用 Design Compiler 综合、Innovus 布局布线,基于开源的 FreePDK45 PDK。
  • Datapath 是单周期、bit-sliced 的。一个定制的 bitslice cell 包含整个 datapath 的第 i 位:register file、ALU、comparator、PC、shifter 和 mux。32 位 CPU 就是把这个 cell 平铺 32 次。
  • 课程分四个 MP 依次完成:mp_intro → mp_stdcell → mp_datapath → mp_pnr,下面按这个顺序列出。

mp_intro:inverter 和 buffer

  • 在 Virtuoso 中画 inverter 和 buffer 的 schematic、layout 和 symbol,仿真、DRC 和 LVS 全部通过。
  • 两个 cell 高 1.4425 µm:inverter 宽 0.5875 µm,buffer 宽 1.6675 µm。

inverter 和 buffer 的 schematic 与 layout,buffer 由两级 inverter 组成

mp_stdcell:standard cell library

  • 共 13 个 standard cell:inv、buf、nand2、nor2、and2、or2、aoi21、oai21、xor2、xnor2、mux2、latch、dff。分两次检查:第一次 inv、nand2、nor2,第二次其余 10 个。
  • 13 个 cell 全部通过仿真、DRC 和 LVS。Cell 统一高 1.6 µm(上限 1.8 µm),面积都在各自的上限以内;最窄的 inv 宽 0.37 µm,最宽的 dff 宽 3.8575 µm。

inv、buf、nand2、nor2、and2、or2:每个 cell 上面是 schematic,下面是 layout

aoi21、oai21、xor2、xnor2、mux2:每个 cell 上面是 schematic,下面是 layout

latch 和 dff:每个 cell 上面是 schematic,下面是 layout;三张图里的 layout 是同一比例

mp_datapath:full-custom datapath

Checkpoint 1:ALU 和 register file

  • 一位 ALU(6.4125 µm × 3.0 µm)和 register file 的一位(137.805 µm × 2.175 µm)通过仿真、DRC 和 LVS。
  • 32 × 32 的 2R1W register file 按位拆分:一个 macro 存放全部 32 个寄存器的同一位,由 transmission-gate latch 搭成,共 101 个 pin。Macro 附带 Liberty 和 LEF view,布局布线时作为 hard macro 处理。

一位 ALU 的 schematic 与 full-custom layout

register file 一位的 schematic 与 layout:一行 32 个 REG_BIT,每个是一个寄存器的这一位;layout 只截了左端

Checkpoint 2:32 位 datapath

  • 每个 datapath cell 都有 schematic、layout 和 symbol;full-custom cell 和整个 datapath 均通过 Calibre DRC/LVS。
  • 32 个 bitslice 平铺成完整的 datapath,layout 184.74 µm × 89.8 µm,整体仿真通过。

PC incrementer 的 full-custom layout

32 位 datapath 的 layout:每行一个 bitslice,左边约四分之三是 register file,右边是 ALU 等逻辑

mp_pnr:综合与布局布线

  • 同一份 RTL 有两个布局布线版本:一版只用 standard cell(6,933 个 instance,利用率约 80%);另一版用 32 个 register file macro 替换 1,024 个 flip-flop,die 尺寸 180 µm × 140 µm。
  • Macro 比 standard cell row 要高。第一版边界沿用了 standard cell 的 rail 约定,切掉了 macro 的 LEF pin,产生 778 个违例;按 macro 的完整高度重画边界后问题解决。
  • 电源的 special route 在 macro 边缘留下一小块低于最小尺寸的 metal1,router 无法修复。去掉这一步 special route、改由每行自带的 power rail 给 macro 供电后,违例消除。
  • 最终结果:Innovus verify_drc 零违例。

同一颗 CPU 只用 standard cell 的版本

在 Innovus 中完成布线的最终 CPU,含定制的 register file macro

Discussion

Loading comments…

Checking sign-in…