Vdiff: A Program Differencing Algorithm for Verilog HDL
Christopher Spandikow IBM Corporation Miryung Kim The University of Texas at Austin Adam Duley ARM Inc
Vdiff: A Program Differencing Algorithm for Verilog HDL Adam Duley - - PowerPoint PPT Presentation
Vdiff: A Program Differencing Algorithm for Verilog HDL Adam Duley Christopher Spandikow Miryung Kim ARM Inc IBM Corporation The University of Texas at Austin Problem: Limitations of using diff on evolving hardware designs assumes sequential
Christopher Spandikow IBM Corporation Miryung Kim The University of Texas at Austin Adam Duley ARM Inc
always @(posedge clk) begin if(reset) begin fifo[1] <= 0;
end end // always
assign data_out = fifo[0];
+ always @(posedge clk) + begin + if (reset) + overrun <= 0; + end always @(posedge clk) begin if(reset) begin + fifo[0] <= 0; fifo[1] <= 0; + fifo[2] <= 0; end end // always assign data_out = fifo[0];
module uart_rfifo (clk, reset, data_out, overrun); always @(posedge clk) begin if(reset) begin fifo[1] <= 0; fifo[0] <= 0; end end // always always @(posedge clk) begin if (reset)
end // always assign data_out = fifo[0]; endmodule module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[1] if
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (run) always (fifo) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1]
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1] mapped LCS Match delete add
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1]
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1]
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1]
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1]
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1] mapped LCS Match delete add
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1] mapped LCS Match delete add
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1]
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1]
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1] mapped LCS Match delete add
uart_rfifo.v rev 87 uart_rfifo.v rev 88
module always (fifo) always (run) assign <=
if <= fifo[1] <= fifo[0] if module always (fifo) always (run) assign <=
if <= fifo[0] <= fifo[2] if <= fifo[1]
uart_rfifo.v rev 87-88 diff
module always (fifo) <= fifo[2] if Line 221, NB_ADD, A Non-Blocking assignment has been added
always @(posedge clk or negedge reset) A= clk | ! reset always @(negedge reset or posedge clk) B= !reset or clk
XOR
Syntactic Diff Window Textual Diff Window Change Type Classification
Project File Revisions Eval Vdiff |V∩E| Precision Recall Total (UART) 141 600 601 586 97.5% 97.7% Total (GateLib) 69 497 502 482 96.2% 96.9% Total 210 1097 1103 1068 96.8% 97.3%
counter_b <= 0x191;
counter_b <= 0x191;
A B B’ A’ 0.90 1.0 0.95 0.80
A B B’ A’ 0.90 1.0 0.95 0.80
A B B’ A’ 0.90 1.0 0.95 0.80
A B B’ A’ 0.90 1.0 0.95 0.80
– Mapped (1) modules to classes, (2) always blocks and continuous assignments to operations, (3) wires, registers, and ports to fields, and (4) modular instantiations to reference pointers in an EMF ecore model. – Results (Recall=47%, Precision=80%) shows a need to expand the Ecore model to be able to handle specific concurrency constructs and non-unique identifiers.
– At the time of our evaluation Sidiff did not provide APIs to allow us to map Verilog language constructs to their general differencing algorithms.
– [Yang 1992, Neamtiu et al. 2005, Fluri et al. 2007, Cottrell et al. 2007, Raghavan et al. 2004, etc.] – Vdiff is similar to these but identifies syntactic differences robustly even when multiple AST nodes have similar labels and when they are reordered.
– UMLdiff [Xing and Stroulia 2005], Sidiff [Kelter et al.] and EMF [Eclipse EMF]
– Change Distiller [Fluri et al. 2007] – Verilog change types [Sudakrishnan et al. 2009]
Vdiff website:
http://www.ece.utexas.edu/~miryung/software/Vdiff/web/index.html The authors thank Greg Gibeling and Dr. Derek Chiou for providing accesses to the RAMP repository and Dr. Adnan Aziz and anonymous reviewers for their detailed comments on our draft.