I'm new to VHDL and I'm getting the following error when I try to compile my code:
** Error: F:\midterm night\assg 3\toplevel_design.vhd(18): near "<byte 0x93>": illegal character found in source
** Error: F:\midterm night\assg 3\toplevel_design.vhd(18): near "<byte 0x94>": illegal character found in source
** Error: F:\midterm night\assg 3\toplevel_design.vhd(18): Integer literal 0 is not of type ieee.std_logic_1164.STD_LOGIC_VECTOR.
Seems the problem is variable memory_block
assignment.
library IEEE;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity mem8_16 is
port( clk,wr_rd : in std_logic;
din : in std_logic_vector ( 15 downto 0);
addr : in std_logic_vector ( 2 downto 0);
dout : out std_logic_vector (15 downto 0));
end entity;
architecture memory of mem8_16 is
signal memory_temp :unsigned (127 downto 0);
begin
process(clk,wr_rd)
variable memory_block: integer range 0 to 7;
begin
if (rising_edge(clk))then
case addr is
when “000” => memory_block := 0;
when “001” => memory_block := 1;
when “010” => memory_block := 2;
when “011” => memory_block := 3;
when “100” => memory_block := 4;
when “101” => memory_block := 5;
when “110” => memory_block := 6;
when “111” => memory_block := 7;
end case;
if (wr_rd ='1') then
memory_temp((memory_block * 16 + 15) downto (memory_block * 16)) <= din (15 downto 0);
end if;
end if;
dout <= memory_temp((memory_block * 16 + 15) downto (memory_block * 16));
end memory;
Best Answer
The problem is that you have used some sort of word processor to create your source code, and it has inserted left- and right-double-quote characters (“ - 0x93 and ” - 0x94) rather than a proper ASCII double quote (" - 0x22) as delimiters around your string literals.
Use a code editor to edit code, and use the word processor to edit documentation.
Note also that there's no
end
statement for yourprocess
.