verilog

Event scheduling in Verilog

南楼画角 提交于 2019-12-23 19:30:40
问题 I was learning about the verilog stratified event queue. I had a minor doubt about the inactive events. I understood that they are carried out after all the active events are done with at the current simulation time. But I wrote a simple code to understand the concept better but the result I got is what confuses me. Here is the code I wrote: module main; int x; initial begin $monitor("x is %0d",x); #0 x = 5; // inactive event x = 3; // active event end endmodule RESULT : x is 3. According to

Accessing inputs and outputs in sub-modules from testbench

怎甘沉沦 提交于 2019-12-23 12:39:17
问题 My device-under-test (DUT) has many sub-modules and I would like to test some of them. My test fixture will be the top level of my project - one level higher than the DUT - and since I can only seem to access the inputs and outputs of the modules one level down, I can only access the top-level inputs and outputs of the DUT. I would like to be able to access signals from the modules two or more levels beneath the test fixture, ideally without having to rewrite any modules to add more outputs

What to use to compile and simulate Verilog programs on Mac OS X 10.6.8?

天涯浪子 提交于 2019-12-23 09:30:14
问题 I am an undergrad doing my second year. I am required to simulate Verilog programs as part of my syllabus. But sadly my college uses Xilinx ISE and it isn't available for Mac. So please help me out with the best software and also some detailed steps on how to install and use them. Thanks in advance.:) :D 回答1: You could try Icarus Verilog, which is a free Verilog simulator. According to the instructions here you can install Icarus Verilog on Mac OS X. 来源: https://stackoverflow.com/questions

What does “net” stand for in Verilog?

安稳与你 提交于 2019-12-23 07:45:35
问题 I'm just starting to learn Verilog. As I understand, Verilog has net datatypes. What does net stand for? 回答1: A net is such a data type, where you don't use it for storing values. They represent physical connections. You can think of wire as a net data type. You can see more on nets here. 回答2: A net is short for network , and a network is a group of devices that share a common connection, a wire in most cases here. I wrote a short article to explain why Verilog has nets. 回答3: Nets : represent

What does “net” stand for in Verilog?

余生长醉 提交于 2019-12-23 07:45:28
问题 I'm just starting to learn Verilog. As I understand, Verilog has net datatypes. What does net stand for? 回答1: A net is such a data type, where you don't use it for storing values. They represent physical connections. You can think of wire as a net data type. You can see more on nets here. 回答2: A net is short for network , and a network is a group of devices that share a common connection, a wire in most cases here. I wrote a short article to explain why Verilog has nets. 回答3: Nets : represent

Create a Verilog Parser with Ruby

删除回忆录丶 提交于 2019-12-23 04:11:50
问题 I would like to create a Verilog parser written in Ruby for a university project I know there are parser generators like Bison and Yacc. Could anyone give me some advice on how to get started? 回答1: I already have a very basic verilog parser (gem) written in ruby called verilog, if you could consider contributing to that instead, or it might give an idea of how to start. I also have a gem called rubyit, which is command line utility to parse files with erb and generate the standard version of

Verilog blocking/nonblocking assignment in clk generator with self triggered

戏子无情 提交于 2019-12-23 01:20:08
问题 Why the following code is not self-triggered? module osc1 (clk); output clk; reg clk; initial #10 clk = 0; always @(clk) #10 clk = ~clk; always begin $monitor("%0d clk=%0d\n",$time,clk); #100 $finish; end endmodule output: # 0 clk=x # 10 clk=0 # 20 clk=1 when used non-blocking assignment it works normally i.e., always @(clk) #10 clk <= ~clk; output: # 0 clk=x # 10 clk=0 # 20 clk=1 # 30 clk=0 # 40 clk=1 # 50 clk=0 # 60 clk=1 # 70 clk=0 # 80 clk=1 # 90 clk=0 thanks in advance. 回答1: It has to do

Seven Segment Multiplexing on Basys2

我的梦境 提交于 2019-12-22 17:47:08
问题 this is my first post so I hope I'm doing this correctly. I'm trying to output a "4 3 2 1" on a four digit seven segment display on a BASYS2 board. I have checked to make sure that 0 enables the signal and that I have the ports mapped correctly. I believe the error is within my multiplexing logic since I am only able to display a single digit. I'm new to Verilog (am used to C) and would appreciate any suggestions. Thanks `timescale 1ns / 1ps module main (clock, AN0, AN1, AN2, AN3, CA, CB, CC,

How do I write a regex to match the module instantiation in a Verilog file?

不打扰是莪最后的温柔 提交于 2019-12-22 10:44:43
问题 I am working on a project to facilitate verilog programming by using perl scripting language. Now I want to write a script to scan a top verilog file, and then generate the hierarchy list for the module, which suggests that I need to extract the module instantiation statement from the verilog file, here is the problem: How to write a regular expression to match the module instantiation in a verilog file, since we need to know the submodule names of the top module file. 回答1: The SYNOPSYS of

difference between blocking and non blocking statements with intra-assignment delay

坚强是说给别人听的谎言 提交于 2019-12-22 10:03:55
问题 What is the difference between the following 2 snippets of verilog code? 1) always@(in) out = #5 in; AND 2) always@(in) out <= #5 in; Considering no other lines are present in the always block, can there be any difference in output? question is in reference to slide 16 (see o5 and o6 outputs) http://www.sutherland-hdl.com/papers/1996-CUG-presentation_nonblocking_assigns.pdf 回答1: out = #5 in; blocks the next operation for 5 time units. It will prevent the monitoring of the next @(in) until the