Simple Project Simulation Example

Lets Consider a simple full adder project:
`timescale 1ns / 1ps
module add(var1,var2,add,clk,cin,cout);
input [3:0] var1;
input [3:0] var2;
output reg [3:0] add;
input clk;
input cin;
output reg cout;
always @ (posedge clk) begin
{cout,add}=var1+var2+cin;
end
endmodule
This this the adder module
`timescale 1ns / 1ps
module top();
reg [3:0] var1;
reg [3:0] var2;
wire [3:0] add;
reg cin;
wire cout;
reg clk=0;
add A1(.cin(cin),.cout(cout),.add(add),.var1(var1),.var2(var2),.clk(clk));
initial begin
var1=3;
var2=2;
cin=1;
end
initial #2 $finish;
initial begin
forever
#1 clk=~clk;
end
endmodule
This code is only used for simulation purpose.
Can anybody explain what mistake i am doing?
I have attached the snapshots for Behavioural simulation,Post synthesis functional Simulation and Post synthesis Timing Simulation.

HI,
When you create a test bench, remember that the GSR pulse occurs automatically in the post-synthesis and post-implementation simulation. This holds all registers in reset for the first 100 ns of the simulation.
As mentioned by muzaffer you are not waiting long enough to get out of the GSR condition.
Change the initial statemnet as below and you will be able to see the expected results.
initial #102 $finish;
For more details on GSR please refer to below user guide Global set and Reset section.
http://www.xilinx.com/support/documentation/sw_manuals/xilinx2015_2/ug900-vivado-logic-simulation.pdf
The following bullets are recommendations for creating an effective test bench.
• Always specify the `timescale in Verilog test bench files.
• Initialize all inputs to the design within the test bench at simulation time zero to properly begin simulation with known values.
• Apply stimulus data after 100ns to account for the default Global Set/Reset (GSR) pulse used in UNISIM and SIMPRIMS-based simulation.
• Begin the clock source before the Global Set/Reset (GSR) is released
 

Similar Messages

  • I PXI 1010 with Digital Osci, RIO cards. Any simple projects to illustrate PXI with Signal Express and/or using Digital Osc.?

    I have PXI 1010 with card for Digital Osc. Also have ELVIS. Any suggestions on oa simple project to illustrate applications of PXI - using Dig OSc and/or ELVIS. Any suggestions to illustrate PXI with Signal Express exercises. This is for undergraduates in EE Engg.

    Hi, yes, that does help, thank you for your reply.  Signal express does make it easy to work with multiple devices, as I am, though something seems to be amiss with the timing between cards.  For example, setting Signal Express to do nothing more than log data at 100 pts/sec on all channels on all three cards (PCI-6289), and using the software trigger in Signal Express to start the digitization process, and the stop button, to stop data logging, certainly seems to be a very convenient solution.  However, the longer I record (an hour seems to be enough time), the more likely that a signal recorded on all three cards, will not synch, point to point, (comparing signals recorded on channel 0 on all three cards, which I believe should be captured simultaneously through out the recording process, for example) and data recording does not stop simultaneously on all three cards.  I can handle the data logging not stopping simultaneously, but my source signal apparently not being recorded synchronously is a whole other problem, and the impetus for my question.  Thanks for the tip about NI-SCOPE, I was going to start working with that on a different project.
    I am using the most recent versions of SignalExpress, NIDAQmx drivers, etc., on a PC running 64-bit windows 7.
    regards,
    Brian

  • Simple Elevator Simulator

    Hello all. I am trying to create a simple elevator simulator that uses up and down buttons to call the elevator and floor buttons to choose the desired floor. The goal is to display the current floor the elevator is on using LEDs and using a delay with the LEDs to simulate movement. Currently, I am trying to use a queue based state machine to do this. I have tried looking for the "Multiple Notifiers - elevator example" in the example finder and my version of LabVIEW doesn't have that apperently, but I doubt that will help anyways since I'm using queues. Are there any good examples or concepts out there that can help me out? I appreciate the help.

    Apparently that llb did not make the cut for inclusion in the 2013 shipping examples
    the attachment is a zipped version of the llb from 2012
    Jeff
    Attachments:
    notifier.zip ‏101 KB

  • Error in Simple Input Form Example for CE 7.1?

    Hi @,
    I am trying to execute Simple Input form example in sdn for CE 7.1. But its not working as per the functionality.
    Can anyone suggest what is the issue ?
    Regards,

    hi,
    This particular example is given in the sdn and is for ce 7.1 but its not working .
    Regards

  • A simple project

    Hi All,
    I need to do a simple project like
    1.Using DBMS_JOB package read some data from the table and output the result into a flat file at definite intervals.
    2.Now submit another dbms_job to read that flat file and store the contents into another table.
    now the thing should be like every 1/2 hour the job should append the data into the flat file and every 1 hour the flat file should be read through another dbms_job to store the contents of the file into another table.
    Please help me on this

    i need some guidelines to where can i find the docs on DBMS_JOBThe documentation for DBMS_JOB is where you might expect to find it, that is in the Supplied PL/SQL packages manual. You might also want to read the relevant chapter in the Administrator's guide.
    Cheers, APC

  • Simple Java DB example

    I am using Java 1.6 and Eclipse Galelio on Vista, Do I need to configure anything is there any story of setting path?
    How to check my Java DB is working or not or everything is fine or not?
    I found many totorial with simple Java DB example but they seem dealing with previous version of JDK, I guess SUN too on http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javadb/ , kindly provide me the simplest example which uses Java DB.
    I am not able to figure out the whole thing of JAVA DB , how it works, in plain language I want to know is there any way of interacting with database from Command prompt? If so how?

    When I am running a simpleApp.java
    I am getting this error:
    Unable to load the JDBC driver org.apache.derby.jdbc.EmbeddedDriver
    Please check your CLASSPATH.
    java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at SimpleApp.loadDriver(SimpleApp.java:414)
         at SimpleApp.go(SimpleApp.java:125)
         at SimpleApp.main(SimpleApp.java:93)
    ----- SQLException -----
    SQL State: 08001
    Error Code: 0
    Message: No suitable driver found for jdbc:derby:derbyDB;create=true
    SimpleApp starting in embedded mode
    SimpleApp finished

  • Simple XML DOM Example Needed.

    I need a simple XML DOM Example that reads in the XML and makes objects out of the elements. The tutorial from sun is very sketchy and seems to good far too quickly.
    Thanks,
    Dave.

    You can find some examples:
    http://java.sun.com/xml/jaxp/dist/1.0.1/examples/#building
    http://newinstance.com/writing/javaxml2/javaxml2_examples.html
    http://www.docuverse.com/domsdk/index.html#tutorial
    http://www.devx.com/sourcebank/search.asp

  • Quotations from Project Simulation Version

    Hi experts,
    We are creating project quotations using DP81. We create multiple quotations for the same inquiry using Project Simulation Version.
    We would like to know from which version the quotation document has been created, is it possible?
    Or can you suggest any workaround?
    Thanks

    Hi,
    Both options, as in DP81 we are able to select simulations versions.
    But onces the quotations has been created we can't know the source. we know the project as is informed in the account assignment but not the simulation version we have used.
    Has anybody faced this issue before?

  • Project Simulation Version

    Hi,
    Is there any Function Module or BAPI to extract all details of PRoject Definitions and WBS element and Network Activities for Project simulation Version/Version key.
    Thanks
    Ramesh

    Hi,
    Both options, as in DP81 we are able to select simulations versions.
    But onces the quotations has been created we can't know the source. we know the project as is informed in the account assignment but not the simulation version we have used.
    Has anybody faced this issue before?

  • How to migrate PS Project Simulation into SAP PS Project

    Do you know a way to transfer PS Project Simulation into SAP (Transaction CJV1). You can't use BAPI BAPI_BUS2001_SAVE and BAPI_BUS_2054_MULTI as for ordinary PS-project and WBS..
    Regards
    Bertil

    Yes, I have been looking at that function, but you can't create project simulation with that function
    Regards

  • Get Project Simulation Hierarchy

    Hi All,
    Hi All,
    I have a requirement that I need to get the project simulation
    WBS hierarchy using the simulation version and the project
    number.
    For normal operative networks, I use the function modules
    BAPI_PROJECT_GETINFO &
    BBP_PS_PROJECT_GET_LIST to get the project hierarchy.
    I could not find a function module for the simulations though.
    Please let me know if there exists a function module or the
    procedure for arriving at the hierarchy for simulations.
    I know we can use the VSPRHI_CN table however the logic
    is going to be tricky. I was wondering if there is an easier
    way of doing it.
    I thank you in advance for any help in this regard.
    Thanks,
    Vamsee

    I suggest to use logical database PSJ

  • CS3 - Simple Project - DVD-R Plays in Sony, NOT Panasonic!!

    Hi all - I am following this thread with some interest. I am having the exact same issues with Encore CS3. VERY simple project, it all checks out fine, previews perfectly.
    My questions are:
    I have an interesting issue on my first use in anger of CS3.
    Does CS3 burn an "appendable" disk? I think it does! If so, will that affect DVD player compatibility?
    I have tried direct burning to DVD-R (Verbatim), and it plays fine on my SONY DVD player, but comes up as "Unsupported" on my Panasonic standalone DVD/HDD recorder drive. Is this a DVD player firmware issue?
    If so - I guess I need to find out how to close the disk through Adobe CS3. (Note I have tried closing these DVD-R's through another application such as Roxio 10, but it craps out stating it thinks there is like 400GB free on the disk!!)
    Other things I have tried include building an ISO file AND a DVD folder, neither of which will burn using Cyberlink DVD Suite. THey are not recognised! Arrgh. Any ideas?
    Anything else I can try would be MOST useful!!
    >Joe

    Well I now have a few more tidbits to add... I have burnt the same avi file using Roxio 10 & it's DVD creator application, using menus etc. Success! So it's not the BD-R disc format, as I'm using the same brand etc throughout all this.
    The only other problem I'm having is the audio which seems to drift around 0.2 and 0.7 (or so) seconds across the picture! (the original avi file is bang on). Is there any generic method to investigate the cause of such an issue now?

  • Project Plan Example for a Office 365

    Hi, 
    Help, please. 
    I need a Project Plan Example for a Office 365 implementation.
    Thanks in advanced.

    Hi Efebo,
    Please refe to the link below.
    http://www.aventurasoft.com/Office365Migration-DetailedProjectPlan.pdf
    Regards,
    Charlie Liao
    TechNet Community Support
    Thank you very much!!!

  • Installer for simple project

    I am having a huge problem building an installer.  To demonstrate I have created a very simple project (see attached zip file).
    It consists of a VI that does very little
    a text file named text.txt which the VI reads and displays
    a folder named tree db with three subfolders.  Each of the subfolders has a text file named leaf
    My goal is to build the project, build an installer and run the installer on a target machine. The result should be that the target machine will have the exe, the text file and the folder tree (as well as the LV runtime, of course).  
    I have managed to do this in the past but for some reason I am really floundering. First, if I put the folder in the build I get a name conflict even though I have checked "preserve disk heirarchy and then in the install spec I don't see how to include the tree db folder and the text file.
    I have tried everything I can think of without success.  Can anyone help?
    Regards,
    David
    Attachments:
    build testbed.zip ‏10 KB

    I'm sorry but I am not in a place where I can look at your code right now. To see a configuration that works, check out the post from my blog that you will find here. At the bottom of the post is the archived project in my SVN repository. In this project I am including a database file, but the process is the same for any non-LV file.
    I first include the non-LV file. I then created a destination for it (in this case called _repos) and then in the source file setting told the builder to put the file in _repos. At this point the preview will show it in the right place.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Help with a simple project

    I am new to writing in Java. I've been slacking probably more than I should be, and I have a small project that is due on Thursday for my class. Currently, I know how to write in C++ and C++ only. If someone could help me in writing the simple code for my project, that would be great.
    The program is simple. It should allow a user to input a string of digits, and then output the sum of those digits.
    For example; the user inputs 3563
    the program would then output 17 (3+5+6+3)
    Thanks for any help.

    well, i think I figured out how to do this, except I am having a small error. Here is my code;
    public class digitsum {
        public static void main(String[] args)
            throws java.io.IOException {
            int number = 0;
            int sum = 0;
            System.out.println("Enter an integer number: ");
            number = (int) System.in.read();
            System.out.print(+number);
            do
                sum = sum+(number%10);
                number = number/10;
            }while(number>0);
            System.out.print(" The sum is " +sum);
    Now when I run the program, it is clear that it is correctly calculating the sum, but for some reason it converts the number which the user inputs into something else.
    For example, here is a test run of my program;
    Enter an integer number:
    56
    53 The sum is 8
    56 is the number I input, and 53 is the number the program reads. As you can see, it says the sum is 8 (which is correct for 53, but I entered 56).
    I am confused.

Maybe you are looking for

  • How to use COM component in Forms 6.0 ??

    Dear All, We are developing Retail-Chain s/w and have a 3rd party s/w for credit card and they give a .dll (not a ordinary dll ), .tlb file and sample VB code to integrate the 3rd party s/w. Now i want to do the same task in my application using Form

  • Business area wise TDS certificate

    How to take out TDS certificate on business area wise Plz guide I will assign points Regards Raj

  • Unicode numbers in AI CS2

    Hi there, Is there any possibility in Illustrator CS2 to find out a single character's Unicode number after having marked it before? I'm gonna have to establish character translation charts between Freehand MX (for Apple) and AI CS2 (for PC). As you

  • My 2014 MacBook Pro with retina displays crashes when I run Premiere Pro CS5

    Hi, I just purchased a 2014 MacBook Pro with Retina display with the following specs: 2.8GHz Quad-core Intel Core i7, Turbo Boost up to 4.0GHz  16 GB 1600MHz DDR3L SDRAM Intel Iris Pro Graphics and NVIDIA GeForce GT 750M with 2GB of GDDR5 memory I am

  • Does Logic 8.0.2 work with OS 10.6.7?

    I need to upgrade my Sibelius 3.1.3 to version 7 - I currently have OS 10.4.11 but the minimum requirement is OS 10.6.7. I've just put in 8GB RAM as a start. If I get 10.6.7 I'm not sure whether Logic 8.0.2 will still work. Also wondering which other