好像很多人的coding style都不一样
比如
sel[1:0]==0时选in0
sel[1:0]==1时选in1
sel[1:0]==2时选in2
sel[1:0]==3时无意义
风格1,这种最安全
case(sel)
0: out=in0;
1: out=in1;
2: out=in2;
default: out =0;
endcase
风格2,这种综出来最优化,但会有x
case(sel)
0: out=in0;
1: out=in1;
2: out=in2;
default: out ='bx;
endcase
风格3,这种综出来最优化,但仿真和综合结果不一致
case(sel) //synopsys full_case
0: out=in0;
1: out=in1;
2: out=in2;
endcase
风格4,这种好像也不是最优化的
out =
sel==0 & in0 |
sel==1 & in1 |
sel==2 & in2;
--
修改:Xaoyao FROM 101.87.111.*
FROM 101.87.111.*