Bonjour
Voilà, j'ai un programme en vhdl d'une mémoire ROM qui est le suivant :
et j'ai un fichier texte qui s'appelle fichiertoto qui contient les 256 lignes de 32 bits mais mon problème est que je ne sais pas comment faire appel à ce fichier texte depuis mon programme en vhdl.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70 library IEEE; use std.textio.ALL; use ieee.std_logic_textio.all; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity ROM is port ( REMM: OUT STD_logic_vector(31 downto 0); H:in std_logic; eremm: IN std_logic; address: in std_logic_vector(2 downto 0)); end ROM ; architecture behavioral of ROM is type blocrom is array(0 to 255) of bit_vector(31 downto 0); impure function Norm (FichierToto : in string) return blocrom is FILE Fichrom : text is in FichierToto variable ls : line; variable RAMM : blocrom; begin Boucle : for I in blocrom'range loop readline (Fichrom, ls); read (ls, RAMM(I)); end loop Boucle; return RAMM; end function; signal RAMM : blocrom := Norm(B"00011010001111000010111110111101"); process(h) begin if h'event and h = '1' then if eRemm = '1' then REMM <= to_stdlogicvector(RAMM(conv_integer(<address>))); end if; end if; end process; end Behavioral;
Je vous remercie d'avance.
Partager