RTL Design Spec

本文详述了数字集成电路(IC)设计的RTL设计规范,涵盖功能描述、时序、状态机、流水线操作、接口协议等方面。通过自顶向下的模块划分,包括子模块如A2top_module_reg_intf的设计、测试及验证,同时阐述了测试用例的设置和仿真验证的重要性。

旨在总结工作和练习中常用的算法设计方法,以下框架遵循一个子系统的设计流程。


1. Function Description

按照:综述→时序/状态机/流水过程→寄存器→子功能→接口协议的框架介绍模块,必要时加入时序图、架构图

1.1. Overview

1.2. Timing / Finite State Machine / Pipeline Operation

1.3. Registers

1.4. Function1

1.5. Function2

1.6. Interface protocols

2. Feature List

列表描述要具备的功能和具体指标

● 使用APB接口接受数据,再采用SPI发送出去

● 时钟采用100MHZ

● 具备仲裁和时钟同步功能

● 可实现快速(100kbps)、高速(400kbps)和超速(1Mkbps)变化

3. Block Diagram

基于自顶向下的思路,划分为顶层模块和多个子模块,子模块包括寄存器模块、状态机控制模块、桥模块、其他子模块,作出架构图

下图中top_module_fsm用来对其他子模块进行控制、调度,以实现top_module的正确功能

当然有的架构不需要状态机

在这里插入图片描述

在这里插入图片描述

4. Interface Description

接口、参数描述

Group Signal Direction Width(bits) Description
rstn input 1 复位
clkinput1时钟
A_intfcmd1inputCMD_WIDTH命令1
rsp1outputRSP_WIDTH响应1
B_intf cmd2inputCMD_WIDTH命令2
rsp2outputRSP_WIDTH响应2
......input or output......

之后是需要配置的参数描述

Parameter Units Description
CMD_WIDTHbit命令位宽
RSP_WIDTHbit响应位宽
RSP_GRADEbit响应级别
VELOCITYbit per second执行速率
.........

5. Timing Description

5. Finite State Machine Description

绘制状态机图

在这里插入图片描述

6.3 Verilog 状态机
握手时序
RTL协议包拼凑
通用异步收发传输器(Universal Asynchronous Receiver/Transmitter,UART)
RTL仲裁器设计
RTL乒乓运算设计

State1

绘制State1下的时序图

例如

在这里插入图片描述

State2

State3

5. Pipeline Description

作出状态时序图,包括各状态下的逻辑、状态转移条件,并表明数据路径

例如下图,红色箭头表示数据从输入到输出经过的通路

图中的状态转换表示各组信号流水中的状态变换,并非整个模块的状态机变换。

每组信号的状态转移条件可能相同

在这里插入图片描述

绘制各状态下的时序图

在这里插入图片描述

6.3 Verilog RTL 级低功耗设计(上)
RTL乘法器IP设计
RTL协议包拼凑
RTL范围之外的两个最大值

5. Pingpong Description

待补充

RTL乒乓运算设计

(6. Register Description)

指示某种状态可适用寄存器,按照以下格式绘制

Offset Address Register Name Field(bits) Access Field Name Default Value Description
32'h0000_0000Receiver Buffer Register[0]RWValidity1'b0该寄存器内数据是否有效
[16:1]RWData16'd0缓存的数据
[31:17]RWReserved15'd0保留
32'h0000_0004Receiver Shift Register[7:0]W移位输出8‘d0’用于移位串行输出
[31:8]RWReserved'd0保留
32'h0000_0008Function Config Register[1:0]RW波特率控制2‘d02'd0表示100kbps、2'd1表示400kbps、2'd2表示1Mbps、2'd3表示3.4Mbps
[2]RWSCL仲裁开关'd00开启、1关闭
[3]RW寻址位数控制'd00为7bit寻址、1为10bit寻址
[5:4]RW充电时间控制'd0'd0为5ns,每增加'd1增加1ns等待时间
[31:6]RWReserved'd0保留

(7. Command Description)

产生某种控制可适用指令,按照以下格式绘制

一般在总线上的某个地址写入某个特定的数据以实现指令,Offset Address表示写地址,Command Code表示写数据,某些指令还需多次写配合完成,Dummy Clock表示该指令距离上一个指令的最小时钟周期。

Offset Address Name Command Code Min Dummy Clock Description
0xA0Software Enable Reset32'h66-Enable reset
Software Reset32'h990Starts to reset
0xA4Write Register Start32'h06-preprocessing command to configure registers
0xA8Fixing Data RAM Burst32'h02h-Starts to write fixing data RAM
32bit RAM address10Burst start position in RAM
32bit RAM data0First data in RAM
...0data in RAM

8. Submodule Design

子模块设计,注意要遵循由外到内的顺序设计

8.1. A2top_module_reg_intf

8.1.1. Function Description

8.1.2. Feature List

8.1.3. Block Diagram

7.1.4. Timing Description/FSM Description/Pipeline Description/Pingpong Description

8.1.5. Interface Description

8.1.6. RTL coding

8.1.7. Testbench coding

8.1.8. Verification

8.2. Submodule_D

8.3. top_module_reg

8.4. Submodule_C

8.5. Submodule_B

9. RTL coding


module name(
	rstn,
	clk,
	...,
	...
	);
	
	
	//------------------------------------------------------------------------------------------
	// parameter declaration
	//------------------------------------------------------------------------------------------
	
	parameter ...;
	
	localparam ...;

	//------------------------------------------------------------------------------------------
	// ports declaration
	//------------------------------------------------------------------------------------------
	
	input 						rstn,
	input 						clk,
	
	//signals group 
	input						...;
	output						...;
	
	//signals group 
	input						...;
	output						...;
	
	//signals group 
	input						...;
	output						...;
	
	//------------------------------------------------------------------------------------------
	// blocks instructions...
	//------------------------------------------------------------------------------------------
	
	wire			...;
	reg				...;	
	
	assign ... = ...;
	assign ... = ...;
	assign ... = ...;
	
	//------------------------------------------------------------------------------------------
	// blocks instructions...
	//------------------------------------------------------------------------------------------
	
	wire			...;
	reg				...;
	
	always@(posedge clk or negedge rstn) begin
		if(!rstn)
			...
		else if(...)
			...
	end

	//------------------------------------------------------------------------------------------
	// blocks instructions...
	//------------------------------------------------------------------------------------------
	
	wire			...;
	reg				...;
	
	module_name#(
	.parameter_one 			(64					),				
	.parameter_two 			(64					),
	.parameter_three 		(64					)				
	)instance_name(
	.rstn 			(arstn && rst_fifo			),
	
	.wclk 			(aclk						),
	.wr_en 			(wr_en_sample_D_FIFO		),
	.wdata 			(wdata_sample_D_FIFO		),
	
	.rclk 			(aclk						),
	.rd_en 			(rd_en_sample_D_FIFO		),
	.rdata 			(rdata_sample_D_FIFO		),
	.valid 			(rdata_val_sample_D_FIFO	),
	
	.full 			(							),
	.pfull 			(							),
	.empty 			(							)
	);
	
endmodule

RTL coding

10. Testbench coding

(10.1. Python reference model)

12. Verification

根据第1节功能描述部分,设计测试用例case,进行仿真验证,并收取覆盖率等信息。

11.1. case1

11.2. case2

11.3. case3

先对该verify case进行语言描述,然后给出输入输出、parameter的设定情况,再给出波形图和log信息,最后总结

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Starry丶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值