Merge dev to main. #1

Merged
xinb merged 5 commits from dev into main 2025-08-03 18:39:22 +00:00
10 changed files with 83 additions and 1 deletions
Showing only changes of commit 8f14f93d7e - Show all commits

View File

@ -1,3 +1,8 @@
# ic_com
数字芯片设计公共库
## 目录结构
- `lib/`核心功能模块如编码器、FIFO等
- `tb/`:各模块的仿真测试平台
- `doc/`:文档与使用说明

57
doc/README.md Normal file
View File

@ -0,0 +1,57 @@
# ic_com 库功能简介
## 目录结构
- `lib/`核心功能模块如编码器、FIFO等
- `tb/`:各模块的仿真测试平台
- `doc/`:文档与使用说明
## 主要功能模块
### 1. 编码/解码
- `enc_dec/oh_bin/oh2bin.sv`:参数化 one-hot 到二进制编码器,支持面积/频率优化,适用于高性能和低功耗场景。
### 2. FIFO
- `fifo/sync/fifo_sync.sv`同步FIFO支持参数化数据宽度和深度适合多场景缓存。
## 仿真与验证
- `tb/enc_dec/oh_bin/oh2bin_tb.sv`oh2bin编码器的时序仿真测试支持自动化验证。
- `tb/fifo/sync/fifo_sync_tb.sv`同步FIFO的功能仿真测试。
## 波形与调试
- 推荐使用VCS仿真支持FSDB波形输出便于使用Verdi/KDB调试。
## 快速仿真命令
见下方示例。
---
# VCS仿真命令示例
## 1. 生成.f文件文件列表
- 默认各模块`.f`文件需要配置环境变量`IC_COM_DIR`为仓库根目录。
- `lib.f`包含所有lib目录下的源文件
- `tb.f`包含所有tb目录下的测试平台文件
## 2. 推荐VCS命令含FSDB波形与KDB调试
```sh
vcs -full64 -sverilog -debug_access+all +v2k +vcs+lic+wait \
-f lib.f -f tb.f \
-l vcs.log \
-kdb \
+fsdbfile+${USER}_sim.fsdb \
+fsdb+autoflush \
+vcsd \
+vcs+dumpvars+all \
+vcs+fsdbon \
+notimingcheck \
+define+FSDB \
+define+KDB
```
- 默认fsdb文件名为`${USER}_sim.fsdb`,可自动区分不同用户仿真结果。
- 支持KDB调试推荐配合Verdi使用。
## 3. 运行仿真
```sh
./simv
```

4
doc/lib.f Normal file
View File

@ -0,0 +1,4 @@
// doc/lib.f: ic_com库所有心源文件,用各子库f
lib/enc_dec/oh_bin/oh_bin.f
lib/fifo/sync/sync.f

View File

@ -0,0 +1,2 @@
$IC_COM_DIR/lib/enc_dec/oh_bin/oh2bin.sv
$IC_COM_DIR/tb/enc_dec/oh_bin/oh2bin_tb.sv

2
doc/lib/fifo/sync/sync.f Normal file
View File

@ -0,0 +1,2 @@
$IC_COM_DIR/lib/fifo/sync/fifo_sync.sv
$IC_COM_DIR/tb/fifo/sync/fifo_sync_tb.sv

4
doc/tb.f Normal file
View File

@ -0,0 +1,4 @@
// doc/tb.f: ic_com库所有测平台文件,用各子库f
lib/enc_dec/oh_bin/oh_bin.f
lib/fifo/sync/sync.f

View File

@ -0,0 +1 @@
// 已合到 ../../../../lib/enc_dec/oh_bin/oh_bin.f

View File

@ -0,0 +1 @@
// 已合到 ../../../../lib/fifo/sync/sync.f

3
lib.f Normal file
View File

@ -0,0 +1,3 @@
// lib.f: ic_com库有核心源文
lib/enc_dec/oh_bin/oh2bin.sv
lib/fifo/sync/fifo_sync.sv

3
tb.f Normal file
View File

@ -0,0 +1,3 @@
// tb.f: ic_com库所测试平台文
tb/enc_dec/oh_bin/oh2bin_tb.sv
tb/fifo/sync/fifo_sync_tb.sv