Skip to main content
Log in

Vdiff: a program differencing algorithm for Verilog hardware description language

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

During code review tasks, comparing two versions of a hardware design description using existing program differencing tools such as diff is inherently limited because these tools implicitly assume sequential execution semantics, while hardware description languages are designed to model concurrent computation. We designed a position-independent differencing algorithm to robustly handle language constructs whose relative orderings do not matter. This paper presents Vdiff, an instantiation of this position-independent differencing algorithm for Verilog HDL. To help programmers reason about the differences at a high-level, Vdiff outputs syntactic differences in terms of Verilog-specific change types. The quantitative evaluation of Vdiff on two open source hardware design projects shows that Vdiff is very accurate, with overall 96.8 % precision and 97.3 % recall when using manually classified differences as a basis of comparison. Vdiff is also fast and scalable—it processes the entire revision history of nine open projects all under 5.35 minutes. We conducted a user study with eight hardware design experts to understand how the program differences identified by the experts match Vdiff’s output. The study results show that Vdiff’s output is better aligned with the experts’ classification of Verilog changes than an existing textual program differencing tool.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Algorithm 1
Function
Function
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13

Similar content being viewed by others

Notes

  1. http://opencores.org and http://ramp.eecs.berkeley.edu.

References

  • Apiwattanapong, T., Orso, A., Harrold, M.J.: A differencing algorithm for object-oriented programs. In: ASE ’04, pp. 2–13. IEEE Comput. Soc., Washington (2004)

    Google Scholar 

  • Ashenden, P.J.: Vhdl-200x: The next revision. IEEE Des. Test Comput. 20(3), 112–113 (2003)

    Google Scholar 

  • Canfora, G., Cerulo, L., Penta, M.D.: Tracking your changes: A language-independent approach. IEEE Softw. 26, 50–57 (2009)

    Article  Google Scholar 

  • Cormen, T.H., Leiserson, C.E., Rivest, R.L.: Introduction to Algorithms. McGraw-Hill, New York (2001)

    MATH  Google Scholar 

  • Cottrell, R., Chang, J.J.C., Walker, R.J., Denzinger, J.: Determining detailed structural correspondence for generalization tasks. In: ESEC-FSE ’07, pp. 165–174. ACM, New York (2007)

    Chapter  Google Scholar 

  • Cottrell, R., Walker, R.J., Denzinger, J.: Semi-automating small-scale source code reuse via structural correspondence. In: Proceedings of the 16th ACM SIGSOFT International Symposium on Foundations of Software Engineering, SIGSOFT ’08/FSE-16, pp. 214–225. ACM, New York (2008)

    Chapter  Google Scholar 

  • Dice, L.R.: Measures of the amount of ecologic association between species. Ecology 26(3), 297–302 (1945)

    Article  Google Scholar 

  • Duley, A., Spandikow, C., Kim, M.: Vdiff download. http://users.ece.utexas.edu/~miryung/software/Vdiff.html

  • Eclipse EMF Compare Project description: http://www.eclipse.org/emft/projects/compare

  • Fluri, B., Würsch, M., Pinzger, M., Gall, H.C.: Change distilling—tree differencing for fine-grained source code change extraction. IEEE Trans. Softw. Eng. 33(11), 18 (2007)

    Article  Google Scholar 

  • Gupta, V., Pratt, V.: Gates accept concurrent behavior. In: Annual IEEE Symposium on Foundations of Computer Science, pp. 62–71 (1993)

    Google Scholar 

  • Hunt, J.W., Szymanski, T.G.: A fast algorithm for computing longest common subsequences. Commun. ACM 20(5), 350–353 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  • Lahiri, S.K., Vaswani, K., Hoare, C.A.R.: Differential static analysis: opportunities, applications, and challenges. In: Proceedings of the FSE/SDP Workshop on Future of Software Engineering Research, FoSER ’10, pp. 201–204. ACM, New York (2010)

    Chapter  Google Scholar 

  • Malpohl, G., Hunt, J.J., Tichy, W.F.: Renaming detection. Autom. Softw. Eng. 10(2), 183–202 (2000)

    Article  Google Scholar 

  • Myers, E.W.: An o(nd) difference algorithm and its variations. Algorithmica 1, 251–266 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  • Neamtiu, I., Foster, J.S., Hicks, M.: Understanding source code evolution using abstract syntax tree matching. In: MSR’05, pp. 2–6 (2005)

    Google Scholar 

  • Ohst, D., Welle, M., Kelter, U.: Difference tools for analysis and design documents. In: ICSM ’03, p. 13. IEEE Comput. Soc., Washington (2003)

    Google Scholar 

  • Opencore. http://opencores.org

  • Person, S., Dwyer, M.B., Elbaum, S., Pǎsǎreanu, C.S.: Differential symbolic execution. In: SIGSOFT ’08/FSE-16, pp. 226–237. ACM, New York (2008)

    Chapter  Google Scholar 

  • Raghavan, S., Rohana, R., Leon, D., Podgurski, A., Augustine, V.: Dex: A semantic-graph differencing tool for studying changes in large code bases. In: ICSM ’04, pp. 188–197. IEEE Comput. Soc., Washington (2004)

    Google Scholar 

  • Ramp. http://ramp.eecs.berkeley.edu

  • Reiss, S.P.: Tracking source locations. In: ICSE ’08, pp. 11–20. ACM, New York (2008)

    Google Scholar 

  • Rich, D.I.: The evolution of SystemVerilog. IEEE Des. Test Comput. 20(4), 82–84 (2003)

    Article  Google Scholar 

  • Sat4J. http://www.sat4j.org/

  • Schmidt, M., Gloetzner, T.: Constructing difference tools for models using the Sidiff framework. In: ICSE Companion ’08, pp. 947–948. ACM, New York (2008)

    Chapter  Google Scholar 

  • Soto, M., Münch, J.: Process model difference analysis for supporting process evolution. In: Lecture Notes in Computer Science, vol. 4257, pp. 123–134. Springer, Berlin (2006)

    Google Scholar 

  • Subclipse. http://subclipse.tigris.org

  • Sudakrishnan, S., Madhavan, J., Whitehead, E.J. Jr., Renau, J.: Understanding bug fix patterns in Verilog. In: MSR ’08, pp. 39–42. ACM, New York (2008)

    Google Scholar 

  • Thomas, D., Moorby, P.: The Verilog Hardware Description Language. Kluwer Academic, Dordrecht (2002)

    Google Scholar 

  • Tkdiff. http://sourceforge/projects/tkdiff

  • Treude, C., Berlik, S., Wenzel, S., Kelter, U.: Difference computation of large models. In: ESEC-FSE ’07: Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, pp. 295–304. ACM, New York (2007)

    Google Scholar 

  • Veditor. http://veditor.sourceforge.net

  • Weißgerber, P., Diehl, S.: Identifying refactorings from source-code changes. In: ASE ’06, pp. 231–240. IEEE Comput. Soc., Washington (2006)

    Google Scholar 

  • Xing, Z., Stroulia, E.: Umldiff: an algorithm for object-oriented design differencing. In: ASE ’05, pp. 54–65. ACM, New York (2005)

    Google Scholar 

  • Yang, W.: Identifying syntactic differences between two programs. Softw. Pract. Exp. 21(7), 739–755 (1991)

    Article  Google Scholar 

  • Yu, Y., Tun, T.T., Nuseibeh, B.: Specifying and detecting meaningful changes in programs. In: ASE, pp. 273–282 (2011)

    Google Scholar 

Download references

Acknowledgements

We thank Greg Gibeling and Derek Chiou for providing accesses to the RAMP repository and Adnan Aziz and anonymous reviewers for their detailed comments on our draft.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Miryung Kim.

Additional information

This research is in part supported by National Science Foundation grants under CCF-1043810, CCF-1117902, and CCF-1149391 and 2011 Microsoft SEIF Award. The research was in part conducted while the first two authors were graduate students at The University of Texas at Austin.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Duley, A., Spandikow, C. & Kim, M. Vdiff: a program differencing algorithm for Verilog hardware description language. Autom Softw Eng 19, 459–490 (2012). https://doi.org/10.1007/s10515-012-0107-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10515-012-0107-6

Keywords

Navigation