F
Frank van Eijkelenburg
Guest
Hi,
I'm new to VHDL and try to make some simple programs. Below I try to make an
entity that gives the contents of a specified address at the databus.
However, the compiler gives the following error:
# ERROR: C:/project/VHDL/project/sram/sram.vhd(58): Type error in variable
address. Needed type integer.
So the question is: how can I convert the value present at the address bus
to an integer? Or is there a better way to get this working??
TIA,
Frank
entity sram is
port(chip_enable : in bit;
output_enable : in bit;
address : in bit_vector (3 downto 0);
data : out std_logic_vector (3 downto 0));
end sram;
architecture behaviour of sram is
constant sram_size : Integer := 15;
type sram_mem is array (0 to sram_size) of std_logic_vector (0 to 3);
signal memory : sram_mem;
begin
get_data : process(address)
begin
if (chip_enable = '0' and output_enable = '0') then
-- get data from selected address
data <= memory(address);
else
data <= (others => 'Z');
end if;
end process;
end behaviour;
I'm new to VHDL and try to make some simple programs. Below I try to make an
entity that gives the contents of a specified address at the databus.
However, the compiler gives the following error:
# ERROR: C:/project/VHDL/project/sram/sram.vhd(58): Type error in variable
address. Needed type integer.
So the question is: how can I convert the value present at the address bus
to an integer? Or is there a better way to get this working??
TIA,
Frank
entity sram is
port(chip_enable : in bit;
output_enable : in bit;
address : in bit_vector (3 downto 0);
data : out std_logic_vector (3 downto 0));
end sram;
architecture behaviour of sram is
constant sram_size : Integer := 15;
type sram_mem is array (0 to sram_size) of std_logic_vector (0 to 3);
signal memory : sram_mem;
begin
get_data : process(address)
begin
if (chip_enable = '0' and output_enable = '0') then
-- get data from selected address
data <= memory(address);
else
data <= (others => 'Z');
end if;
end process;
end behaviour;