Parameterised dual-clock-domain asynchronous FIFO verified under UVM 1.2. Built for an IC verification engineer portfolio and interview use case.
参数化双时钟域异步 FIFO 在 UVM 1.2 下的验证平台,结构紧凑、面向数字 IC 验证求职与面试演示场景。
| Diagram / 图 | Purpose / 说明 |
|---|---|
| Architecture & Data Flow / 架构与数据流 | UVM component graph, data flow and reset event flow with Mermaid / Mermaid 绘制组件图、数据流、复位事件流 |
| Waveform Guide / 波形示例 | Asynchronous reset recovery Gantt and timing notes / 异步复位恢复 Gantt 与时序说明 |
| Source Map / 源码索引 | File-by-file role and key entry / 逐文件职责与关键入口 |
| Test / 测试 | Wr accepted | Wr guarded | Rd accepted | Rd guarded | Mismatches | Result |
|---|---|---|---|---|---|---|
fifo_basic_test |
16 | 37 | 16 | 37 | 0 | PASSED |
fifo_boundary_test |
16 | 19 | 16 | 19 | 0 | PASSED |
fifo_cdc_test |
26 | 4 | 16 | 9 | 0 | PASSED |
fifo_reset_test |
22 | 0 | 12 | 4 | 0 | PASSED |
- Environment / 环境:EDA Playground, Questa Sim-64 2025.2, UVM 1.2.
- Configuration / 配置:
DATA_WIDTH=8,FIFO_DEPTH=16,WR_CLK_PERIOD=10ns,RD_CLK_PERIOD=13ns. - All runs end with
UVM_ERROR=0andUVM_FATAL=0/ 所有用例无 error/fatal. - Pass criteria live in
docs/REGRESSION_RESULTS.md.
async_fifo_uvm/
|-- rtl/
| |-- async_fifo.sv # Gray-coded parameterised FIFO / Gray 码参数化 FIFO
| `-- sync_2ff.sv # Generic 2-FF synchronizer / 两级同步器
|-- tb/
| |-- top_tb.sv # Clocks, reset controller, run_test / 时钟、复位、入口
| |-- include/ # Interface, transaction, env, scoreboard, coverage
| |-- sequences/ # basic / boundary / cdc / reset / virt
| `-- tests/ # one UVM test per scenario / 每场景一测试
|-- edaplay/
| `-- testbench_onefile.sv # Verified one-file EDA Playground source / 单文件
|-- docs/
| |-- REGRESSION_RESULTS.md
| |-- SOURCE_MAP.md
| `-- assets/
| |-- ARCHITECTURE.md
| `-- WAVEFORM_GUIDE.md
|-- Makefile
|-- run.bat
|-- README.md
|-- .gitattributes
`-- .gitignore
- Select Questa Sim-64 2025.2 and UVM 1.2 / 选择 Questa 与 UVM 1.2。
- Leave the website
design.sveditor empty /design.sv留空。 - Paste all of
edaplay/testbench_onefile.svintotestbench.sv/ 将单文件全部粘贴至testbench.sv。 - Leave Compile Options empty / Compile Options 留空。
- Put one test argument in Run Options / 在 Run Options 选择测试:
+UVM_TESTNAME=fifo_basic_test
+UVM_TESTNAME=fifo_boundary_test
+UVM_TESTNAME=fifo_cdc_test
+UVM_TESTNAME=fifo_reset_test
If no argument is supplied, the top defaults to fifo_basic_test. A
successful run must show non-zero traffic, mismatches=0, [SB] PASSED,
UVM_ERROR=0, and UVM_FATAL=0 / 没有 +UVM_TESTNAME 时默认运行
fifo_basic_test,判据同上。
.\run.bat # default fifo_basic_test / 默认基础测试
.\run.bat fifo_boundary_test # boundary guard stress / 边界保护压测
.\run.bat fifo_cdc_test # cross-domain corners / 跨时钟域压测
.\run.bat fifo_reset_test # EventPool async reset / EventPool 异步复位make and make TEST=fifo_boundary_test are equivalent / 等效 Makefile 入口。
tb/include/fifo_types.svh is the single compile-time configuration point.
| Macro | Default | Meaning / 含义 |
|---|---|---|
DATA_WIDTH |
8 | FIFO payload width / 数据位宽 |
FIFO_DEPTH |
16 | FIFO depth, power of two / FIFO 深度,2 的幂 |
ADDR_W |
$clog2(FIFO_DEPTH) |
Derived address width / 派生地址位宽 |
WR_CLK_PERIOD |
10 ns | Write-domain period / 写时钟周期 |
RD_CLK_PERIOD |
13 ns | Read-domain period / 读时钟周期 |
Example Questa override / Questa 编译期覆写:
+define+DATA_WIDTH=16 +define+FIFO_DEPTH=32
The default 8×16 configuration has been fully regressed. Other combinations are source-supported but should be re-verified before being claimed in the resume / 默认配置已完成回归,其他组合需要额外回归后再写入简历。
-
fifo_seq_itemcarries direction, payload, and inter-transaction delay. -
fifo_drivernever readswr_full/rd_empty; it pushes every request so the DUT guard logic can be probed. -
fifo_monitorsamples per clock domain and labels every transaction as accepted or guarded. -
fifo_scoreboardmaintains a reference queue, compares registered read data after the NBA region, and clears the queue via EventPool on reset. -
fifo_coveragesamples cross product of data, count and guard flag. -
fifo_agent,fifo_env, andfifo_virtual_sequencerform the UVM hierarchy. -
fifo_seq_item携带方向、数据和事务间延迟。 -
fifo_driver不读取wr_full/rd_empty,所有请求都下发,便于测试 DUT 边界保护逻辑。 -
fifo_monitor按时钟域采样并打上guard_hit标签。 -
fifo_scoreboard维护参考队列,在 NBA 区后比较读数据,收到复位事件后 非阻塞清空队列。 -
fifo_coverage收集数据、计数、保护三者的功能覆盖率。 -
fifo_agent/fifo_env/fifo_virtual_sequencer组成标准 UVM 层次。
| Test / 测试 | Sequence | Scenario / 场景 | Guard Acceptance / 保护验收 |
|---|---|---|---|
fifo_basic_test |
fifo_basic_seq |
Streaming burst / 流式写读 | None / 无 |
fifo_boundary_test |
fifo_boundary_seq |
Excess write + excess read / 过量写读 | wr_guarded>0 AND rd_guarded>0 |
fifo_cdc_test |
fifo_cdc_seq |
Rate mismatch / 速率切换 | None / 无 |
fifo_reset_test |
fifo_reset_seq |
Mid-traffic async reset / 中途异步复位 | RESET_REQUEST/DONE observed / 事件可见 |
-
fifo_reset_seqtriggers globalEVT_RESET_REQUEST. -
top_tbis the sole owner of reset pins and asserts both resets. -
Reset deassertion happens on the negedge to avoid the sampling race.
-
The controller waits for both clock domains to recover, then triggers
EVT_RESET_DONEonce. -
The scoreboard's independent event-wait task clears the expected queue without blocking the analysis port.
-
fifo_reset_seq触发全局EVT_RESET_REQUEST。 -
top_tb独占复位引脚并下拉两侧复位。 -
复位在负边沿释放,避免采样竞争。
-
控制器等待两个时钟域恢复后只触发一次
EVT_RESET_DONE。 -
Scoreboard 独立任务非阻塞清空期望队列,不影响分析端口。
Both top-level variants dump top_tb.vcd to the simulator working
directory. The conceptual trace for the reset recovery window is in
docs/assets/WAVEFORM_GUIDE.md.
No third-party RTL is bundled. Add an explicit repository license before publishing or redistributing the project.
本仓库未附带任何第三方 RTL。在公开发布或分发之前,请补充仓库的明确许可声明。