-/* Print visualization debugging info. The scheduler using only DFA
- description should never use the following function. */
-
-void
-print_block_visualization (const char *s)
-{
- int unit, i;
-
- /* Print header. */
- fprintf (sched_dump, "\n;; ==================== scheduling visualization %s \n", s);
-
- /* Print names of units. */
- fprintf (sched_dump, ";; %-8s", "clock");
- for (unit = 0; unit < FUNCTION_UNITS_SIZE; unit++)
- if (function_units[unit].bitmask & target_units)
- for (i = 0; i < function_units[unit].multiplicity; i++)
- fprintf (sched_dump, " %-33s", function_units[unit].name);
- fprintf (sched_dump, " %-8s\n", "no-unit");
-
- fprintf (sched_dump, ";; %-8s", "=====");
- for (unit = 0; unit < FUNCTION_UNITS_SIZE; unit++)
- if (function_units[unit].bitmask & target_units)
- for (i = 0; i < function_units[unit].multiplicity; i++)
- fprintf (sched_dump, " %-33s", "==============================");
- fprintf (sched_dump, " %-8s\n", "=======");
-
- /* Print insns in each cycle. */
- fprintf (sched_dump, "%s\n", visual_tbl);
-}
-
-/* Print insns in the 'no_unit' column of visualization. */
-
-void
-visualize_no_unit (rtx insn)
-{
- if (n_vis_no_unit < MAX_VISUAL_NO_UNIT)
- {
- vis_no_unit[n_vis_no_unit] = insn;
- n_vis_no_unit++;
- }
-}
-
-/* Print insns scheduled in clock, for visualization. */
-
-void
-visualize_scheduled_insns (int clock)
-{
- int i, unit;
-
- /* If no more room, split table into two. */
- if (n_visual_lines >= MAX_VISUAL_LINES)
- {
- print_block_visualization ("(incomplete)");
- init_block_visualization ();
- }
-
- n_visual_lines++;
-
- sprintf (visual_tbl + strlen (visual_tbl), ";; %-8d", clock);
- for (unit = 0; unit < FUNCTION_UNITS_SIZE; unit++)
- if (function_units[unit].bitmask & target_units)
- for (i = 0; i < function_units[unit].multiplicity; i++)
- {
- int instance = unit + i * FUNCTION_UNITS_SIZE;
- rtx insn = get_unit_last_insn (instance);
-
- /* Print insns that still keep the unit busy. */
- if (insn
- && actual_hazard_this_instance (unit, instance, insn, clock, 0))
- {
- char str[BUF_LEN];
- print_insn (str, insn, 0);
- str[INSN_LEN] = '\0';
- sprintf (visual_tbl + strlen (visual_tbl), " %-33s", str);
- }
- else
- sprintf (visual_tbl + strlen (visual_tbl), " %-33s", "------------------------------");
- }
-
- /* Print insns that are not assigned to any unit. */
- for (i = 0; i < n_vis_no_unit; i++)
- sprintf (visual_tbl + strlen (visual_tbl), " %-8d",
- INSN_UID (vis_no_unit[i]));
- n_vis_no_unit = 0;
-
- sprintf (visual_tbl + strlen (visual_tbl), "\n");
-}
-
-/* Print stalled cycles. */
-
-void
-visualize_stall_cycles (int stalls)
-{
- static const char *const prefix = ";; ";
- const char *suffix = "\n";
- char *p;
-
- /* If no more room, split table into two. */
- if (n_visual_lines >= MAX_VISUAL_LINES)
- {
- print_block_visualization ("(incomplete)");
- init_block_visualization ();
- }
-
- n_visual_lines++;
-
- p = visual_tbl + strlen (visual_tbl);
- strcpy (p, prefix);
- p += strlen (prefix);
-
- if ((unsigned) stalls >
- visual_tbl_line_length - strlen (prefix) - strlen (suffix))
- {
- suffix = "[...]\n";
- stalls = visual_tbl_line_length - strlen (prefix) - strlen (suffix);
- }
-
- memset (p, '.', stalls);
- p += stalls;
-
- strcpy (p, suffix);
-}
-
-/* Allocate data used for visualization during scheduling. */
-
-void
-visualize_alloc (void)
-{
- visual_tbl = xmalloc (get_visual_tbl_length ());
-}
-
-/* Free data used for visualization. */
-
-void
-visualize_free (void)
-{
- free (visual_tbl);
-}