Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
0answers
33 views

What is wrong with my vga code? [on hold]

This was developed on the DE1-SoC board in system verilog. Some of the redundant code was erased. I have a multidimensional array that determines if a spot is occupied or not and determines the player....
2
votes
1answer
141 views

What is the difference Verilog race condition, X's propagation and Metastability?

I'm trying to understand Verilog Race Condition X's propagation and Metastability with http:/...
0
votes
2answers
33 views

Instantiating modules in SystemVerilog

This is a picture of a system that I am building: (original) I am writing SystemVerilog for the Counter4to3 module, whilst the other modules (Full adder and half adder) have already been provided to ...
0
votes
0answers
36 views

HDL implementation of Numerical Analysis Techniques

I am looking for open-source implementations of Numerical analysis techniques (specifically root-finding techniques like the secant method) on FPGA using any HDL. Would also appreciate if anyone could ...
1
vote
1answer
36 views

Verilog style: one large always block vs multiple small always blocks?

Say I have multiple registers set up to update on the same clock, based on different conditions. I could set this up as a series of multiple always blocks: ...
0
votes
1answer
63 views

Sequence of evaluation in the following non blocking code?

I have the following verilog code that I came across and trying to find the sequence of evaluation. What value does 'A' have at the end of a cycle and after 5 cycles, when the value of A is 'x' at ...
1
vote
2answers
44 views

Is it possible to use conditional statements to modify parameters at compile time in Verilog?

This question explains how to use Verilog parameters to combine constants from different modules at compile time. I am wondering if it is also possible to use conditional statements to modify ...
2
votes
2answers
46 views

Is it possible to make hierarchy of constants in System Verilog?

Is it possible to make a synthesizable hierarchy of constants in System Verilog? For example: There is a board with FPGA and several peripheral ICs. Each IC have some setting registers. Each ...
2
votes
1answer
54 views

How do I calculate constant values across several modules at compile time in Verilog?

I have a Verilog module that uses three instances of the same low-level module, called 'pole'. The instances are identical, except for a constant offset value, which is provided by the top level. ...
0
votes
2answers
80 views

'11' sequence detector systemverilog

I wrote a program for a '11' sequence detector to be implemented by both Moore and Mealy machine. The problem statement is for z to be asserted high after x has been high for 2 cycles. I've attached ...
0
votes
2answers
38 views

Is there a way to define enumeration for certain signals after simulation?

I have run some verilog simulations in questa simulator and while viewing the waveforms i see that it would have been easier for me to debug the signals had there been some enums defined for them (To ...
0
votes
2answers
88 views

Connecting the following structure of multipliers and adders in an elegant way in verilog

I am attempting to write a synthesizable verilog (or Systemverilog) module. I also want to make the modul parameterizable, which has presented a problem when trying to connect the following structure ...
0
votes
0answers
54 views

What is the procedure to use ISCAS-85 benchmark Circuits for testing? [duplicate]

Could you please explain the detailed procedure about using ISCAS-85 benchmark Circuits for testing available at the below link http://web.eecs.umich.edu/~jhayes/iscas.restore/ How do we start, could ...
0
votes
1answer
56 views

A question about instantiating a module with a parameter in systemverilog

I'm now writing a testbench. In my testbench, I want to read the length of a text file and pass it to another module while instantiating. The idea is like this: ...
0
votes
2answers
79 views

(System)Verilog: extracting a smaller bus/vector from a larger bus?

What is the best practice for creating a bus, which is just extraction of certain bits of a larger bus. I do not want to store the index numbers to make the lookup in the generate-for if it could be ...
-1
votes
1answer
37 views

ModelSIM not generating outputs for any variables

I have been working on this issue for days and have not been able to figure it out. I was hoping one of you could help me solve this issue. So, when I run my SV code in Quartus and compile it, I don'...
1
vote
0answers
92 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 ...
4
votes
1answer
156 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
130 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
135 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. <...
1
vote
1answer
120 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
64 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
106 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
68 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
56 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
66 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
159 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
551 views

Toggle output using Verilog

Can anybody explain this code to me? ...
1
vote
0answers
87 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
128 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
55 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
209 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
41 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
132 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
353 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
234 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 ...
1
vote
2answers
521 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
106 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
74 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
157 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 ...
-1
votes
1answer
138 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
296 views

How to assert multiple properties in System Verilog

What is the most efficient way to assert multiple properties in SV ? Example: ...
0
votes
1answer
95 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
28 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
48 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
44 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
507 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
1k 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
256 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 ...