Skip to content

Instantly share code, notes, and snippets.

@pamaury
pamaury / prdiff.py
Last active October 21, 2025 12:51
Tool to compare PR history accross rebase
#!/usr/bin/env python3
"""
This scripts allows one to compute a diff between two pushes to a
Github pull request.
To use this tool, first you need to create a GitHub token. You only
need the minimal possible access (read access to public repositories).
Save it to a file, e.g. token.txt
@pamaury
pamaury / debug.diff
Created October 16, 2025 08:29
Trying to debug the SFDP all-FF bug
diff --git i/sw/host/opentitanlib/src/bootstrap/eeprom.rs w/sw/host/opentitanlib/src/bootstrap/eeprom.rs
index 309c3cd3d1..147acf1a27 100644
--- i/sw/host/opentitanlib/src/bootstrap/eeprom.rs
+++ w/sw/host/opentitanlib/src/bootstrap/eeprom.rs
@@ -8,6 +8,7 @@ use crate::app::TransportWrapper;
use crate::bootstrap::{Bootstrap, UpdateProtocol};
use crate::spiflash::SpiFlash;
use crate::transport::{Capability, ProgressIndicator};
+use crate::uart::console::UartConsole;

Before (without minsize):

100083ca <udiv64_slow>:
udiv64_slow():
/proc/self/cwd/sw/device/lib/base/math.c:14
100083ca:                 1141                  addi    sp,sp,-16
100083cc:                 c622                  sw      s0,12(sp)
100083ce:                 4881                  li      a7,0
100083d0:                 4801                  li      a6,0
100083d2:                 4381                  li      t2,0
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock
index 2923d8acb2..2d0771949a 100644
--- a/MODULE.bazel.lock
+++ b/MODULE.bazel.lock
@@ -13694,7 +13694,7 @@
},
"@@toolchains_llvm~//toolchain/extensions:llvm.bzl%llvm": {
"general": {
- "bzlTransitiveDigest": "i2QyNjD/qcSQlxaKhQjSN1uw8mm+ZusH07AWV6RnyQU=",
+ "bzlTransitiveDigest": "M4HHCg9Yz0gvoVQnnqi5wlJY1oxlqaj4Khqr94ZjtXo=",
diff --git a/sw/device/silicon_creator/lib/cert/uds.hjson b/sw/device/silicon_creator/lib/cert/uds.hjson
index 6a9ec3621b..238a672f1b 100644
--- a/sw/device/silicon_creator/lib/cert/uds.hjson
+++ b/sw/device/silicon_creator/lib/cert/uds.hjson
@@ -98,6 +98,7 @@
// https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md#certificate-details
// The standard extensions are fixed by the specification.
basic_constraints: { ca: true },
+ key_usage: { cert_sign: true },
private_extensions: [
*** first_run.txt 2024-01-16 17:30:23.025313609 +0000
--- second_run.txt 2024-01-16 17:30:26.157314885 +0000
***************
*** 70267,70287 ****
hash: "8518aa373b12ccb94ec2196fe2586544184496c635987217ce3293e4890c3b0b"
size_bytes: 7533
hash_function_name: "SHA-256"
}
}
runner: "processwrapper-sandbox"
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
// This file was automatically generated using opentitantool from:
// sw/device/silicon_creator/lib/cert/cdi_1.hjson
extern "C" {
#include "cdi_1.h"
}
def _rv_alias_impl(ctx):
files = ctx.attr.actual[DefaultInfo].files
runfiles = ctx.runfiles(files.to_list())
return [DefaultInfo(files = files, runfiles = runfiles)]
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
load("//rules:splice.bzl", "bitstream_splice")
load("//rules:otp.bzl", "get_otp_images")
package(default_visibility = ["//visibility:public"])
# By default, targets in this file will use cached artifacts from the GCP bucket
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include <stdbool.h>
#include "sw/device/lib/runtime/log.h"
#include "sw/device/lib/testing/test_framework/ottf_main.h"
#include "sw/device/silicon_creator/lib/drivers/lifecycle.h"
#include "sw/device/silicon_creator/lib/drivers/otp.h"