[update] test function: print ram info
This commit is contained in:
@@ -35,7 +35,7 @@ class MultiExtMemSpiInterface(LowLevelHardwareInterface):
|
||||
'_pin_ram_sel_value', '_pin_mem_sel_value', '_pin_mem_req_value',
|
||||
'_read_green_times','_read_red_times',
|
||||
'_elite_data_len', '_mem_header_len', '_mem_tailer_len', '_single_data_len',
|
||||
'_head_wrong_cnt')
|
||||
'_head_wrong_cnt', '_last_ram')
|
||||
|
||||
def __init__(self,
|
||||
select: Selector,
|
||||
@@ -50,7 +50,7 @@ class MultiExtMemSpiInterface(LowLevelHardwareInterface):
|
||||
self._single_data_len = self._elite_data_len + self._mem_header_len + self._mem_tailer_len
|
||||
|
||||
# buffer
|
||||
self._tx_buffer_header = [0] * 19
|
||||
self._tx_buffer_header = [0] * 64
|
||||
self._tx_buffer_data = [0] * (self._single_data_len * 10 + 3)
|
||||
|
||||
# memory control pin
|
||||
@@ -74,6 +74,8 @@ class MultiExtMemSpiInterface(LowLevelHardwareInterface):
|
||||
self._pin_sel_val = [False for _ in range(Selector.SIZE)]
|
||||
self._wait_for_first_data = [True for _ in range(Selector.SIZE)]
|
||||
|
||||
self._last_ram = [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
|
||||
def set_pin_mem_req(self, value: bool):
|
||||
channel = self.select
|
||||
# if self._pin_mem_req_value[channel] == value:
|
||||
@@ -277,6 +279,12 @@ class MultiExtMemSpiInterface(LowLevelHardwareInterface):
|
||||
# print("read data_third", data_third)
|
||||
# data = self.compare_green_data(data_first, data_second, data_third, len(tx_h))
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
# print('data:', list(data))
|
||||
# print('Ram:', data[62])
|
||||
|
||||
if self._last_ram[device] == data[62]:
|
||||
print('last_ram=', self._last_ram[device], ', ram=', data[62], device, datetime.now())
|
||||
self._last_ram[device] = data[62]
|
||||
|
||||
green_data_section = self._compare_green_data_addr_and_flag(data, device)
|
||||
|
||||
|
||||
@@ -646,6 +646,7 @@ class DataServer(SocketServer, DataAPI):
|
||||
def whether_to_record(self, device):
|
||||
# if user click "start", return True; if user click "stop", return False;
|
||||
if device in self._configurations.keys() and self._configurations[device] is not None:
|
||||
# print(self._configurations.keys(), ',', device, datetime.now())
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
@@ -662,6 +663,7 @@ class DataServer(SocketServer, DataAPI):
|
||||
|
||||
else:
|
||||
data = None
|
||||
print('data=None, mem_req!=ram_sel', device, datetime.now())
|
||||
|
||||
if data is not None:
|
||||
if self._configurations[device].queue_flag:
|
||||
|
||||
Reference in New Issue
Block a user