![]() |
|
|
|||||||
![]() |
VHDL - Using loop vars in a testbench |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Is it possible to assign the value of a loop variable to a
std_logic_vector? I'm trying to make the following code work: --A : in std_logic_vector(7 downto 0); for i in 0 to 15 loop A <= --gets value of i wait for 20 ns; loop; Does anyone know the library and type conversion function that I can use to assign the loop variable (which I think is of type integer) to A, which is type std_logic_vector, width=8? Thanks. sku11monkey |
|
|
|
|
#2 |
|
Posts: n/a
|
http://www.vhdl.org/vi/comp.lang.vhdl/FAQ1.html#4.8.1
Will answer all your question. Egbert Molenkamp "sku11monkey" <> schreef in bericht news:YrKdnRZcXYOVg6zdRVn-... > Is it possible to assign the value of a loop variable to a > std_logic_vector? I'm trying to make the following code work: > > --A : in std_logic_vector(7 downto 0); > > for i in 0 to 15 loop > A <= --gets value of i > wait for 20 ns; > loop; > > > Does anyone know the library and type conversion function that I can use to > assign the loop variable (which I think is of type integer) to A, which is > type std_logic_vector, width=8? > > Thanks. Egbert Molenkamp |
|
|
|
#3 |
|
Posts: n/a
|
i) Your declaration (A: in std_logic_vector(7 downto 0)
an input port to the entity (?) You cannot assign to input ports. ii) Assuming the above is just a typing error the following code seems to compile fine for me: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; Grigorios Angelis |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| loop according to the delay | kavidream24 | Software | 0 | 12-23-2008 02:18 AM |
| Xilinx 7.1 and testbench error | boitsas | Software | 0 | 01-15-2008 04:14 PM |
| Catalyst 2960 loop problem...Help me some one plz | dorjko | Hardware | 1 | 12-13-2007 06:10 AM |
| Phase locked loop VHDL code | mreddy.a | Hardware | 0 | 09-16-2007 09:43 AM |
| Keeping in the loop | DavidRivers@vnet.net | DVD Video | 0 | 02-13-2006 05:02 AM |