On 06/12/2010 03:08 p.m., Mike Frysinger wrote:
On Monday, December 06, 2010 13:04:40 Gaston Rodriguez wrote:
On 03/12/2010 11:20 p.m., Mike Frysinger wrote:
On Friday, December 03, 2010 17:46:29 Gaston Rodriguez wrote:
I'm using UrJtag to program/erase Actel Fpgas. With previous urjtag (rev
1737) works fine. The ERASE file is executed in about 53 seconds. But
with latest UrJtag (rev 1868) the player reach the line 110 of the SVF
file and never finishes.
please narrow it down.  use git and you can use the automated bisect.
Ok, I think I found where the problem starts... (thanks to "git bisect",
what a nice tool!)
The last report is:

5c3e634a0e4daaf1cf3f6f37ca8a90833a33b046 is the first bad commit
so reset to the current git head and do `git revert 5c3e634a0e4daaf1c` and see
if things still work
-mike

After git revert and some minor manual tweaks, I've got a current tree working fine. What can we do about this issue? I think the best choice is to use an option flag in the cable command to enable/disable the clocks optimizations. Any other ideas?

Thanks,
Gastón.


diff --git a/urjtag/include/urjtag/cable.h b/urjtag/include/urjtag/cable.h
index 5ab7159..dd79187 100644
--- a/urjtag/include/urjtag/cable.h
+++ b/urjtag/include/urjtag/cable.h
@@ -111,6 +111,7 @@ struct URJ_CABLE_QUEUE
     enum
     {
         URJ_TAP_CABLE_CLOCK,
+        URJ_TAP_CABLE_CLOCK_COMPACT,
         URJ_TAP_CABLE_GET_TDO,
         URJ_TAP_CABLE_TRANSFER,
         URJ_TAP_CABLE_SET_SIGNAL,
diff --git a/urjtag/src/tap/cable/ft2232.c b/urjtag/src/tap/cable/ft2232.c
index 4c8f243..b7d7eec 100644
--- a/urjtag/src/tap/cable/ft2232.c
+++ b/urjtag/src/tap/cable/ft2232.c
@@ -1354,8 +1354,6 @@ ft2232_clock_compact_schedule (urj_cable_t *cable, int length, uint8_t byte)
 
 
 static void
-
-
 ft2232_clock (urj_cable_t *cable, int tms, int tdi, int n)
 {
     params_t *params = cable->params;
@@ -1728,6 +1726,12 @@ ft2232_flush (urj_cable_t *cable, urj_cable_flush_amount_t how_much)
         int last_tdo_valid_schedule = params->last_tdo_valid;
         int last_tdo_valid_finish = params->last_tdo_valid;
 
+        if (cable->todo.num_items == 1
+            && cable->todo.data[cable->todo.next_item].action
+               == URJ_TAP_CABLE_CLOCK_COMPACT
+            && how_much != URJ_TAP_CABLE_COMPLETELY)
+            break;
+
         for (j = i = cable->todo.next_item, n = 0; n < cable->todo.num_items;
              n++)
         {
@@ -1735,12 +1739,68 @@ ft2232_flush (urj_cable_t *cable, urj_cable_flush_amount_t how_much)
             switch (cable->todo.data[i].action)
             {
             case URJ_TAP_CABLE_CLOCK:
-                ft2232_clock_schedule (cable,
-                                       cable->todo.data[i].arg.clock.tms,
-                                       cable->todo.data[i].arg.clock.tdi,
-                                       cable->todo.data[i].arg.clock.n);
-                last_tdo_valid_schedule = 0;
-                break;
+            case URJ_TAP_CABLE_CLOCK_COMPACT:
+                {
+                    int tdi = cable->todo.data[i].arg.clock.tdi ? 1 << 7 : 0;
+                    int length = 0;
+                    uint8_t byte = 0;
+                    int tms = 0;
+                    int cn = 0;
+
+                    if (cable->todo.data[i].action == URJ_TAP_CABLE_CLOCK_COMPACT)
+                    {
+                        length = cable->todo.data[i].arg.clock.n;
+                        byte = cable->todo.data[i].arg.clock.tms;
+                    }
+
+                  more_cable_clock:
+
+                    if (cable->todo.data[i].action == URJ_TAP_CABLE_CLOCK)
+                    {
+                        tms = cable->todo.data[i].arg.clock.tms ? 1 : 0;
+                        cn = cable->todo.data[i].arg.clock.n;
+                    }
+                    while (cn > 0)
+                    {
+                        byte |= tms << length;
+                        cn--;
+                        length++;
+                        if (length == 7)
+                        {
+                            ft2232_clock_compact_schedule (cable, 6, byte | tdi);
+                            length = 0;
+                            byte = 0;
+                        }
+                    }
+                    if (n + 1 < cable->todo.num_items
+                        && cable->todo.data[(i + 1) % cable->todo.max_items].action == URJ_TAP_CABLE_CLOCK
+                        && (cable->todo.data[(i + 1) % cable->todo.max_items].arg.clock.tdi ? 1 << 7 : 0) == tdi)
+                    {
+                        i++;
+                        if (i >= cable->todo.max_items)
+                            i = 0;
+                        n++;
+                        goto more_cable_clock;
+                    }
+                    if (length)
+                    {
+                        if (n + 1 < cable->todo.num_items
+                            || how_much == URJ_TAP_CABLE_COMPLETELY)
+                            ft2232_clock_compact_schedule (cable, length - 1, byte | tdi);
+                        else
+                        {
+                            cable->todo.data[i].action = URJ_TAP_CABLE_CLOCK_COMPACT;
+                            cable->todo.data[i].arg.clock.tms = byte;
+                            cable->todo.data[i].arg.clock.n = length;
+                            i--;
+                            if (i == -1)
+                                i = cable->todo.max_items;
+                        }
+                    }
+
+                    last_tdo_valid_schedule = 0;
+                    break;
+                }
 
             case URJ_TAP_CABLE_GET_TDO:
                 if (!last_tdo_valid_schedule)
@@ -1798,6 +1858,20 @@ ft2232_flush (urj_cable_t *cable, urj_cable_flush_amount_t how_much)
                     params->last_tdo_valid = last_tdo_valid_finish = 0;
                     break;
                 }
+            case URJ_TAP_CABLE_CLOCK_COMPACT:
+                {
+                    post_signals &=
+                        ~(URJ_POD_CS_TCK | URJ_POD_CS_TDI | URJ_POD_CS_TMS);
+                    post_signals |=
+                        ((cable->todo.data[j].arg.clock.
+                          tms >> cable->todo.data[j].arg.clock.
+                          n) ? URJ_POD_CS_TMS : 0);
+                    post_signals |=
+                        (cable->todo.data[j].arg.clock.
+                         tdi ? URJ_POD_CS_TDI : 0);
+                    params->last_tdo_valid = last_tdo_valid_finish = 0;
+                    break;
+                }
             case URJ_TAP_CABLE_GET_TDO:
                 {
                     int tdo;
diff --git a/urjtag/src/tap/cable/generic.c b/urjtag/src/tap/cable/generic.c
index ccf017c..c8e9c85 100644
--- a/urjtag/src/tap/cable/generic.c
+++ b/urjtag/src/tap/cable/generic.c
@@ -171,6 +171,8 @@ do_one_queued_action (urj_cable_t *cable)
                 cable->driver->get_signal (cable,
                                            cable->todo.data[i].arg.value.sig);
             break;
+        case URJ_TAP_CABLE_CLOCK_COMPACT: /* Turn off GCC warning */
+            break;
         }
         urj_log (URJ_LOG_LEVEL_DETAIL, "do_one_queued done\n");
 
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to