Hi,

1. Current urjtag fails to initialize the prototype bus if signals are used that don't have a '[]' index. This patch initializes the inst parameter in case sscanf() didn't find an index. Might fix https://sourceforge.net/p/urjtag/discussion/682993/thread/33e8c2fa1c/

2. Extend the possible number of parameters in the python binding for initbus to accommodate the required parameters to use prototype bus.

Cheers,
Arnim
From 08292e05453e9b0aced559ac347fa73b33e7db2a Mon Sep 17 00:00:00 2001
From: devsaurus <devsau...@users.noreply.github.com>
Date: Thu, 29 May 2025 13:30:51 +0200
Subject: [PATCH 1/2] prototype bus: return valid inst parameter

---
 urjtag/src/bus/prototype.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/urjtag/src/bus/prototype.c b/urjtag/src/bus/prototype.c
index a668dd29..5c1730a5 100644
--- a/urjtag/src/bus/prototype.c
+++ b/urjtag/src/bus/prototype.c
@@ -75,6 +75,7 @@ prototype_bus_signal_parse (const char *str, char *fmt, int *inst)
     {
     case 1:
         strcpy (fmt, str);
+        *inst = 0;
         break;
     case 2:
         sprintf (fmt, "%s%s", pre, "%d");
-- 
2.49.0

From 774f1d62390703eff08ade117a9d9d2483483afd Mon Sep 17 00:00:00 2001
From: devsaurus <devsau...@users.noreply.github.com>
Date: Mon, 21 Apr 2025 21:40:01 +0200
Subject: [PATCH 2/2] allow more parameters for prototype bus

---
 urjtag/bindings/python/chain.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/urjtag/bindings/python/chain.c b/urjtag/bindings/python/chain.c
index 5886513a..fcd35f1c 100644
--- a/urjtag/bindings/python/chain.c
+++ b/urjtag/bindings/python/chain.c
@@ -735,14 +735,16 @@ urj_pyc_setpart (urj_pychain_t *self, PyObject *args)
 static PyObject *
 urj_pyc_initbus (urj_pychain_t *self, PyObject *args)
 {
-    char *bus_params[5] = { NULL, NULL, NULL, NULL, NULL };
+    char *bus_params[9] = { NULL, NULL, NULL, NULL, NULL,
+                             NULL, NULL, NULL, NULL };
     char *drivername;
     urj_chain_t *urc = self->urchain;
 
-    if (!PyArg_ParseTuple (args, "s|ssss",
+    if (!PyArg_ParseTuple (args, "s|ssssssss",
                            &drivername,
                            &bus_params[0], &bus_params[1], &bus_params[2],
-                           &bus_params[3]))
+                           &bus_params[3], &bus_params[4], &bus_params[5],
+                           &bus_params[6], &bus_params[7], &bus_params[8]))
         return NULL;
     if (!urj_pyc_precheck (urc, UPRC_CBL|UPRC_DET))
         return NULL;
-- 
2.49.0

_______________________________________________
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to