OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [scripts/] [rpc/] [events.py] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
"""
2
 @copyright  Copyright 2017 GNSS Sensor Ltd. All right reserved.
3
 @author     Sergey Khabarov - sergeykhbr@gmail.com
4
 @brief      Simulator API asynchronous events implementation.
5
"""
6
 
7
import threading
8
 
9
class ConsoleSubStringEvent(object):
10
    def __init__(self, template):
11
        self.template = template
12
        self.event = threading.Event()
13
        self.event.clear()
14
 
15
    def callback(self, s):
16
        if self.template in s:
17
             self.event.set()
18
 
19
    def wait(self, sec=None):
20
        if self.event.wait(sec) != True:
21
             raise ValueError('ConsoleSubString timeout')

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.