AAT 发表于 2010-6-26 11:37:22

太花哨了,如果用nlint去检查肯定很多问题<br>
<br>
老老实实写吧,真正的设计中用到的verilog语言技巧是很少的,好的设计代码是很朴实的

ICE 发表于 2010-6-26 13:22:39

THANK YOU!

ANG 发表于 2010-6-26 15:15:11

建议还是麻烦一点,一条一条赋值;<br>
其他方式当然也可以,但是必定要增加多余的逻辑,而且会影响综合的关键路径<br>
使速度降低

AAT 发表于 2010-6-26 15:28:55

对,能人工做得还是自己做,给工具做不知道它长成什么样子。

AAT 发表于 2010-6-26 16:59:37

数组赋值使用变量,可能不利于综合,建议还是不要使用

interige 发表于 2010-6-26 17:30:11

always @(posedge clk) begin : block_1<br>
&nbsp;&nbsp;integer i;<br>
&nbsp;&nbsp;if (sp == 4)<br>
&nbsp; &nbsp; sp &lt;= 0;<br>
&nbsp;&nbsp;else begin<br>
&nbsp; &nbsp; for (i = 0; i &lt;= 23; i = i + 1)<br>
&nbsp; &nbsp;&nbsp; &nbsp;dout &lt;= din;<br>
&nbsp; &nbsp; sp &lt;= sp + 24;<br>
&nbsp;&nbsp;end<br>
end // block_1

FFT 发表于 2010-6-26 18:11:26

用for循环好了

ATA 发表于 2010-6-26 19:28:25

LZ&nbsp; &nbsp;想做什么呢?24位数据输入几次以后在256位一起输出?不过256又不是24的倍数。。。

CHAN 发表于 2010-6-26 20:42:07

仿真的时候可以这么写,拿去综合的话这样写不太好吧。

ups 发表于 2010-6-26 22:03:48

module tm(clk,din,dout);<br>
<br>
input clk;<br>
input din;<br>
output dout;<br>
<br>
reg dout;<br>
<br>
reg sp1;<br>
reg sp2;<br>
<br>
always@(posedge clk)<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if(sp==4)<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;begin<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; sp1 &lt;=0;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; sp2 &lt;=23;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;end<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;else<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;begin<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; dout&lt;=din;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; sp1 &lt;=sp1+24;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; sp2 &lt;= sp1 + 47;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; end<br>
<br>
endmodule<br>
<br>
<br>
<br>
试试这个呢
页: 1 [2] 3
查看完整版本: 问个verilog技巧