Line 146... |
Line 146... |
VARIABLE i_value : INTEGER := 0;
|
VARIABLE i_value : INTEGER := 0;
|
|
|
VARIABLE output_line : LINE;
|
VARIABLE output_line : LINE;
|
VARIABLE line_value : STRING(1 TO 4);
|
VARIABLE line_value : STRING(1 TO 4);
|
|
|
|
VARIABLE memory_block : INTEGER RANGE 0 TO 3 := 0;
|
|
VARIABLE address : INTEGER RANGE 0 TO 8191 := 0;
|
|
|
|
VARIABLE end_of_mem : BOOLEAN := FALSE;
|
|
|
BEGIN
|
BEGIN
|
|
|
FOR i IN 0 TO 3 LOOP
|
FOR i IN 0 TO 3 LOOP
|
array_io(i) := (OTHERS => 0);
|
array_io(i) := (OTHERS => 0);
|
END LOOP;
|
END LOOP;
|
|
|
file_open(fstatus, input_file, filename, READ_MODE);
|
file_open(fstatus, input_file, filename, READ_MODE);
|
|
|
IF fstatus = OPEN_OK THEN
|
IF fstatus = OPEN_OK THEN
|
|
WHILE NOT endfile(input_file) AND NOT end_of_mem LOOP
|
FOR i IN 0 TO 3 LOOP
|
|
FOR j IN 0 TO 8191 LOOP
|
|
-- Read the next line and put its contents in a string
|
-- Read the next line and put its contents in a string
|
readline(input_file, input_line);
|
readline(input_file, input_line);
|
read(input_line, line_value);
|
read(input_line, line_value);
|
|
|
-- Current debugging feedback
|
-- Current debugging feedback
|
Line 169... |
Line 172... |
writeline(OUTPUT, output_line);
|
writeline(OUTPUT, output_line);
|
|
|
-- Turn a hex value into an integer value
|
-- Turn a hex value into an integer value
|
read_hex(line_value, i_value);
|
read_hex(line_value, i_value);
|
|
|
array_io(i)(j) := i_value;
|
array_io(memory_block)(address) := i_value;
|
|
|
|
IF memory_block = 3 AND address = 8191 THEN
|
|
end_of_mem := TRUE;
|
|
ELSE
|
|
IF address = 8191 THEN
|
|
memory_block := memory_block + 1;
|
|
address := 0;
|
|
ELSE
|
|
address := address + 1;
|
|
END IF;
|
|
END IF;
|
|
|
write(output_line, STRING'("Index :"));
|
write(output_line, STRING'("Index :"));
|
write(output_line, i*8192+j);
|
write(output_line, memory_block*8192+address);
|
write(output_line, STRING'(" Value: "));
|
write(output_line, STRING'(" Value: "));
|
write(output_line, i_value);
|
write(output_line, i_value);
|
writeline(OUTPUT, output_line);
|
writeline(OUTPUT, output_line);
|
END LOOP;
|
END LOOP;
|
END LOOP;
|
|
|
|
file_close(input_file);
|
file_close(input_file);
|
|
|
END IF;
|
END IF;
|
|
|
Line 270... |
Line 283... |
fill_var_array(0, array_in);
|
fill_var_array(0, array_in);
|
read_file_into_var_array(array_in, filename);
|
read_file_into_var_array(array_in, filename);
|
|
|
END PROCEDURE init_var_array;
|
END PROCEDURE init_var_array;
|
|
|
-- General procedure to fill an array of integers. This is to make sure that
|
-- General procedure to fill a variable array of integers. This is to make
|
-- the array does not contain any meta-data any more.
|
-- sure that the array does not contain any meta-data any more.
|
PROCEDURE fill_var_array (
|
PROCEDURE fill_var_array (
|
CONSTANT value : IN INTEGER;
|
CONSTANT value : IN INTEGER;
|
VARIABLE in_array : INOUT cstr_array_type) IS
|
VARIABLE in_array : INOUT cstr_array_type) IS
|
|
|
BEGIN -- PROCEDURE fill_array
|
BEGIN -- PROCEDURE fill_array
|