code stringlengths 3 6.57k |
|---|
write_transport(self, data, timeout_sec) |
server.TransportClosedError() |
self._transport.write(data, timeout_sec) |
_set_nonblock(fd) |
fcntl.fcntl(fd, fcntl.F_GETFL) |
fcntl.fcntl(fd, fcntl.F_SETFL, flag | os.O_NONBLOCK) |
fcntl.fcntl(fd, fcntl.F_GETFL) |
assert (new_flag & os.O_NONBLOCK) |
_lookup_baud_rate(cls, options) |
options.get("zephyr_base", os.environ["ZEPHYR_BASE"]) |
sys.path.insert(0, os.path.join(zephyr_base, "scripts", "dts") |
sys.path.pop(0) |
dtlib.DT(BUILD_DIR / "zephyr" / "zephyr.dts") |
dt_inst.get_node("/chosen") |
to_path() |
to_num() |
_LOG.debug("zephyr transport: found UART baudrate from devicetree: %d", uart_baud) |
_find_nrf_serial_port(cls, options) |
_get_device_args(options) |
com_ports.split("\n") |
line.split() |
_find_openocd_serial_port(cls, options) |
openocd_serial(options) |
serial.tools.list_ports.grep(serial_number) |
len(ports) |
_find_jlink_serial_port(cls, options) |
cls._find_openocd_serial_port(options) |
_find_serial_port(cls, options) |
_get_flash_runner() |
cls._find_nrf_serial_port(options) |
cls._find_openocd_serial_port(options) |
cls._find_jlink_serial_port(options) |
RuntimeError(f"Don't know how to deduce serial port for flash runner {flash_runner}") |
__init__(self, options) |
open(self) |
self._find_serial_port(self._options) |
serial.Serial(port_path, baudrate=self._lookup_baud_rate(self._options) |
close(self) |
self._port.close() |
read(self, n, timeout_sec) |
self._port.read(n) |
server.IoTimeoutError() |
write(self, data, timeout_sec) |
len(data) |
self._port.write(data) |
ZephyrQemuMakeResult(enum.Enum) |
__init__(self, options) |
queue.Queue() |
open(self) |
pathlib.Path(tempfile.mkdtemp() |
os.mkfifo(self.write_pipe) |
os.mkfifo(self.read_pipe) |
copy.copy(self.kwargs["env"]) |
os.environ.copy() |
str(self.options["gdbserver_port"]) |
self._wait_for_qemu() |
os.open(self.read_pipe, os.O_RDWR | os.O_NONBLOCK) |
os.open(self.write_pipe, os.O_RDWR | os.O_NONBLOCK) |
_set_nonblock(self.read_fd) |
_set_nonblock(self.write_fd) |
close(self) |
os.close(self.write_fd) |
self.proc.terminate() |
self.proc.wait(5.0) |
self.proc.kill() |
os.close(self.read_fd) |
shutil.rmtree(self.pipe_dir) |
read(self, n, timeout_sec) |
server.read_with_timeout(self.read_fd, n, timeout_sec) |
write(self, data, timeout_sec) |
bytearray() |
enumerate(data) |
to_write.append(b) |
escape_pos.append(i) |
to_write.append(b) |
server.write_with_timeout(self.write_fd, to_write, timeout_sec) |
_qemu_check_stdout(self) |
str(line) |
_LOG.info("%s", line) |
self._queue.put(ZephyrQemuMakeResult.QEMU_STARTED) |
re.sub("[^a-zA-Z0-9 \n]", "", line) |
target (\w*) |
re.search(pattern, line, re.IGNORECASE) |
self._queue.put(ZephyrQemuMakeResult.MAKE_FAILED) |
self._queue.put(ZephyrQemuMakeResult.EOF) |
_wait_for_qemu(self) |
threading.Thread(target=self._qemu_check_stdout, daemon=True) |
start() |
self._queue.get(timeout=120) |
TimeoutError("QEMU setup timeout.") |
RuntimeError("QEMU setup failed.") |
ValueError(f"{item} not expected.") |
server.main(Handler() |
Copyright (c) |
files (the "Software") |
PerlmutterHvp(Serializable) |
__init__(self, num_slices=1) |
Serializable.quick_init(self, locals() |
update_opt(self, f, target, inputs, reg_coeff) |
target.get_params(trainable=True) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.