예제 #1
0
파일: test_ipu.py 프로젝트: ljthink/pyfecs
 def test_bare_sequence(self):
     s = Sequence()
     c = compiler.Compiler()
     c.TRUNCATE = False
     c.load(s)
     compiled_sequence = c.compile(variant=0)
     print(c.instruction_list.human)
     #compiler.prettyprint(compiled_sequence)
     i = ipu.IPU()
     i.showBuffer = False
     i._RAM = compiled_sequence
     s.shots = 2
     i.nRepeats = s.shots
     i.idleState = s.hardware.idle_state ^ s.hardware.polarity_mask
     i.run()
예제 #2
0
파일: test_ipu.py 프로젝트: ljthink/pyfecs
 def test_minimal_sequence(self):
     s = Sequence.from_file(
         "./compiler/test_sequences/minimal_sequence.xml")
     c = compiler.Compiler()
     c.TRUNCATE = False
     c.load(s)
     compiled_sequence = c.compile(variant=0)
     print(c.instruction_list.human)
     i = ipu.IPU()
     i.showBuffer = False
     i._RAM = compiled_sequence
     i.nRepeats = 10
     i._spcMemoryRange[0] = (8000, 12000)
     i.idleState = s.HWConfig.idle_state ^ s.HWConfig.polarity_mask
     i.run()
예제 #3
0
 def test_compile_sequence_with_one_time_window(self):
     s = Sequence.from_file(
         "./compiler/test_sequences/sequence_with_one_time_window.xml")
     self.compiler.load(s)
     self.compiler.compile(0)
예제 #4
0
 def test_compile_minimal_sequence(self):
     s = Sequence.from_file(
         "./compiler/test_sequences/minimal_sequence.xml")
     self.compiler.load(s)
     self.compiler.compile(0)
예제 #5
0
 def test_compile_valid_sequence(self):
     validSequence = Sequence()
     self.compiler.load(validSequence)
     compiled = self.compiler.compile(0)
     logger.info(compiled)
예제 #6
0
 def test_load_valid_sequence(self):
     validSequence = Sequence()
     self.compiler.load(validSequence)
예제 #7
0
 def test_load_invalid_sequence(self):
     invalidSequence = Sequence()
     invalidSequence.length = -10
     with self.assertRaises(InvalidSequenceException):
         self.compiler.load(invalidSequence)