本帖最后由 Timme 于 2013-6-23 10:43 编辑
========= Test Case 3. Sequential Optimization Test =========
本例子主要测试跨寄存器的优化能力,在本例子的RTL中描述了一段完全Dummy的电路,不过需要跨寄存器才能识别:
- module seq_opt(input clk,dat_i,output reg dat_o);
- reg dat_buf,dat_buf2,dat_buf2n;
- always@(posedge clk) dat_buf <= dat_i;
- always@(posedge clk) dat_buf2 <= dat_buf;
- always@(posedge clk) dat_buf2n <= ~dat_buf;
- always@(posedge clk) dat_o <= dat_buf2 | dat_buf2n;
- endmodule
复制代码
在SDC/XCF/UCF中声明了clk是频率为1GHz的时钟。
Synplify综合结果如下,电路被完全优化掉:
- @W:CL169 : seq_opt.v(6) | Pruning register dat_buf2
- @W:CL169 : seq_opt.v(7) | Pruning register dat_buf2n
- @W:CL169 : seq_opt.v(5) | Pruning register dat_buf
- @W:CL189 : seq_opt.v(8) | Register bit dat_o is always 1, optimizing ...
- @W:CL159 : seq_opt.v(1) | Input clk is unused
- @W:CL159 : seq_opt.v(1) | Input dat_i is unused
复制代码
Quartus综合结果如下,电路也被完全优化掉。注意如果去掉第一级dat_buf,Quartus就不会进行优化了;这种行为更为安全,不会把鉴相器之类的电路优化掉:
- Register Reason for Removal Register Causing Removal
- dat_buf2n Merged with dat_buf2
- dat_buf2 Lost fanout
- dat_buf Lost fanout dat_buf2
- dat_o~reg0 Stuck at VCC due to stuck port data_in
复制代码
ISE只有打开Register Balancing时才能把电路优化掉(但其实这并不是一个Retiming相关的功能):
- WARNING:Xst:2677 - Node <dat_buf> of sequential type is unconnected in block <seq_opt>.
复制代码
Vivado完整的保留了电路:
- Location Delay type Incr(ns) Path(ns) Netlist Resource(s)
- --------------------------------------------------- -------------------
- (clock clk rise edge) 0.000 0.000 r
- N13 0.000 0.000 r clk
- net (fo=0) 0.000 0.000 clk
- N13 IBUF (Prop_ibuf_I_O) 1.012 1.012 r clk_IBUF_inst/O
- net (fo=1, routed) 2.016 3.028 clk_IBUF
- BUFGCTRL_X0Y0 BUFG (Prop_bufg_I_O) 0.096 3.124 r clk_IBUF_BUFG_inst/O
- net (fo=4, routed) 1.722 4.846 clk_IBUF_BUFG
- SLICE_X5Y54 r dat_buf2n_reg/C
- --------------------------------------------------- -------------------
- SLICE_X5Y54 FDRE (Prop_fdre_C_Q) 0.456 5.302 r dat_buf2n_reg/Q
- net (fo=1, routed) 0.280 5.582 dat_buf2n
- SLICE_X4Y54 LUT2 (Prop_lut2_I0_O) 0.124 5.706 r dat_o_reg_i_1/O
- net (fo=1, routed) 0.000 5.706 n_0_dat_o_reg_i_1
- SLICE_X4Y54 FDRE r dat_o_reg/D
复制代码 |