Commit 79fdfe39000fac45d323c883bd0b45ceceb29020

Authored by Brice Colombier
1 parent ebba46427c
Exists in master

Fix response shift on board

Showing 3 changed files with 10 additions and 7 deletions

CASCADE/cascade.py View file @ 79fdfe3
... ... @@ -42,10 +42,13 @@
42 42 indices = list(range(len(reference_response)))
43 43  
44 44 for passe in range(0, nb_passes):
  45 + print "Passe:", passe
45 46 block_size_increased = False
46 47 if block_size < len(reference_response)/2:
47 48 block_size *= 2
48 49 block_size_increased = True
  50 + print "Block size:", block_size
  51 + print "Response on board:", tclsh.eval(board_manager.offload_response())
49 52 reference_response_indexed = zip(indices, reference_response)
50 53 if passe > 0:
51 54 rd.shuffle(reference_response_indexed)
52 55  
... ... @@ -80,9 +83,9 @@
80 83 even_parity_blocks.extend(indices)
81 84 indices = fl.flatten(indices)
82 85 reference_response = fl.flatten(reference_response)
  86 + print "Indices to flip", indices_to_flip
83 87 if blocks_to_correct:
84 88 # Error correction step
85   - print indices_to_flip
86 89 fb.flip_bits(reference_response, indices_to_flip, indices)
87 90 indices_to_flip = []
88 91 blocks_to_correct = []
... ... @@ -310,14 +310,15 @@
310 310 def perform_reconciliation(self):
311 311 self.tcl_obj.eval(self.board_manager.reset_boards())
312 312 self.tcl_obj.eval(self.board_manager.generate_response())
313   - print response_converter_to_hex(self.server_reference_response)
  313 + print "Before Reconciliation:", response_converter_to_hex(self.server_reference_response)
314 314 self.server_reference_response = cascade(self.server_reference_response,
315 315 0.02,
316 316 int(self.reconciliation_parameter_number_of_passes_spinbox.get()),
317 317 self.tcl_obj,
318 318 self.board_manager,
319 319 int(self.reconciliation_parameter_initial_block_size_spinbox.get()))
320   - print response_converter_to_hex(self.server_reference_response)
  320 + print "After Reconciliation:", response_converter_to_hex(self.server_reference_response)
  321 + print "On board:\n", self.tcl_obj.eval(self.board_manager.offload_response())
321 322 print ("Reconciliation done")
322 323  
323 324 def reset_board(self):
boards_management/test_scenario.py View file @ 79fdfe3
... ... @@ -9,10 +9,9 @@
9 9 tclsh.eval(board_manager.reset_boards())
10 10 tclsh.eval(board_manager.generate_response())
11 11 print tclsh.eval(board_manager.offload_response())
12   -print tclsh.eval(board_manager.command_get_parities_from_indices([list(range(0, 4))]))
13   -print tclsh.eval(board_manager.command_get_parities_from_indices([list(range(4, 8))]))
14   -print tclsh.eval(board_manager.command_get_parities_from_indices([list(range(8, 12))]))
15   -print tclsh.eval(board_manager.command_get_parities_from_indices([list(range(12, 16))]))
  12 +print tclsh.eval(board_manager.command_get_parities_from_indices([[0, 1, 2, 3]]))
  13 +print tclsh.eval(board_manager.command_get_parities_from_indices([[4, 5]]))
  14 +print tclsh.eval(board_manager.command_get_parities_from_indices([[6, 7]]))
16 15 print tclsh.eval(board_manager.offload_response())
17 16 tclsh.eval(board_manager.generate_response())
18 17 print tclsh.eval(board_manager.offload_response())