velu.plg
Member level 5
- Joined
- Jul 30, 2013
- Messages
- 93
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- chennai
- Activity points
- 1,974
Code VHDL - [expand] 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 71 72 73 74 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_textio.all; use std.textio.all; entity rom_using_file is GENERIC (N :INTEGER:=260); port ( ce,clk ,clk1,read :in std_logic; -- Chip Enable read_en :in std_logic; -- Read Enable address :in integer; -- Address input data :out integer; -- Data output ram1 : inout integer; c : inout std_logic ); end entity; architecture behavior of rom_using_file is -- RAM block 8x256 type RAM is array (0 to (N-1), 0 to (N-1) )of integer; signal mem : RAM ; signal inc_row,inc_colom : integer:=0; file f1 :text open write_mode is "F:\vlsi project\AV00 _samplecode\imageprocessing\in1.txt"; -- Subprogram to read a text file into RAM -- procedure Load_ROM (signal data_word :inout RAM) is -- Open File in Read Mode file romfile :text open read_mode is "F:\vlsi project\AV00 _samplecode\imageprocessing\indata.txt"; variable lbuf :line; variable i,j :integer := 0; variable fdata :integer; begin while not endfile(romfile) loop -- read digital data from input file readline(romfile, lbuf); read(lbuf, fdata); data_word(i,j) <= fdata; if (clk = '1')then i := i+1; if (i=(N-1)) then j := j+1; i:=0; end if; end if; end loop; end procedure; begin -- Procedural Call -- Load_ROM(mem); process(clk1) variable buf : line; variable i1 :integer; begin ram1 <= mem(inc_row,inc_colom); i1 := ram1; if (clk1='1')then inc_colom <= inc_colom + 1; if (inc_colom = 5)then inc_row <= inc_row + 1; if (read ='1')then write (buf ,i1); writeline (f1,buf); end if; end if; end if; end process;
this is my code ...
how to rectify this error ????
** Error: F:/vlsi project/AV00 _samplecode/imageprocessing/rom.vhdl(44): Prefix of indexed name must be an array.
** Error: F:/vlsi project/AV00 _samplecode/imageprocessing/rom.vhdl(290): VHDL Compiler exiting
Last edited by a moderator: