Skip to content
Snippets Groups Projects
Commit 0c9b2c21 authored by ahoni's avatar ahoni
Browse files

modif

parent dbfdd4f2
No related branches found
No related tags found
1 merge request!3Dev
......@@ -220,7 +220,7 @@ begin
end if;
when wait_out_aer =>
if i_emu_ready = '1' then
if i_emu_ready = '1' and network_to_uart_busy='0' then
count_time <= '0';
if read_empty = '1' then -- no more data to process
emu_state <= push_timer;
......
......@@ -144,7 +144,7 @@ class XStep_Timer_Driver(ModNEF_Driver):
sample_aer = [transformation(input_sample[step]) for step in range(len(input_sample))]
for es in range(extra_step):
sample_aer.append([])
sample_aer.append([0, 1, 2, 3])
step_send = 0
res = [0 for _ in range(self.output_layer_size)]
......@@ -155,11 +155,11 @@ class XStep_Timer_Driver(ModNEF_Driver):
for step in range(len(sample_aer)):
next_data = []
if(len(sample_aer[step])+len(next_data) > 256**self.queue_read_width):
print(f"warning, the read queue cannot encode the len of emulation step : acutal len {len(sample_aer[step])}, maximum len {256**self.qeue_read_width}")
next_data.append(len(sample_aer[step]))
next_data.extend(sample_aer[step])
if(len(sample_aer[step]) > 256**self.queue_read_width):
print(f"warning, the read queue cannot encode the len of emulation step : acutal len {len(sample_aer[step])}, maximum len {256**self.qeue_read_width}")
if len(data) + len(next_data) > self.queue_read_depth or (step_send+1)*self.output_layer_size > self.queue_write_depth-2:
if len(data) + len(next_data) > self.queue_read_depth or step_send*self.output_layer_size > self.queue_write_depth-2:
emulation_result = self.rust_driver.data_transmission(data, False)
res_step = self._unpack_data(emulation_result)
......@@ -201,8 +201,10 @@ class XStep_Timer_Driver(ModNEF_Driver):
#print((data[0]*256 + data[1])*self.clock_period)
self.sample_time += (data[0]*256 + data[1])*self.clock_period
while index < len(data):
n_data = data[index]
index += 1
......
......@@ -257,6 +257,10 @@ class ShiftLIF(ModNEFNeuron):
self.mem = self.mem+input_
if self.hardware_estimation_flag:
self.val_min = torch.min(torch.min(input_.min(), self.mem.min()), self.val_min)
self.val_max = torch.max(torch.max(input_.max(), self.mem.max()), self.val_max)
if self.reset_mechanism == "subtract":
self.mem = self.mem-self.__shift(self.mem)-self.reset*self.threshold
elif self.reset_mechanism == "zero":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment