A graphical analysis tool for hardware design
Mariusz Pawel Pytel s030166
Kongens Lyngby 2007
IMM-M.Sc-2007-111
2
Technical University of Denmark Informatics and Mathematical Modeling
Building 321, DK-2800 Kongens Lyngby, Denmark Phone +45 45253351, Fax +45 45882673
reception@imm.dtu.dk www.imm.dtu.dk
IMM-MSc:2007-111
3
Abstract
In order to meet requirements imposed by a rapid grow in complexity of chips, existing design and verification methodologies have to be extended and a new ones created.
The main objective of this master thesis is to investigate possibilities for improvement in creation and verification of high-level hardware description language models. GEZEL is an example of such a high-level hardware description language, which models hardware according to the semantics of the finite-state machine with datapath (FSMD). This feature of the language allows use of symbolic model checkers like NuSMV in the automated validation process. Both, GEZEL and NuSMV are presented in the report, and their parts relevant to the project explained.
As a part of the project a graphical tool was developed that visualizes hardware models and supports hardware architect in development process. The tool is able to check, whether model obey well-formedness conditions and provides means for full functional check by generation of NuSMV representation of the model, which further can be validated using this symbolic model checker.
Keywords: hardware descriptions, graphical representation, model-checking,
verification, GEZEL, NuSMV.
4
5
Preface
This thesis was prepared at Informatics and Mathematical Modeling (IMM) department at the Technical University of Denmark (DTU) in partial fulfillment of the requirements for acquiring the M.Sc. degree in Computer Science and Engineering. The project has been made during the period 14th June to 31st December under supervision of Michael R. Hansen and Jan Madsen, and corresponds to 30 ECTS-points.
………..
Mariusz Pawel Pytel
Lyngby, December 2007
6
7
Acknowledgements
I would like to thank my supervisors Michael R. Hansen and Jan Madsen for their help and support during the project. I especially appreciate many constructive discussions we had during our weekly meetings.
Additional thanks go to Martin Fränzle (University of Oldenburg, Germany) for his expertise on NuSMV, and Aske Brekling for his valuable suggestions concerning graphical representation and verification of GEZEL programs.
Finally, I would like to thank my parents Hanna and Marian, and my girlfriend Joanna
Balukiewicz for supporting me through the last six months.
8
9
Table of Contents
ABSTRACT 3
PREFACE 5
ACKNOWLEDGEMENTS 7
1 INTRODUCTION 13
1.1 Introduction to the hardware architectures 13
1.2 Related work 17
1.3 Thesis objective 18
1.4 Structure of the thesis 18
2 THE GEZEL LANGUAGE 20
2.1 FSMD 20
2.2 Datapath 23
2.3 Signal flow graph 24
2.4 Rules for datapath 25
2.5 Controller 26
3 A GRAPHICAL TOOL FOR MODELING AND ANALYSIS 28
3.1 User interface 28
3.1.1 Menu 29
3.1.2 Main view 30
3.1.3 Datapath and controller graphs 33
3.2 Navigation 34
3.3 Model editing 35
3.4 Well-formedness check 37
3.5 Example - Euclidean algorithm 40
10
3.5.1 Program structure 40
3.5.2 System module 41
3.5.3 The euclid module 42
3.5.4 The test_euclid module 45
3.6 Example - Simplified Data Encryption Standard 46
3.6.1 Program structure 47
3.6.2 System module 50
3.6.3 Encryption 51
3.6.4 Decryption 53
3.6.5 The test_encrypt module 55
4 VERIFICATION USING NUSMV 56
4.1 Introduction to NuSMV 56
4.1.1 Overview 56
4.1.2 Program structure 57
4.1.3 Variables 58
4.1.4 Module instantiation 59
4.1.5 Expressions 60
4.1.6 INIT and TRANS constraints 60
4.1.7 Rules for assignment 61
4.1.8 Specifications 61
4.2 Translating hardware models to NuSMV 62
4.2.1 Variable declarations 62
4.2.2 Transition declarations 63
4.2.3 Signal vs. register 65
4.2.4 Differences between GEZEL and NuSMV operators 65
4.2.5 Ternary conditional operator 66
4.2.6 Lookup table operator 66
4.2.7 Detailed description of conversion algorithm 67
4.2.8 Expression conversion 72
4.3 NuSMV model of Euclidean algorithm 73
4.3.1 The main module 74
4.3.2 The euclid module 75
4.3.3 The test_euclid module 78
4.3.4 CTL specifications 79
4.3.5 Verification results 79
5 DESIGN 81
5.1 The model component 82
5.1.1 Model and modules 82
5.1.2 The datapath 83
5.1.3 The controller 83
5.2 Expressions 85
5.3 The model-view component 86
5.4 The JGraph library 89
5.4.1 The JGraph class 89
11
5.4.2 JGraph Model-View-Controller 89
5.4.3 The graph model 90
5.4.4 Cell views 91
5.5 Serialization 92
5.6 Parsing of the GEZEL program 97
5.6.1 Main loop of the algorithm 97
5.6.2 Parsing of the datapath 97
5.6.3 Parsing of the controller 98
5.6.4 Parsing of GEZEL expressions 98
6 CONCLUSIONS 100
REFERENCES 102
APPENDIX A 103
A.1 GEZEL sources 103
A.1.1 Euclid algorithm 103
A.1.2 Simplified DES 104
A.2 XML structure 109
A.2.1 Euclid algorithm – without project settings 109
A.2.2 Euclid algorithm – with project settings 121
A.3 NuSMV sources 146
A.3.1 Euclid algorithm 146
A.3.2 Simplified DES 150
A.4 Verification 171
A.4.1 NuSMV source with CTL specifications defined 171
A.4.2 Verification output 190