From 5760c5ba1e3d10adfc0ca889803d8bc4adec5df6 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 16 Jan 2023 09:19:50 +0100 Subject: [PATCH] integration/soc/alloc_region: Fix alignment of Origin on Size (Thanks @sensille). --- litex/soc/integration/soc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index 4ffac67b5..b8d1e8c03 100755 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -259,7 +259,7 @@ class SoCBusHandler(LiteXModule): while (origin + size) < (search_region.origin + search_region.size_pow2): # Align Origin on Size. if (origin%size): - origin += (origin - origin%size) + origin += (size - origin%size) continue # Create a Candidate. candidate = SoCRegion(origin=origin, size=size, cached=cached)