Verilog 数字 VLSI 设计教程 Lab02 详细流程
Verilog 数字 VLSI 设计教程 Lab02 文件夹原来文件内容如下,现在稍微对其进
行改动
该实验包括两部分:Vector 和 Extend
(1)先开始第一部分的实验,修改 Vector.v,补充 display,打印出来,便于发
现规则
(2)编写 Makefile
(3)编写 README,方便比对信息,将 RTL 代码和 README 及打印信息,进行比
对。
(4)运行代码,make
(5)make 后文件夹多出几个文件
(6)结果保存在 sim.log
(7)总结第一部分 Vector 的实验
先 vim sim.log,再:vs Vector.v 可使两个文本分屏显示
Vector 矢量,字面意思是有方向的。
$time: simulation time
An initial block is procedural and thus is not allowed to assign to a wire -- only to
a reg or integer
assign: left signal only to a wire, and right signal is allow to reg or wire
If ports not declare, they are wire by default
%0t ==>$time
reg, wire all of them can part vector select
such as: reg[0:15] MyBus ==> MyBus[0:2]
wire[15:0] mybus ==> mybus[10:8]
MyBus[0:2]=mybus[10:8], 只要位数一致,就可以等于
MSB always on the left, despite reg [0:15]MyBus or wire [15:0]mybus
MyBus=mybus,可以作为一个整体,只要位数一致,就可以等于
MyBus[15:0] is illegal
MyBus[0:15]=mybus[15:0]跟 MyBus=mybus 一样,
即 MyBus[0:15]=mybus[15:0] <==>MyBus=mybus
%0b:前边为 0 的不打印
%b:全长度打印
Initial 不可以被综合工具综合
`bz:进行长度扩展
1`bz:最后一位为 z,其他用 0 补齐长度
(8)进行实验第二部分,先 make clean 清除第一部分的文件,再修改 Extend.v,
(9)不需要修改 Makefile,运行代码 make RTL=Extend.v
(10)其实第二部分扩展在第一部分也涉及,不再赘述