Questions tagged [system-verilog]

SystemVerilog is a unified hardware design, specification, and verification language based on extensions to Verilog.

SystemVerilog is a unified hardware description language () and verification language. Its two primary uses are to describe logical circuits targeted towards field-programmable gate arrays (FPGAs - ), programmable logic devices (PLD) and application-specific integrated circuits (ASICs - ) and to develop tests and environments to validate these circuit descriptions.

It is defined by IEEE 1800-2017 and with the exception of keywords, is a backwards-compatible superset of , IEEE 1364-2005.

3298 questions
5
votes
2 answers

Implicit net-type declaration and `default-nettype

I have a question on `default_nettype directive of SystemVerilog. By default, the following code is ok. module m1 ( input logic i1, output logic o1 ); logic l1; assign l1 = i1; assign o1 = l1; endmodule However, when I change…
Hiroto Kagotani
  • 370
  • 1
  • 2
  • 7
5
votes
2 answers

In SystemVerilog, what does (.*) mean?

I have a testbench declared as module test_circuit logic a,b,c; logic y; circuit UUT (.*); //what does this line mean? initial begin //something here end endmodule I haven't found any tutorials which tell me what it…
Papbad
  • 163
  • 2
  • 13
5
votes
1 answer

when are assertion "disable iff" values evaluated?

For this code, I see both assertions fail. It seems that disable iff (value) is evaluated later than the expression itself. Can someone explain this. module tb(); reg clk = 1; always #5 clk = !clk; reg rst = 1; always @ (posedge clk) rst <=…
nachum
  • 567
  • 9
  • 17
5
votes
3 answers

Why does system verilog max() and min() functions return a queue and not a single element?

I noticed this interesting thing about the max() and min() functions in SV LRM (1800-2012) 7.12 (Array manipulation methods). I tried out the max() and min() functions in a dummy SV file int a[3] = {0,5,5}; int q[$]; int b; q = a.max(); // legal b =…
Prashanth R
  • 95
  • 1
  • 2
  • 8
5
votes
1 answer

How is SystemVerilog 0 different from '0?

When executing the following piece of SystemVerilog code (compiled and run with Questa) bit [7:0] test = 255; $display("%b %b %b", test, test == 255, test == '1); $display("%b %b %b", ~test, ~test == 0, ~test ==…
PieterNuyts
  • 496
  • 5
  • 20
5
votes
1 answer

systemVerilog - round real type

What is the best way to round a real type in systemVerilog according: Case positive: if fraction >= 0.5 ---> round return the "integer part" + 1 (for example 4.5 --->5) if fraction < 0.5 ---> round return the "integer part" (for example 4.2…
sara8d
  • 403
  • 4
  • 17
  • 32
5
votes
2 answers

uvm_event and system verilog event difference

What is the advantage of uvm_event over the SystemVerilog event ? Can someone explain with small pseudo code ?
Ashutosh Rawal
  • 301
  • 1
  • 4
  • 16
5
votes
1 answer

Verilog signed multiplication: Multiplying numbers of different sizes?

For some reason I have been unable to find any definitive resources or stackoverflow questions answering this: Does verilog take care of input and output dimensions when multiplying signed numbers? To be specific, what happens if I multiply a…
sirblobfish
  • 53
  • 1
  • 1
  • 3
5
votes
1 answer

How does SystemVerilog `force` work?

I have a hierarchy of modules where I am trying to do a force to get different value at different module interface. I am working on a component whose task is to inject transaction to a module down the hierarchy, bypassing the drives from the modules…
Gautam
  • 375
  • 2
  • 6
  • 23
5
votes
2 answers

Python: print base class variables

I'm using a library to share data between C++, VHDL, and SystemVerilog. It uses codegenerators to build datastructures that contain the appropriate field. Think of a c type data structure. I want to generate python code that contains the…
Maurice
  • 476
  • 5
  • 13
5
votes
3 answers

What does " ref " mean in systemverilog?

I found this in systemverilog: task automatic xxx(ref xxxpackage bus,input interface ift); I want to know the usage of ref. What is the advantage?
bunch
  • 151
  • 2
  • 6
  • 13
5
votes
1 answer

How to use throughout operator in systemverilog assertions

Here is a spec: If signal a is asserted then it must be asserted till signal b is asserted and then it should de-assert on next clock edge. I'm reading through 16.9.9 of LRM (as well as http://www.testbench.in/AS_06_SEQUENCES.html) and the way I…
wisemonkey
  • 571
  • 3
  • 15
  • 29
5
votes
2 answers

Format specifications for real numbers

I would like to print some real numbers to a log file. To make them easy to read I would like them to all have the same width. I know these numbers will range from 0 to 4095.75 so I tried this: $display("expected= %4.2f, actual= %4.2f", expected,…
nguthrie
  • 2,615
  • 6
  • 26
  • 43
5
votes
4 answers

Do all Flip Flops in a design need to be resettable (ASIC)?

I'm trying to understand clock-reset in a chip. In a design what criteria are used to decide whether a flop should be assigned to a value (typically to zero) during reset? always_ff @(posedge clk or negedge reset) begin : process_w_reset …
newbie
  • 4,639
  • 10
  • 32
  • 45
5
votes
2 answers

Passing a module name as parameter

I want to create this generic wrapper for a bunch of modules I am writing. The wrapper should provide the ability to connect these modules to different type of NoCs without having to change the behavior of the inner modules. I thought that one way…
igon
  • 3,016
  • 1
  • 22
  • 37