1/1

|
how to assign value to in port in vhdl
by ihsankocak on Dec 31, 2011 |
ihsankocak
Posts: 6 Joined: Oct 2, 2011 Last seen: Mar 28, 2012 |
||
|
hi, i am new to vhdl so this question may be easy for you.my question is:inorder to debug a vhdl program i want to assign a value to a in port.my port declaration is:
DATA_I : in std_logic_vector(7 downto 0); i use modelsim simulator, do you have any idea how to assign a value to in port, for debugging? Regards. |
|||
|
RE: how to assign value to in port in vhdl
by rogerkoehler on Dec 31, 2011 |
rogerkoehler
Posts: 1 Joined: Sep 1, 2010 Last seen: Jul 3, 2014 |
||
|
The simplest way in modelsim is to use the "force" command. When you start the simulation, type this command in the console window, and it will display the syntax options, or you can right click on the signal in the wave viewer and choose "force" from the menu. Have fun!
|
|||
|
RE: how to assign value to in port in vhdl
by hga3 on Dec 31, 2011 |
hga3
Posts: 4 Joined: Mar 18, 2009 Last seen: Apr 30, 2012 |
||
|
Hi,
This is an easy task with ModelSim. You have two opportunities to generate input stimuli on a certain port. Use a VHDL testbench where you include the device under test (DUT). An other way of generating signals on a certain port is by using a macro file (do-file) in ModelSim. How to do so is described in detail in this tutorial: http://www.tkt.cs.tut.fi/tools/public/tutorials/mentor/modelsim/getting_started/gsms.html Best wishes, Andreas |
|||
|
RE: how to assign value to in port in vhdl
by ravivlsiii on Jan 1, 2012 |
ravivlsiii
Posts: 45 Joined: Jul 4, 2008 Last seen: Feb 8, 2014 |
||
|
Follow Below Steps;
1. Make New tb_top.vhd file 2. Instance Your Module 3. use random directive for your module input or write initial block Example : initial begin DATA_I = 8'h0; @(posedge clk); DATA_I = 8'h1; @(posedge clk); DATA_I = 8'h2; . . . end or random_i = $random; module_name rand( .clk(clk), .rst(rst), .DATA_I(random_i) ); I hope this will help.....let me know if you need more detail... Regards, Ravi |
|||
|
RE: how to assign value to in port in vhdl
by ihsankocak on Jan 2, 2012 |
ihsankocak
Posts: 6 Joined: Oct 2, 2011 Last seen: Mar 28, 2012 |
||
|
thanks rogerkoehler, hga3 and ravivlsiii, i see your solutions at the same time, i thought that the third one(ravivlsiii's solution) was easy for me and applied it, it worked like a charm.thanks all again.
|
|||
|
RE: how to assign value to in port in vhdl
by ravivlsiii on Jan 2, 2012 |
ravivlsiii
Posts: 45 Joined: Jul 4, 2008 Last seen: Feb 8, 2014 |
||
|
for improve or share knowledge join my community in www.linkedin.com....create your profile and send me friend request to ravilife4rohit@yahoo.com
|
|||
1/1

