Hardware Description Languages Compared: Verilog and Systemc

Hardware Description Languages Compared: Verilog and Systemc

Hardware Description Languages Compared: Verilog and SystemC Gianfranco Bonanome Columbia University Department of Computer Science New York, NY Abstract This library encompasses all of the necessary components required to transform C++ into a As the complexity of modern digital systems hardware description language. Such additions increases, engineers are now more than ever include constructs for concurrency, time notion, integrating component modeling by means of communication, reactivity and hardware data hardware description languages (HDLs) in the types. design process. The recent addition of SystemC to As described by Edwards [1], VLSI an already competitive arena of HDLs dominated verification involves an initial simulation done in by Verilog and VHDL, calls for a direct C or C++, usually for proof of concept purposes, comparison to expose potential advantages and followed by translation into an HDL, simulation of flaws of this newcomer. This paper presents such the model, applying appropriate corrections, differences and similarities, specifically between hardware synthesization and further iterative Verilog and SystemC, in effort to better categorize refinement. SystemC is able to shorten this the scopes of the two languages. Results are based process by combining the first two steps. on simulation conducted in both languages, for a Consequently, this also decreases time to market model with equal specifications. for a manufacturer. Generally a comparison between two computer languages is based on the number of Introduction lines of code and execution time required to achieve a specific task, using the two languages. A Continuous advances in circuit fabrication number of additional parameters can be observed, technology have augmented chip density, such as features, existence or absence of constructs consequently increasing device complexity. This that facilitate coding, availability of optimization has resulted in a higher degree of design techniques, as well as others. These criteria vary automation and increase in the number of tools slightly when attempting to compare two HDLs. available to an integrated chip designer. Recently For instance, HDLs need to have time-handling there has been an incline toward the usage of constructs, unlike most other computer languages. Hardware Description Languages [3]. The Comparable “building blocks” may synthesize into portability of models created with such tools, has different circuitry, depending on the language’s made them preferable over their corresponding standard. flow, state and logic diagrams. Other points utilized as a basis for comparison Various HDLs with diverse properties and include: efficiency of methods and language objectives have been developed over the years, constructs, signal behavior description, scheduling giving designers a vast selection in the appropriate semantics and ease of implementation. modeling instrument. In this paper I will be comparing different SystemC presents a new approach to the aspects between the Verilog [2] and SystemC [4] concept of HDLs, as it combines hardware and HDLs, according to the measures mentioned software descriptions at different levels of above. The code that will be used to base this abstraction, by extending C++ with a new comparison implements an alarm clock controller. library. Related work after, to specify their sizes. SystemC accomplishes this in one step, but at its own can declare a Previous work comparing two or more HDLs is function separately from its body, as in C. This limited to a few papers, usually regarding VHDL property of the language can also be viewed as an and Verilog. This is mainly due to the fact that advantage, since a module can therefore call SystemC is a latecomer to this field, but also several different processes. Verilog is only able to because it is merely an extension of an already carry out a process if found within a module, existing language. which signifies having to write a module for every Douglas Smith wrote a tutorial [5] in which he process that needs to be called by external compares VHDL and Verilog. Smith also describes modules. The absence of a high level construct the range of modeling capacity possessed by the that replicates structure can often lead into two languages, exposing VHDL’s lower modeling writing code that may seem repetitive, or difficult limit: gate level. Interestingly enough, Verilog is to optimize. one of the few HDLs capable of modeling down to When modeling a process in Verilog, common transistor level. practice is to have an always construct around the Few additional papers dealing with two or body of the function to be evaluated. In SystemC, more HDLs exist, but are generally not meant to the functions are written as members of the bring forth comparison issues, rather to present module class being designed, allowing the designer co-design techniques such as Agliada [8]. to more easily integrate additional functionality in In his paper on co-simulation of VHDL and the same design. SystemC, Agliada introduces a method to Timing mechanisms vary extensively between homogenize the system descriptions in order to Verilog and SystemC. The later has a built-in simulate them together. This approach calls for a clocking mechanism, where such a device and its VHDL to SystemC translator. In describing such a output signal wave can be described using the tool, it is unavoidable to compare the two sc_clock() construct. Instead, Verilog uses a more languages, even if not in detail. general way to create a clock: by defining it as a module. Although this technique may appear inefficient, it is actually more natural for a Fundamental differences in constructs beginning designer, since no new constructs need to be learned. Figure 2 below, illustrates this Both Verilog and SystemC utilize modules as point. design entities While Verilog has the module keyword build in, SystemC needs to call a Verilog SystemC construct named sc_module() to declare the body module m555 (clock); sc_clock m555("m555", of the device at task. The difference in module output clock; 20, 0.5, 5, true); reg clock; declaration syntax can be seen below in figure 1. initial #5 clock = 1; always #50 clock = ~clock; Verilog SystemC endmodule module runner(port names); SC_MODULE(Runner) { Figure 2. Clock declaration syntax. //port sizes and direction //ports sizes and direction //body //body SystemC allows for three types of processes to endmodule }; //member functions be utilized in the description of a model: methods, threads and synchronized threads. Figure 1. Component declaration syntax. According to the SystemC User’s Guide [4], methods execute when changes occur in signals Although Verilog may appear slightly more found in their sensitivity list. Upon termination, a concise at first, it should be pointed out that the method returns control to the simulation kernel. former requires ports to be listed once in the Threads behave similarly as methods, but they module declaration line, and again immediately may also be suspended and reactivated at the occurrence of a specified event. As Edwards [1] wire or tri Simple interconnecting wire points out, hardware does not exhibit this wor or trior Wired outputs OR together behavior, but such processes can be useful when wand or triand Wired outputs AND together designing a test bench. tri0 Pulls down when tri-stated Synchronous threads are a special case of tri1 Pulls up when tri-stated threads, where triggering takes place at a specific supply0 Constant logic 0 (supply strength) edge of a signal. The scheduling of all three supply1 Constant logic 1 (supply strength) process types takes place at the bottom portion of trireg Stores last value when tri-stated a SystemC model, by using the sc_ctor() macro (capacitance strength) (SystemC constructor). In modeling an alarm clock controller, such a constructor was called for In order to support modeling at different levels the tick process of type method: of abstraction, from the functional to the register- transfer level, as well as to support software, sc_ctor ( Runner ) { SystemC provides programmers with a rich set of sc_method ( tick ); signal types. This is different from languages like sensitive_pos ( clock ); Verilog that only support bit-vectors as types. } SystemC can implement both two-valued and four-valued signal types, which add practicality to where Runner is the name of the sc_module that a simulation. owns the tick process. SystemC’s set of data types is enhanced to Verilog per se does not differentiate among support multiple design domains and abstraction processes, but allows flexibility to mimic the levels. The fixed precision types allow for fast behavior found in the three scenarios described simulation. The arbitrary precision types can be above. This is achieved by means of timing- used for computations with large numbers and to oriented constructs such as: model large busses. Such types do not have a limitation in size. always @ ( condition ) In addition, this HDL provides a large selection of overloaded operators, quantization and Here the condition may be a signal or an overflow modes, as well as type conversion event, in which case the identifier will be found mechanisms. between parentheses. By this token, a function SystemC, extends C++ types by utilizing the can also be edge-triggered: following signal definition syntax: always @ ( posedge clock ) sc_signal < base_type > signal_name; As strongly-typed languages, both Verilog and where base_type corresponds to one of C++’s

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us