]> rtime.felk.cvut.cz Git - fpga/pwm.git/commitdiff
Wave_table initialization data format modified. master
authorVladimir Burian <buriavl2@fel.cvut.cz>
Wed, 15 Jun 2011 06:10:06 +0000 (08:10 +0200)
committerVladimir Burian <buriavl2@fel.cvut.cz>
Wed, 15 Jun 2011 06:10:06 +0000 (08:10 +0200)
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 <buriavl2@fel.cvut.cz>
wave_table.vhd

index 5637e48cc1cc736c319dfaed61178e6a5b52bb15..af6ef6cde4d3a7904a4c6cd10f76a4777d297d98 100644 (file)
@@ -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;