VHDL - Qualified Expression must match the type that is implied for the expression by context -


this question continuation my last question.

as mentioned before, i'm trying interface classic hd44780 lcd. have implemented local ram write data wish show on display.

the ram defined way (slight change last question):

type ram_type array (integer range <>) of std_logic_vector(7 downto 0); signal lcd_mem : ram_type(0 16*2-1); 

i display bunch of constant characters , number in location on lcd, tried doing writing directly lcd_mem way:

lcd_mem <= (0 => x"45", 1 => x"72", 2 => x"72", 3 => x"6f", 4 => x"72", 5 => x"73", 6 => x"3a", 15 => x"30",    16 => x"54", 17 => x"58", 18 => x"3a", 30 => x"4d", 31 => x"3a", others => x"20"); 

line 79:

lcd_mem(22 28) <= get_ascii(1234567); --to_integer(unsigned(n_bits(39 downto 20))) 

the integer 1234567 later replaced to_integer comment.

i have written get_ascii function supposed convert integer bcd representation , ascii adding 0x30 bcd representation. here part of function:

variable num    : ram_type(0 16*2-1); variable temp   : std_logic_vector(number'range); variable bcd    : unsigned ((4*7-1) downto 0) := (others => '0'); . . . num(0) := std_logic_vector(bcd(3 downto 0) + x"30"); num(1) := std_logic_vector(bcd(7 downto 4) + x"30"); num(2) := std_logic_vector(bcd(11 downto 8) + x"30"); num(3) := std_logic_vector(bcd(15 downto 12) + x"30"); num(4) := std_logic_vector(bcd(19 downto 16) + x"30"); num(5) := std_logic_vector(bcd(23 downto 20) + x"30"); num(6) := std_logic_vector(bcd(27 downto 24) + x"30");           return num; 

when compiling i'm getting following error:

error (10511): vhdl qualified expression error @ display_ber.vhd(79): get_ascii type specified in qualified expression must match ram_type type implied expression context

i can't quiet understand meaning of message. have tried defining shorter variable of ram_type(0 6) receive value get_ascii function didn't help.

ok, apparently happen because defined type "ram_type" in both package , architecture.

after deleting "ram_type" definition in architecture error gone.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -