@@ -278,16 +278,36 @@ def parse_rxfifo_brackets(arg, fifo_dir):
278
278
# instr delay p sr index
279
279
assembled .append (0b001_00000_0_00_00000 )
280
280
polarity = int (instruction [1 ], 0 )
281
+ source = instruction [2 ]
281
282
if not 0 <= polarity <= 1 :
282
283
raise RuntimeError ("Invalid polarity" )
283
284
assembled [- 1 ] |= polarity << 7
284
- assembled [- 1 ] |= WAIT_SOURCES .index (instruction [2 ]) << 5
285
- num = int (instruction [3 ], 0 )
286
- if not 0 <= num <= 31 :
287
- raise RuntimeError ("Wait num out of range" )
288
- assembled [- 1 ] |= num
289
- if instruction [- 1 ] == "rel" :
290
- assembled [- 1 ] |= 0x10 # Set the high bit of the irq value
285
+ if instruction [2 ] == "jmppin" :
286
+ require_version (1 , "wait jmppin" )
287
+ num = 0
288
+ print ("wait jmppin" , instruction )
289
+ if len (instruction ) > 3 :
290
+ if len (instruction ) < 5 or instruction [3 ] != "+" :
291
+ raise RuntimeError ("invalid wait jmppin" )
292
+ num = int_in_range (instruction [4 ], 0 , 4 , "wait jmppin offset" )
293
+ assembled [- 1 ] |= num
294
+ assembled [- 1 ] |= 0b11 << 5 # JMPPIN wait source
295
+ else :
296
+ assembled [- 1 ] |= WAIT_SOURCES .index (instruction [2 ]) << 5
297
+ num = int (instruction [3 ], 0 )
298
+ if not 0 <= num <= 31 :
299
+ raise RuntimeError ("Wait num out of range" )
300
+ assembled [- 1 ] |= num
301
+ # The flag index is decoded in the same way as the IRQ
302
+ # index field, decoding down from the two MSBs
303
+ if instruction [- 1 ] == "next" :
304
+ require_version (1 , "wait irq next" )
305
+ assembled [- 1 ] |= 0b11000
306
+ elif instruction [- 1 ] == "prev" :
307
+ require_version (1 , "wait irq prev" )
308
+ assembled [- 1 ] |= 0b01000
309
+ elif instruction [- 1 ] == "rel" :
310
+ assembled [- 1 ] |= 0b10000
291
311
elif instruction [0 ] == "in" :
292
312
# instr delay src count
293
313
assembled .append (0b010_00000_000_00000 )
0 commit comments