Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
54 views

I am designing a 16 bit microcontroller for a college project using Vivado and Verilog. On behavioral simulations i use $readmemh and everything runs fine, the instructions are loaded from memory and ...
Francisco Sousa's user avatar
2 votes
2 answers
82 views

I usually work with Xilinx FPGA boards. Based on the documentation I've reviewed and the research I've done, I try to avoid using a global reset signal in my designs as much as possible. However, let'...
stackwryd's user avatar
2 votes
1 answer
82 views

My register doesn't work properly. The output changes simultaneously with the input. There should be a one-cycle delay, but I am not seeing it from the simulation in Modelsim. Does anyone know why? ...
user22714606's user avatar
2 votes
1 answer
86 views

I'm implementing a simple ARM7 in Verilog and am currently in the process of creating a simple data memory. I've come up with something like this: // very simple sdata implementation with 1mb~ memory ...
therepanic's user avatar
1 vote
1 answer
121 views

I have a simple example for random stability in QuestaSim. module sv_rand_stability; class dummy; rand int data; endclass initial begin dummy d; $display("%...
Sergey Chusov's user avatar
-1 votes
1 answer
89 views

module te( input a ); reg clk; reg [1:0]d1=2'd3; reg signed [2:0]d2=-3'd3; reg signed [4:0]d3; always @(posedge clk) begin d3<=d1*d2; $display("%b",d3);//01111,how to know the ...
kittygirl's user avatar
  • 2,513
0 votes
0 answers
94 views

I stumbled upon perplexing hardware behavior in the following simple circuit, provided here verbatim: /// Given an WIN-bit signed input, truncates the most significant bits to produce a WOUT-bit ...
Pavel Kirienko's user avatar
0 votes
0 answers
44 views

`timescale 1ns/1ps module ctrl( output d0, output reg d1, output reg res=1'b1, output reg d3, output reg d4 ); reg [7:0] oper_cnt=8'd0; reg clk; assign d0=clk; always @(...
kittygirl's user avatar
  • 2,513
4 votes
1 answer
117 views

I've been doing a finite state machine of an elevator using Verilog. The elevator contains four states: IDLE: When the elevator is stopped. ERROR: When the elevator's weight limit is exceeded. MOVING:...
Gr_10's user avatar
  • 71
-1 votes
1 answer
105 views

For context, please look at my attached diagram to see what I am trying to accomplish. Essentially, I want to swap inout wires using a contained hierarchy that will allow me to have more modular RTL ...
Mahmoud Maarouf's user avatar
-1 votes
1 answer
73 views

In Verilog, $display("%b",^ 3'b10x); outputs x. As x==1'dx, I believe ^ 3'b10x==1'bx is true, but the result is false. What's the correct result of ^ 3'b10x? And why is ^ 3'b10x==1'bx false?
kittygirl's user avatar
  • 2,513
-3 votes
1 answer
166 views

`timescale 1ns/1ps module m_top ( input GCLK, input [7:0] i_in1, output o_out1, output reg o_out2, inout io_data, output reg[7:0]yy ); assign o_out1=5; initial o_out2=6; task my_task; input a,b; ...
kittygirl's user avatar
  • 2,513
0 votes
1 answer
80 views

`timescale 1ns/1ps module m_top ( input GCLK,//100MHz,Y9 input [7:0] i_in1, output o_out1, output reg o_out2, inout io_data ); reg hh [2:0][1:0] ; reg [2:0]hh2[1:0] ; always @(negedge GCLK)begin ...
kittygirl's user avatar
  • 2,513
-1 votes
1 answer
73 views

`timescale 1ns/1ps module a( input a, output [7:0]tmp ); reg signed[2:0] m; reg [2:0] n; initial begin m=4; n=4; $display("%f",m);//-4.000000 $display("%f",n);//4.000000 end ...
kittygirl's user avatar
  • 2,513
-4 votes
1 answer
203 views

`timescale 1ns / 1ps module m_top ( input GCLK,//100MHz,Y9 output reg o_out2, inout io_data ); initial begin if(-3'd300>5000)begin $display("%b",-3'd300);//...
kittygirl's user avatar
  • 2,513
-6 votes
1 answer
97 views

`timescale 1ns / 1ps module m_top ( input GCLK, output o_out2, inout io_data ); reg [2:0] compare; case(compare) 3'd1:begin assign o_out2=1; end 3'd2:begin assign o_out2=2; end default:begin ...
kittygirl's user avatar
  • 2,513
1 vote
1 answer
109 views

I'm designing game of life in Verilog. The design consist of simple cell that been generated in grid with generate. gol_cell.v : module gol_cell ( input clk, input rst, input [...
FabienM's user avatar
  • 3,901
2 votes
1 answer
82 views

I know a lot of people have asked about when to use assign inside always, but I'm wondering if you actually have to. Is it ok to have a module where you have assign statements, but they are not inside ...
dishcat15's user avatar
2 votes
2 answers
169 views

When I am doing some development with Verilog and Vivado, I wrote some Verilog code as follows: module min_rep_example_A(input clk, input rst_n, output reg[3:0] LED); always @(posedge clk or ...
Cu635's user avatar
  • 78
0 votes
0 answers
71 views

The instantiation module as below: module second_module( input [7:0] d, output reg [7:0] q ); initial q <= ~d; endmodule The top module as below: module top_module( input [7:0] ...
kittygirl's user avatar
  • 2,513
0 votes
1 answer
88 views

Refer to this question,I write a similar case. module n; reg [1:0]a, b; initial begin a=1; a<=a+1; $strobe("strobe",a); $display("display",a); end endmodule The ...
kittygirl's user avatar
  • 2,513
1 vote
1 answer
80 views

module n; reg [1:0]a, b; initial begin $monitor($time,," monitor ",a); a=1; a<=a+1; #1;//assignment should happen here end endmodule The expect output is: 1 monitor 2 but I got 0 ...
kittygirl's user avatar
  • 2,513
0 votes
1 answer
61 views

`timescale 1ns / 1ps module factorial( input i_n, output reg res, input i_clk ); integer j; initial begin:a for (j=1;j<=i_n;j=j+1)begin res<=res*j; end res<='d3; $display("res is ...
kittygirl's user avatar
  • 2,513
3 votes
1 answer
114 views

I studied Verilog and do my exercises on HDLBits. I came up with a question when trying to solve this problem: https://hdlbits.01xz.net/wiki/Exams/2014_q3fsm I wrote the following codes according to ...
qian li's user avatar
  • 53
-1 votes
1 answer
110 views

I'm a complete beginner when it comes to Verilog. I have a block ROM which is as follows: module CDbram_2_0_32 (clk, en, addr, dout); input clk; input en; input [9:0] addr; output [9:0] dout [0:37]; (...
Dara Greyest's user avatar
1 vote
2 answers
126 views

I have Verilog code like this: module gen_bits(input clk, input clear, input ld, input in, output reg[7:0] out); always @(posedge clk) begin if (clear) out <= 8'b00000000; ...
qian li's user avatar
  • 53
-1 votes
1 answer
72 views

Consider the following example: // example.v module submod ( output logic sub_output ); assign sub_output = 1'b1; endmodule module top; logic out; submod gen_submod (); assign out ...
cryptobeginner's user avatar
2 votes
1 answer
75 views

I'm trying to parse all Verilog defines I have in a specific file in my Verilog code. I.e. scan through definitions like the following: `define A 3 `define B 5 `define C (A+B) And translate it to a ...
rg ks's user avatar
  • 31
-2 votes
1 answer
106 views

I am asking about standard Verilog 2001 and not System Verilog extensions. I was sure it was listed as an advantage of tasks, over a function. However, I have this syntax working and it seems to at ...
artless-noise-bye-due2AI's user avatar
0 votes
0 answers
57 views

I am trying to add a MMIO device to rocket-chip in chipyard and I want to use Tilelink interface. This MMIO device is intended to be a slave and the rocket-core as the master. For this, I created a ...
student_11's user avatar
1 vote
1 answer
93 views

I'm looking for SV code that is equivalent to these lines in VHDL: process begin wait until rising_edge(mysig) for 1 us; if rising_edge(mysig) do_something() else do_something_else(); end if; ...
Craig's user avatar
  • 940
0 votes
2 answers
154 views

I'm trying to generate a pulse width modulated signal to control the power with duty cycle, but don't know where I went wrong This is the verilog code module pwm_generator ( input wire clk, ...
Subzee's user avatar
  • 73
-1 votes
1 answer
131 views

Sample verilog script as below: `timescale 1ns/1ps module Save_Mult_Df(Abar,Bbar,Cbar); input Abar; output Bbar;//Bbar is here input Cbar; assign Bbar=Abar+Cbar; endmodule module test(); reg Abar,...
kittygirl's user avatar
  • 2,513
1 vote
1 answer
74 views

I currently need to read 128 8-bit data. After reading 128 data, they are combined into a 1024-bit RAM which is then assigned to dout. The ram_cnt will count from 0 to 65535. When it counts 128 (0~...
Vina's user avatar
  • 27
-1 votes
1 answer
177 views

Verilog script as below: `timescale 1ns/1ps module Save_Mult_Df(A); input A; wire C; assign C=A; endmodule module test(); reg A; wire C;//should wire be added to testbench? initial A= 2'b10; ...
kittygirl's user avatar
  • 2,513
1 vote
2 answers
85 views

I wrote a module which used the writing method like: always_ff@(posedge clk)begin logic [WIDTH-1:0] signal1; ........ end When I compiled it in VCS, I drove the signal in testbench, and when I ...
genterminal's user avatar
1 vote
1 answer
807 views

Purpose: Input 128 data, store them in RAM, and output them to dout after collecting 128 data. di is an input variable. RAM is used to store 128 data. When RAM collects 128 numbers, dout will write ...
Ti Wize's user avatar
  • 13
3 votes
1 answer
122 views

This is the Verilog question. I have written the code according to the image, but I'm getting mismatch in the output, can I get some assistance? module add1 ( input a, input b, input cin, output ...
Subzee's user avatar
  • 73
1 vote
1 answer
99 views

I've been assigned to create a 4:1 multiplexer in Verilog, and then implement the function: F(X, Y, Z) = (X*Y') + (Y'*Z') + (X'*Z') If I did the everything right on paper, the s0 = Y, s1 = Z, I0 = 0, ...
Ahooey's user avatar
  • 11
1 vote
1 answer
82 views

I tried to reproduce loadable counter in Vivado 2023.1, but I cannot get expected result. My testbench file is below: `timescale 1ns / 1ps module behav_counter(); reg [7:0] d; reg clk; reg ...
kittygirl's user avatar
  • 2,513
1 vote
1 answer
94 views

Let's say we're trying to write a Verilog/SystemVerilog testbench code named SC_TB for module sample_code. Is there a more practical way of seeing what reg B and wire Cw is doing in testbench, without ...
Mister Moron's user avatar
1 vote
1 answer
67 views

I'm working on a Verilog project for the DE10-Lite FPGA board that interfaces with a 3-axis accelerometer over SPI. I have separate SPI modules (spi_ee_config) for each axis: x_info, y_info, and ...
Mayank Neupane's user avatar
1 vote
1 answer
214 views

I've recently started working with bi-directional data transfer. I wrote a simple Verilog module that takes an input in one clock cycle and returns a processed result (by adding one) after the bus ...
0BLU's user avatar
  • 758
2 votes
1 answer
76 views

The SystemVerilog spec describes a scheduler model in Figure 4-1 (p. 67 of IEEE 1800-2023). It describes a number of regions, including an Active region set and a Re-Active region set. Orthogonally, ...
garethw's user avatar
  • 53
2 votes
2 answers
109 views

In Verilog, you can declare wires/registers as ports and connect them at instantiation (port_A in example) as ports and connect them "later"/"outside" using hierarchical names (...
Anedar's user avatar
  • 4,313
1 vote
1 answer
64 views

I need to write a property to check the divisor of a fast clock. I’ve tried the following options: property clk_frequency_P(logic pll_clk, logic destination_clk, logic clk_en, logic reset, int divisor)...
Sarti's user avatar
  • 153
1 vote
1 answer
328 views

module DCP_21( input a, input b, output w, output x, output y, output z ); assign w = ~(a & b); assign x = ~(a | b); assign y = a^b; assign z = ~(...
Anushka Nair's user avatar
1 vote
1 answer
100 views

For the code below, I utilized a predefined RAM module from Quartus to create the RAM. How do I determine the port order when instantiating it? I understand it must be compatible with the module from ...
mmm's user avatar
  • 11
0 votes
1 answer
180 views

What is a good way to test the interaction between two (or more) modules using cocotb? For example, say we have a transmitter (TX) and receiver (RX) module, and we want to test them together (e.g., RX ...
pbandlead's user avatar
4 votes
2 answers
147 views

I am trying to run an LED matrix using an FPGA. The specifics are a TinyFPGA BX, wired into this board (driver chip datasheet), connected to this screen. Before this, I managed to drive this matrix ...
dhodul's user avatar
  • 43

1
2 3 4 5
128