SNUG Boston 2008 Return of the SystemVerilog Gotchas2
Table of Contents
1.0 Introduction ......................................................................................................................... 41.1 Abbreviations and terminology ........................................................................................... 41.2 Why are there gotchas? ....................................................................................................... 51.3 What types of gotchas are there? ........................................................................................ 61.4 Where do gotchas come from? ........................................................................................... 71.5 How to deal with gotchas .................................................................................................... 81.6 Previous work ..................................................................................................................... 91.7 What follows in the rest of the paper .................................................................................. 92.0 Verilog Gotchas ................................................................................................................ 102.1
always @*
oscillations (V2K1) .................................................................................... 102.2
always
procedures that are never executed .................................................................... 122.3 Misuse of logical AND and OR ........................................................................................ 132.4 Zero replication constants ................................................................................................. 142.5 Negative replication constants .......................................................................................... 162.6 Elaboration of unused illegal parameterized code ............................................................ 162.7 Incorrectly written indexed part-select (V2K1) ................................................................ 172.8 String size-extension ......................................................................................................... 182.9 Macro expressions need to be in parentheses ................................................................... 192.10 Macro call within string literal .......................................................................................... 202.11 Null ports .......................................................................................................................... 213.0 SystemVerilog Gotchas ..................................................................................................... 223.1 Types defined in different scopes ..................................................................................... 223.2 Arrays vs. queues .............................................................................................................. 233.3 Using `` for concatenation within an escaped identifier ................................................... 243.4 Use of special macro character sequences outside of macros ........................................... 253.5 Are spaces around macro arguments dropped? ................................................................. 263.6 String equality and compare functions have opposite return values ................................. 273.7 Glitches in
unique
/
priority
..................................................................................... 273.8 Glitches in immediate assertions ...................................................................................... 283.9 Assignments in expressions .............................................................................................. 293.10 Uneven coverage bin distribution ..................................................................................... 303.11
const
variables are not parameters ................................................................................. 313.12 The static initialization order fiasco .................................................................................. 324.0 Synthesis Gotchas ............................................................................................................. 334.1
always_comb
does not guarantee combinational logic ................................................ 334.2 My flip-flop is a latch! ...................................................................................................... 344.3 Myth:
default/full_case/unique/priority
prevent latches ........................ 364.4 Why is my combinational logic considered sequential? ................................................... 394.5 A synthesis engine is not as smart as a formal engine ...................................................... 394.6 Asynchronous reset loops in flip-flops ............................................................................. 415.0 Conclusions and Recommendations ................................................................................. 426.0 Acknowledgements ........................................................................................................... 437.0 References ......................................................................................................................... 43
Leave a Comment