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.
Similar content being viewed by others
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)
Ashenden, P.J.: Vhdl-200x: The next revision. IEEE Des. Test Comput. 20(3), 112–113 (2003)
Canfora, G., Cerulo, L., Penta, M.D.: Tracking your changes: A language-independent approach. IEEE Softw. 26, 50–57 (2009)
Cormen, T.H., Leiserson, C.E., Rivest, R.L.: Introduction to Algorithms. McGraw-Hill, New York (2001)
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)
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)
Dice, L.R.: Measures of the amount of ecologic association between species. Ecology 26(3), 297–302 (1945)
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)
Gupta, V., Pratt, V.: Gates accept concurrent behavior. In: Annual IEEE Symposium on Foundations of Computer Science, pp. 62–71 (1993)
Hunt, J.W., Szymanski, T.G.: A fast algorithm for computing longest common subsequences. Commun. ACM 20(5), 350–353 (1977)
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)
Malpohl, G., Hunt, J.J., Tichy, W.F.: Renaming detection. Autom. Softw. Eng. 10(2), 183–202 (2000)
Myers, E.W.: An o(nd) difference algorithm and its variations. Algorithmica 1, 251–266 (1986)
Neamtiu, I., Foster, J.S., Hicks, M.: Understanding source code evolution using abstract syntax tree matching. In: MSR’05, pp. 2–6 (2005)
Ohst, D., Welle, M., Kelter, U.: Difference tools for analysis and design documents. In: ICSM ’03, p. 13. IEEE Comput. Soc., Washington (2003)
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)
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)
Reiss, S.P.: Tracking source locations. In: ICSE ’08, pp. 11–20. ACM, New York (2008)
Rich, D.I.: The evolution of SystemVerilog. IEEE Des. Test Comput. 20(4), 82–84 (2003)
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)
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)
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)
Thomas, D., Moorby, P.: The Verilog Hardware Description Language. Kluwer Academic, Dordrecht (2002)
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)
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)
Xing, Z., Stroulia, E.: Umldiff: an algorithm for object-oriented design differencing. In: ASE ’05, pp. 54–65. ACM, New York (2005)
Yang, W.: Identifying syntactic differences between two programs. Softw. Pract. Exp. 21(7), 739–755 (1991)
Yu, Y., Tun, T.T., Nuseibeh, B.: Specifying and detecting meaningful changes in programs. In: ASE, pp. 273–282 (2011)
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
Corresponding author
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
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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10515-012-0107-6