From: Vladimir Burian Date: Wed, 15 Jun 2011 06:10:06 +0000 (+0200) Subject: Wave_table initialization data format modified. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/fpga/pwm.git/commitdiff_plain Wave_table initialization data format modified. It's no longer necessary to have initialization file with as many lines as is the wave_table size. If the initialization file is shorter then the file is read again from its first line. So the initialization file can contain commutation profile values of one period only. Signed-off-by: Vladimir Burian --- diff --git a/wave_table.vhd b/wave_table.vhd index 5637e48..af6ef6c 100644 --- a/wave_table.vhd +++ b/wave_table.vhd @@ -50,6 +50,14 @@ architecture behavioral of wave_table is begin for i in wave_table_t'range loop readline(table_file, file_line); + + if endfile(table_file) then + file_close(table_file); + file_open(table_file, file_name, read_mode); + + readline(table_file, file_line); + end if; + read(file_line, table(i)); end loop;