Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Initializing a signal externally

Reply
Thread Tools

Initializing a signal externally

 
 
jjsandoval1962@aol.com
Guest
Posts: n/a
 
      01-16-2009
How can one initialize a signal inside an entity from the outside
world?

I have an Entity named "Spi_slave" and I have the need to initialize
it at any time during my simulation run from my testbench without
having to use a system clock or reset.

In Verilog I would easily accomplish this by using a hierarchical call
such as:

Spi_slave.mem_index = 0;

Regards,
Jose

=============this is the code==================================
signal mem_index: std_logic_vector (07 downto 00):= (others
=>'0');

begin -- beginning of behav

main: process
begin

for i in 1 to 8
loop
wait until spi_clk_fixed'event and spi_clk_fixed = '1' and
spi_clk_fixed'last_value = '0';
data_in <= data_in( 06 downto 00 ) & mosi;
end loop;

wait for 1 * PERIOD;
mem(conv_integer(mem_index)) <= data_in;
wait for 1 * PERIOD;
mem_index <= mem_index + 1;
print("... SPI: << data is >> "& hstr(data_in)& "h");


end process main;

end behav;
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      01-16-2009
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> How can one initialize a signal inside an entity from the outside
> world?
>
> I have an Entity named "Spi_slave" and I have the need to initialize
> it at any time during my simulation run from my testbench without
> having to use a system clock or reset.



Because that entity is a not a synthesis model anyway
I could either package the signal mem_index,
or make it an input port.

-- Mike Treseler

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
jboss will not work externally Dean Harper Java 0 06-12-2006 07:44 PM
Close a socket externally drs Python 7 10-02-2004 08:02 AM
Externally Linking Paul Kirby C++ 7 06-28-2004 11:20 PM
open page externally when click on hyperlink inside datagrid Marshal Antony ASP .Net 2 02-27-2004 08:47 AM
COM - Excel: What happens if users closes workbook externally? Marc Python 2 10-13-2003 04:32 AM



Advertisments