diff --git a/cmake/fpga/uart_programmer/uart_programmer.py b/cmake/fpga/uart_programmer/uart_programmer.py index c228248..222b05b 100644 --- a/cmake/fpga/uart_programmer/uart_programmer.py +++ b/cmake/fpga/uart_programmer/uart_programmer.py @@ -19,18 +19,30 @@ def program( text_bytes = b'' for line in text_lines: line = line.strip() - byte_data = bytes.fromhex(line) - byte_data = bytearray(byte_data) - byte_data.reverse() - text_bytes += byte_data + + if line.startswith('@') or line == '': + continue + + words = line.split() + for word in words: + byte_data = bytes.fromhex(word) + byte_data = bytearray(byte_data) + byte_data.reverse() + text_bytes += byte_data data_bytes = b'' for line in data_lines: line = line.strip() - byte_data = bytes.fromhex(line) - byte_data = bytearray(byte_data) - byte_data.reverse() - data_bytes += byte_data + + if line.startswith('@') or line == '': + continue + + words = line.split() + for word in words: + byte_data = bytes.fromhex(word) + byte_data = bytearray(byte_data) + byte_data.reverse() + data_bytes += byte_data num_text_bytes = len(text_bytes).to_bytes(4, byteorder='little') num_data_bytes = (len(data_bytes)).to_bytes(4, byteorder='little') diff --git a/cmake/sim/verilator/verilate.cmake b/cmake/sim/verilator/verilate.cmake index c237a12..5332c9d 100644 --- a/cmake/sim/verilator/verilate.cmake +++ b/cmake/sim/verilator/verilate.cmake @@ -71,8 +71,8 @@ function(verilate IP_LIB) endforeach() get_ip_rtl_sources(SOURCES ${IP_LIB}) - # Where is defined V_SOURCES (or is it always empty)? - list(PREPEND SOURCES ${V_SOURCES}) + get_ip_sim_only_sources(SIM_SOURCES ${IP_LIB}) + list(PREPEND SOURCES ${SIM_SOURCES}) get_ip_sources(CFG_FILE ${IP_LIB} VERILATOR_CFG) list(PREPEND SOURCES ${CFG_FILE})