Jim stoppanis 12 week shortcut to size
Verilog interview questions that is most commonly asked The Verilog language has two forms of the procedural assignment statement: blocking and non-blocking. The whole statement is done before control passes on to the next statement. This reflects how register transfers occur in some hardware systems. The file name can be either a quoted string or a reg holding the file name. If the file was successfully opened, it returns an integer containing the file number The files are opened in C with 'rb', 'wb', and 'ab' which allows reading and writing binary data on the PC.
The 'b' is ignored on Unix. It returns EOF if there was an error, otherwise 0. A function will carry out its required duty in zero simulation time. Functions will only return a single value and can not use either output or inout statements. Tasks are allowed to contain any of these statements. A task is allowed to use zero or more arguments which are of type output, input or inout.
A Task is unable to return a value but has the facility to pass multiple values via the output and inout statements. These commands have the same syntax, and display text on the screen during simulation. They are much less convenient than waveform display tools like cwaves?. Append b, h, o to the task name to change default format to binary, octal or hexadecimal.
A "full" case statement is a case statement in which all possible case-expression binary patterns can be matched to a case item or to a case default. If a case statement does not include a case default and if it is possible to find a binary case expression that does not match any of the defined case items, the case statement is not "full. If it is possible to find a case expression that would match more than one case item, the matching case items are called "overlapping" case items and the case statement is not "parallel.
To avoid inferring latches make sure that all the cases are mentioned if not default condition is provided. Execution of blocking assignments can be viewed as a one-step process: 1.
Evaluate the RHS right-hand side equation and update the LHS left-hand side expression of the blocking assignment without interruption from any other Verilog statement. Evaluate the RHS of nonblocking statements at the beginning of the time step. Update the LHS of nonblocking statements at the end of the time step. Signals 11 What is sensitivity list? The sensitivity list indicates that when a change occurs to any one of elements in the list change, begin…end statement inside that always block will get executed.
Yes in a pure combinational circuit is it necessary to mention all the inputs in sensitivity disk other wise it will result in pre and post synthesis mismatch. A good template for your Verilog file is shown below. Compilation VHDL. However, it is good design practice to keep each design unit in it's own system file in which case separate compilation should not be an issue. The Verilog language is still rooted in it's native interpretative mode.
Compilation is a means of speeding up simulation, but has not changed the original nature of the language. As a result care must be taken with both the compilation order of code written in a single file and the compilation order of multiple files. Simulation results can change by simply changing the order of compilation. A multitude of language or user defined data types can be used. This may mean dedicated conversion functions are needed to convert objects from one type to another.
The choice of which data types to use should be considered wisely, especially enumerated abstract data types.
This will make models easier to write, clearer to read and avoid unnecessary conversion functions that can clutter the code. VHDL may be preferred because it allows a multitude of language or user defined data types to be used.
Compared to VHDL, Verilog data types a re very simple, easy to use and very much geared towards modeling hardware structure as opposed to abstract hardware modeling. There are net data types, for example wire, and a register data type called reg. A model with a signal whose type is one of the net data types has a corresponding electrical wire in the implied modeled circuit. Objects, that is signals, of type reg hold their value over simulation delta cycles and should not be confused with the modeling of a hardware register.
Verilog may be preferred because of it's simplicity. Procedures and functions may be placed in a package so that they are avail able to any design-unit that wishes to use them.
There is no concept of packages in Verilog. Functions and procedures used within a model must be defined in the module. This can be used for displaying strings, expression or values of variables. Here are some examples of usage. In earlier version of Verilog ,we use 'or' to specify more than one element in sensitivity list. In Verilog , we can use comma as shown in the example below.
Eg Always posedge clock or posedge reset begin if reset. It also provides mechanism to access internal databases of the simulator from the C program. PLI is used for implementing system calls which would have been hard to do otherwise or impossible using Verilog syntax. Or, in other words, you can take advantage of both the paradigms - parallel and hardware related features of Verilog and sequential flow of C - using PLI.
Verilog interview Questions 21 What is difference between freeze deposit and force? This system task operates identically to the ModelSim force -deposit command. The force command has -freeze, -drive, and -deposit options. When none of these is specified, then -freeze is assumed for unresolved signals and -drive is assumed for resolved signals.
This is designed to provide compatibility with force files. But if you prefer -freeze as the default for both resolved and unresolved signals. Verilog interview Questions 22 Will case infer priority register if yes how give an example? Therefore casex or casez are required. Casex will automatically match any x or z with anything in the case statement. Verilog interview Questions 24 Given the following Verilog code, what value of "a" is displayed?
Finally, the display statement is placed into the 4th queue. If we were to look at the value of a in the next sim cycle, it would show 1. It is used to measure simulation time or delay time.
It can't compare Xs. Net types: wire,tri Physical connection between structural elements. Value assigned by a continuous assignment or a gate output. Register type: reg, integer, time, real, real time represents abstract data storage element.
Assigned values only within an always statement or an initial statement. But reg can hold the value even if there in no connection. Default values:wire is Z,reg is x. So here, if the lowest 1-bit of x is bit 2, then something3 is the statement that will get executed or selected by the logic. This is a popular coding error. There are mainly two types of simulators available. Event-based simulators are like a Swiss Army knife with many different features but none are particularly fast.
The digital logic is the only part of the design simulated no timing calculations. By limiting the calculations, Cycle based Simulators can provide huge increases in performance over conventional Event-based simulators. Cycle based simulators are more like a high speed electric carving knife in comparison because they focus on a subset of the biggest problem: logic verification. Cycle based simulators are almost invariably used along with Static Timing verifier to compensate for the lost timing information coverage.
Introduction As ASIC and system-on-chip SoC designs continue to increase in size and complexity, there is an equal or greater increase in the size of the verification effort required to achieve functional coverage goals.
This has created a trend in RTL verification techniques to employ constrained-random verification, which shifts the emphasis from hand-authored tests to utilization of compute resources. With the corresponding emergence of faster, more complex bus standards to handle the massive volume of data traffic there has also been a renewed significance for verification IP to speed the time taken to develop advanced testbench environments that include randomization of bus traffic.
Directed-Test Methodology Building a directed verification environment with a comprehensive set of directed tests is extremely time-consuming and difficult. Since directed tests only cover conditions that have been anticipated by the verification team, they do a poor job of covering corner cases. This can lead to costly re-spins or, worse still, missed market windows.
Traditionally verification IP works in a directed-test environment by acting on specific testbench commands such as read, write or burst to generate transactions for whichever protocol is being tested. This directed traffic is used to verify that an interface behaves as expected in response to valid transactions and error conditions.
The drawback is that, in this directed methodology, the task of writing the command code and checking the responses across the full breadth of a protocol is an overwhelming task. The verification team frequently runs out of time before a mandated tape-out date, leading to poorly tested interfaces. However, the bigger issue is that directed tests only test for predicted behavior and it is typically the unforeseen that trips up design teams and leads to extremely costly bugs found in silicon.
Constrained-Random Verification Methodology The advent of constrained-random verification gives verification engineers an effective method to achieve coverage goals faster and also help find corner-case problems. It shifts the emphasis from writing an enormous number of directed tests to writing a smaller set of constrained-random scenarios that let the compute resources do the work.
Coverage goals are achieved not by the sheer weight of manual labor required to hand-write directed tests but by the number of processors that can be utilized to run random seeds. This significantly reduces the time required to achieve the coverage goals. Scoreboards are used to verify that data has successfully reached its destination, while monitors snoop the interfaces to provide coverage information.
Molecular genetics of bacteria snyder 4th edition
A blog to collect the interview questions and answer for ASIC related positions. In this case, different threads will step on each other's values. By using atuotmic storage, it will make a copy of local variables and use them. Not a common static storage any more. What's the packed array and unpacked array? In other words, you are using only lower 8 bits, the other 24 bits per word space is wasted. Packed array is an array without gap. Unpacked array is good for local individual variable access.
A packed array is handy if you need to convert to and from scalars. What's different between logic and wire? Logic and wire are almost the same except wire can be driven by multiple sources. Logic can only driven by single source. Posted by Roy Chan at AM 1 comment:. Labels: SVA. SVA System verilog Assertion. What are difference between SVA and other assertions? What are the benefits of using assertions?
Who writes Assertions? How many ways to connect assertion to RTL? Use compile option for synthesis. How many array types in SystemVerilog? How do you use them? Polymorphism allows an entity to take a variety of representations. Effectively, this means that you can ask many different objects to perform the same action. Override polymorphism is an override of existing code.
Subclasses of existing classes are given a "replacement method" for methods in the superclass. Superclass objects may also use the replacement methods when dealing with objects of the subtype. The replacement method that a subclass provides has exactly the same signature as the original method in the superclass. The properties did not get copied. It's because it's pointing to the same memory. To avoid this, we need to use the deep copy.
Deep Copy A deep copy copies all fields, and makes copies of dynamically allocated memory pointed to by the fields. To make a deep copy, you must write a copy constructor and overload the assignment operator, otherwise the copy will point to the original, with disasterous consequences.
Wednesday, June 2, New interview questions. Labels: Verilog Interview Questions. Without another variable? It can swap any data type. Posted by Roy Chan at PM 2 comments:.
This makes life nice in many ways: You can traverse lists forward and backward. You can insert anywhere in a list easily. This includes inserting before a node, after a node, at the front of the list, and at the end of the list. You can delete nodes very easily. Posted by Roy Chan at AM 5 comments:. Older Posts Home. Subscribe to: Posts Atom. Search This Blog. Visitor's counter Visitor Counter. About Me Roy Chan Specialties in ASIC Design and Verification from front-end to back-end activities, including RTL coding, verification testbench development, testcase generation and test regression , logic synthesis, static timing analysis, Place and route, power analysis, ECO and final tapeout process.
Currently, I am still looking for a new career. View my complete profile.