Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [system-verilog]

In the semiconductor and electronic design industry, SystemVerilog is a combined hardware description language and hardware verification language based on extensions to Verilog.

1
vote
0answers
86 views

Unexpected behaviour of implication operator in SVA

There is an issue I face while using an implication operator in one of my code examples. This code can be found at https://www.edaplayground.com/x/4fVz Code Summary In my code, I have defined ...
3
votes
0answers
63 views

Undefined signal in simulation

I am trying to verify a design written in VHDL using SystemVerilog's assertions. however I got a problem when I have a non defined signal'X' Just for example here is a code of a Comparator: ...
3
votes
3answers
58 views

Verilog router design and best way to handle variable size packets in verilog?

I have a synthesizable Verilog/logical design question. My question is more logical than syntax. I wish to implement some sort of router that has three input/output ports of full-duplex UART RS232, ...
0
votes
1answer
85 views

Net type, variable type, data type and data objects

I am really confused by the conception of net type, variable type, data type and data objects in SystemVerilog. I am using the simulator inside Xilinx Vivado 2018.02 for all the following codes. <...
0
votes
0answers
39 views

How to convert verilog designs for Xilinx products to Quartus? [Beginner]

I am trying to run a complex design that uses both verilog and system verilog files in Quartus, but they do not work. Partly due to syntax errors (VHDL like assigning proper outputs with reg for use ...
1
vote
1answer
59 views

How to write constraint file for the divided clock in Verilog?

I am using FPGA Basys 3 board in my college, having 100MHZ clock frequency, i divided the default clock (clk) by 216 and got ...
1
vote
1answer
56 views

A question about randomization in verilog

I am now working on a verilog testbench file and I want to get a random value in my code, but I have found that Questa Sim uses the same seed again and again. I have read through $random in Verilog ...
0
votes
1answer
40 views

Syntax error selecting a range from a range

I'm trying to run an old Bitcoin miner project in Vivado. The old code is written in Verilog and the rest of my project is in System Verilog. I have a syntax error I don't know how to solve. It ...
0
votes
1answer
62 views

How exactly does $cast work

When a $cast is executed between a base and a derived class objects, does it allocate more memory for the derived class handle? ...
0
votes
1answer
44 views

Using two different clocks in my assertion

I am using SystemVerilog to write assertions in order to test the behavior of my design. In my design I have two clock : the usual CLK_int and another clock called ...
0
votes
1answer
34 views

How to assert multiple concurrent assertions in system verilog?

I want to do something like this using concurrent assertions (I want to check that when from_clk changes to_clk must change and when to_clk changes from_clk must change): ...
0
votes
2answers
103 views

SystemVerilog: Race condition in memory

Hello I'll be brief because my English isn't good thank you for your patience I'm working on a system that drives this memory: ...
-1
votes
4answers
156 views

Toggle output using Verilog

Can anybody explain this code to me? ...
1
vote
0answers
33 views

SDF back annotation in systemVerilog design using interfaces

I have a DUT which is encrypted netlist and .sdf file (normally we do functional and timing simulations with these inputs). I used interface feature in SystemVerilog so I don't define any port for the ...
0
votes
1answer
56 views

always_ff is always executed earlier than always_comb in ModelSim

I have an exercise that separating comb logic from sequential logic in always_ff block. However, I found that the ordering of always_comb and always_ff executions is different between different ...
-2
votes
1answer
52 views

verilog code for bitlength operation

What is the Verilog code for bitlength operation. Example: If Y=45897, I need BitLength(Y)=16. verilog code for BitLength(Y) is ? Please help me to write this.
0
votes
1answer
146 views

Why is there seemingly no delay in a block ram read

I am trying to learn Verilog and was curious why my FPGA's block ram seems to provide the data that I request instantly. I was expecting that there would be some number of clocks that I would need to ...
0
votes
1answer
35 views

If constraints in SystemVerilog

I have a class of sequence item with rand variables: class my_seq_item extends uvm_sequence_item; rand bit a, b, c, d; I want to generate a random bit for 'd' ...
0
votes
1answer
56 views

Will temp variable in always_comb create latch

I have following code snippet where a temp variable is used to count number of 1s in an array: ...
0
votes
2answers
200 views

Bidirectional assignment in Systemverilog

I need to create mux block that works with inout pins. My module has n inputs and n outputs, I want to be able to switch between different outputs. The problem that I am currently having is that I ...
0
votes
1answer
200 views

System verilog instantiation of parameterized module

If I have a mymodule that has parameters and I am instantiating this mymodule inside a top level block which has a few sub module and mymodule is also a submoulde then when instantiating mymodule ...
0
votes
0answers
28 views

IVerilog in CMD: `include statement not working

I've written the code for every component in a simplyfied PIC Microcontroller in different .v files. To instantiate a module present in a file different to the testbench, I wrote the following line of ...
1
vote
2answers
330 views

Opening and reading pixel values from bitmap images in Modelsim

How do I open a bitmap image, read the pixel data (24 bits) and store it in a memory that I created in a Verilog module in ModelSim? How do I open the below image in Modelsim? Is it possible in the ...
0
votes
2answers
102 views

Design a circuit from logic gates, flip flops and/or multiplexers

I would like to create a simple circuit from logic gates, flip-flops (no RLC components) to do the following task: This circuit has 5 inputs (4 positive real-valued signals \$x_1, x_2, x_3, x_4\$ and ...
1
vote
1answer
53 views

SystemVerilog Assertion consecutive repetition for overlapping sequences

I have a specification as follows : "Check that 'valido' is not asserted when 'validi=1' for only two, one or zero consecutive clk cycles." the following assertion FAILS (n-3 times) on a sequence of ...
0
votes
0answers
63 views

Variable clock counts in System Verilog assertion property

Is there a way to introduce variable clock counts in assertion properties as shown in the example below ? ...
0
votes
0answers
115 views

System verilog - streaming operator multidimensional array to stream of bits

I cant figure out how to take multidimensional array such as: bit unsigned [10:0] img [3:0][3:0]; Think of it as an 4X4 image that each pixel is 11 bits in my ...
0
votes
0answers
369 views

How to use struct in an interface?

Since it's not possible to have an interface in a package, what is the best practice to manage interface containing struct of a package ? ...
-1
votes
1answer
89 views

Is it possible to use `.*` in SystemVerilog to register interfaces' elements?

Let's say I have one interface, I'd like to ...
0
votes
1answer
186 views

How to assert multiple properties in System Verilog

What is the most efficient way to assert multiple properties in SV ? Example: ...
0
votes
0answers
157 views

“range must be the final index in the indexed name”, system verilog slice array and send to module

I have an 2d array (and 1 more dimension of 11 bits),and I dont want to send to module "cb" the entire 2d array, but only part of him, and I understood that if I want to slice an array I cant use not ...
0
votes
1answer
75 views

Read and write simultaneously from different indices of an associative array in system verilog

Is it possible to read and write simultaneously (In parallel) from different indices of an associative array in System Verilog ?
0
votes
1answer
26 views

Fault modelling stuck at fault for combinational circuit

A circuit has n inputs and n outputs. It is implemented only using AND, OR and NOT gates. Further, there are no fan-out branches. What is the number of s-a faults that remain after fault collapsing? ...
1
vote
1answer
39 views

Implementing a Mealy Machine in Verilog

I have a piece of code that I don't understand: always_ff @(posedge CLK) state <= RST || ~A[0]===1'bx || ~A[1]===1'bx ? 0 : nextstate; ...
0
votes
1answer
41 views

SystemVerilog: selecting bits without storing calculation in variable

Is there really no way to select bits straight from a calculation without giving them a name and then selecting the bits from the name in SystemVerilog? ...
0
votes
1answer
354 views

SystemVerilog Enumerated Multi-Domain Array -> how to declare/define?

Here is an example how to define the 2*N array of enum types of {S0,S1,S2,S3}: typedef enum logic [N-1:0][1:0]{S0,S1,S2,S3} state_t; (*) So, each element of the above 2*N array could be either S0 ...
-1
votes
1answer
569 views

Testbench for simple register file

I want to test my register file before connecting it to ALU. So I wrote a testbench for my register file. ...
1
vote
1answer
228 views

System Verilog Coverpoint Bin for everything else that is counted towards coverage calculations

Setting a bin to default grabs everything else in the coverpoint, but the default bin is ignored in coverage calcuations. Is there anything similar to default that I can use for syntax that will ...
0
votes
3answers
2k views

Using $floor in Verilog

Verilog has a bunch of math system functions. I'm trying to use $floor in my Verilog code but I'm getting this message: System function call floor is not allowed here Does anyone know why I'm ...
2
votes
1answer
559 views

SystemVerilog: Sensitivity list of always_comb

It seems to me that always_comb is not sensitive to variables assigned in the block itself. For example, the following block: ...
1
vote
1answer
829 views

SystemVerilog: How to give different parameters to modules in the same array?

In my design, I wanted to use a number of counters with different initial values on reset. Therefore I defined the counter module as follows: ...
1
vote
1answer
278 views

Verilog modulus operator for wrapping around a range

My background is in software and I'm new to (System)Verilog so when tasked with implementing a caesar shifter (shift each letter in a string by N letters, wrapping around if necessary e.g. ABCXYZ ...
0
votes
0answers
106 views

Load instruction fetching wrong value

I have written some code for mips but in my program the LW insturction didnot fetch the correct answer. For example: ...
0
votes
1answer
275 views

(System)Verilog: signal is x or 1 depending on placement of concurrent blocks in the code?

I'm basically aware that the Verilog scheduler is inherently indeterminate, but I really don't understand why that's the case with the following code (I've simulated both cases with Icarus and ...
0
votes
1answer
338 views

SystemVerilog import statement outside module definition

What does an import statement outside of a module (|class|package) definition mean? Does it apply to entire file? Is it even legal? I don't see it in IEEE Std 1800™-2012. It seems to be ...
1
vote
1answer
2k views

what is the difference between logic,reg and wire in system verilog?? explaination with an example would be helpful

explanation with an example would be helpful.i tried:- input logic [9:0] data1 as the input of the counter and loaded this value into the count1 (logic [9:0] count;) and then assigned count1<=data1;...
0
votes
1answer
379 views

ASIC verification of a FIFO with “n” unique items

simulate this circuit – Schematic created using CircuitLab I have a synchronous FIFO. The depth of the FIFO is 32. Everytime the FIFO has 7 or any "n" unique elements inside it, "unique" ...
0
votes
1answer
117 views

ASIC verification of a multiport switch

simulate this circuit – Schematic created using CircuitLab I have a DUT that can take packets from all 4 identical interfaces (A, B, C, D) Packets from one port can go to either one of the ...
0
votes
1answer
4k views

What is the use of 'import' in SystemVerilog?

Once a package is included the file is compiled. Then why it is required to import same package ?