PIPS
print.c File Reference
#include <stdio.h>
#include "genC.h"
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "sc.h"
#include "polyedre.h"
#include "union.h"
#include "matrice.h"
#include "matrix.h"
#include "ri.h"
#include "ri-util.h"
#include "constants.h"
#include "misc.h"
#include "graph.h"
#include "paf_ri.h"
#include "text.h"
#include "text-util.h"
#include "paf-util.h"
+ Include dependency graph for print.c:

Go to the source code of this file.

Typedefs

typedef dfg_vertex_label vertex_label
 Name : print.c Package : prgm_mapping Author : Alexis Platonoff Date : septembre 1993. More...
 
typedef dfg_arc_label arc_label
 

Functions

void fprint_plc (FILE *fp, plc obj)
 ======================================================================== More...
 
void plc_fprint_proto (FILE *fp, graph g, hash_table StmtToProto)
 ======================================================================== More...
 
void plc_fprint_distance (FILE *fp, graph g, hash_table DtfToDist)
 ======================================================================== More...
 
void plc_fprint_dfs (FILE *fp, list df_l, hash_table DtfToStmt, hash_table DtfToWgh)
 ======================================================================== More...
 
void fprint_pla_pp_dims (FILE *fp, placement one_placement)
 ======================================================================== More...
 
void fprint_plc_pp_dims (FILE *fp, plc one_plc)
 ======================================================================== More...
 

Typedef Documentation

◆ arc_label

Definition at line 81 of file print.c.

◆ vertex_label

Name : print.c Package : prgm_mapping Author : Alexis Platonoff Date : septembre 1993.

Historic :

  • 23 sept 93, creation, AP

Documents: Comments : This file contains the functions used for printing the data structures used for prgm_mapping. Ansi includes
Newgen includes
C3 includes
Pips includes
Macro functions
Global variables
Internal variables
Local defines

Definition at line 80 of file print.c.

Function Documentation

◆ fprint_pla_pp_dims()

void fprint_pla_pp_dims ( FILE *  fp,
placement  one_placement 
)

========================================================================

Definition at line 204 of file print.c.

207 {
208  list plc_dims = placement_dims(one_placement);
209  int count = 1;
210 
211  fprintf(fp, "\nBroadcast Mapping for %d :\n",
212  placement_statement(one_placement));
213 
214  for(; !ENDP(plc_dims); POP(plc_dims), count++) {
215  Ppolynome crt_pp = (Ppolynome) CHUNK(CAR(plc_dims));
216 
217  fprintf(fp, "Dim %d :", count);
219  fprintf(fp, "\n");
220  }
221 }
static int count
Definition: SDG.c:519
#define CHUNK(x)
Definition: genC.h:90
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
bool pu_is_inferior_var(Variable v1 __attribute__((unused)), Variable v2 __attribute__((unused)))
===========================================================================
Definition: print.c:432
const char * pu_variable_name(Variable v)
package mapping : Alexis Platonoff, april 1993
Definition: print.c:421
#define placement_dims(x)
Definition: paf_ri.h:525
#define placement_statement(x)
Definition: paf_ri.h:523
void polynome_fprint(FILE *fd, Ppolynome pp, char *(*variable_name)(Variable), int *is_inferior_var)
void polynome_fprint(FILE* fd, Ppolynome pp, char* (*variable_name)(), bool (*is_inferior_var)()) Out...
Definition: pnome-io.c:173
struct Spolynome * Ppolynome
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References CAR, CHUNK, count, ENDP, fprintf(), placement_dims, placement_statement, polynome_fprint(), POP, pu_is_inferior_var(), and pu_variable_name().

Referenced by fprint_plc_pp_dims(), mapping_on_broadcast(), and partial_broadcast_coefficients().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fprint_plc()

void fprint_plc ( FILE *  fp,
plc  obj 
)

========================================================================

Mod by AP, oct 6th 95: the number of the instruction is the vertex number minus BASE_NODE_NUMBER.

Definition at line 85 of file print.c.

88 {
89  placement func;
90  list funcs, dims, d;
91  int stmt;
92 
93  fprintf(fp, "\nPROGRAM MAPPING :\n================= \n");
94 
95  for(funcs = plc_placements(obj); funcs != NIL; funcs = CDR(funcs)) {
96  func = PLACEMENT(CAR(funcs));
97  stmt = placement_statement(func);
98  dims = placement_dims(func);
99 
100  /* Mod by AP, oct 6th 95: the number of the instruction is the
101  vertex number minus BASE_NODE_NUMBER. */
102  fprintf(fp, "Ins_%d :", stmt-BASE_NODE_NUMBER);
103 
104  for(d = dims; d != NIL; d = CDR(d)) {
106  fprintf(fp, "%s", expression_to_string(exp));
107  if(CDR(d) == NIL)
108  fprintf(fp, "\n");
109  else
110  fprintf(fp, " , ");
111  }
112  }
113  fprintf(fp, "\n");
114 }
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define BASE_NODE_NUMBER
#define plc_placements(x)
Definition: paf_ri.h:557
#define PLACEMENT(x)
PLACEMENT.
Definition: paf_ri.h:493
string expression_to_string(expression e)
Definition: expression.c:77
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
Definition: statement.c:54
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References BASE_NODE_NUMBER, CAR, CDR, exp, EXPRESSION, expression_to_string(), fprintf(), NIL, PLACEMENT, placement_dims, placement_statement, and plc_placements.

Referenced by prgm_mapping(), print_parallelizedCMF_code(), print_parallelizedCRAFT_code(), print_plc(), and reindexing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fprint_plc_pp_dims()

void fprint_plc_pp_dims ( FILE *  fp,
plc  one_plc 
)

========================================================================

Definition at line 228 of file print.c.

231 {
232  list pla_l = plc_placements(one_plc);
233 
234  fprintf(fp, "\nBROADCAST PROGRAM MAPPING :\n===========================\n");
235 
236  for(; !ENDP(pla_l); POP(pla_l)) {
237  placement crt_pla = PLACEMENT(CAR(pla_l));
238  fprint_pla_pp_dims(fp, crt_pla);
239  }
240 }
void fprint_pla_pp_dims(FILE *fp, placement one_placement)
========================================================================
Definition: print.c:204

References CAR, ENDP, fprint_pla_pp_dims(), fprintf(), PLACEMENT, plc_placements, and POP.

Referenced by prgm_mapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ plc_fprint_dfs()

void plc_fprint_dfs ( FILE *  fp,
list  df_l,
hash_table  DtfToStmt,
hash_table  DtfToWgh 
)

========================================================================

Definition at line 181 of file print.c.

185 {
186  list l = df_l;
187 
188  fprintf(fp, "Listes triee des flots de donnees :\n");
189 
190  for( ; l != NIL; l = CDR(l))
191  {
192  dataflow df = DATAFLOW(CAR(l));
193  fprintf(fp, "Poids %d ***", (int) hash_get(DtfToWgh, (char *) df));
194  fprint_dataflow(fp, (int) hash_get(DtfToStmt, (char *) df), df);
195  }
196  fprintf(fp, "\n");
197 }
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
void fprint_dataflow(FILE *fp, int stmt, dataflow df)
===========================================================================
Definition: print.c:229
#define DATAFLOW(x)
DATAFLOW.
Definition: paf_ri.h:308
hash_table DtfToWgh
Mapping from a dataflow to its distance.
Definition: prgm_mapping.c:105

References CAR, CDR, DATAFLOW, DtfToWgh, fprint_dataflow(), fprintf(), hash_get(), and NIL.

Referenced by prgm_mapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ plc_fprint_distance()

void plc_fprint_distance ( FILE *  fp,
graph  g,
hash_table  DtfToDist 
)

========================================================================

Definition at line 143 of file print.c.

147 {
148  Ppolynome pp_dist;
149  list l, su_l, df_l;
150 
151  for(l = graph_vertices(g); l != NIL; l = CDR(l)) {
152  vertex v = VERTEX(CAR(l));
153 
154  fprintf(fp, "source stmt: %d\n", vertex_int_stmt(v));
155 
156  su_l = vertex_successors(v);
157 
158  for( ; su_l != NIL; su_l = CDR(su_l)) {
159  successor su = SUCCESSOR(CAR(su_l));
161 
163 
164  for( ; df_l != NIL; df_l = CDR(df_l)) {
165  dataflow df = DATAFLOW(CAR(df_l));
166 
167  fprint_dataflow(fp, sink_stmt, df);
168 
169  pp_dist = (Ppolynome) hash_get(DtfToDist, (char *) df);
170 
171  fprintf(fp, "DF Dist:");
173  fprintf(fp, "\n");
174  }
175  }
176  }
177 }
static int sink_stmt
Current source node.
Definition: adg_read_paf.c:160
#define successor_vertex(x)
Definition: graph.h:118
#define successor_arc_label(x)
Definition: graph.h:116
#define vertex_successors(x)
Definition: graph.h:154
#define SUCCESSOR(x)
SUCCESSOR.
Definition: graph.h:86
#define graph_vertices(x)
Definition: graph.h:82
#define VERTEX(x)
VERTEX.
Definition: graph.h:122
int vertex_int_stmt(vertex)
===========================================================================
Definition: utils.c:866
#define dfg_arc_label_dataflows(x)
Definition: paf_ri.h:378
hash_table DtfToDist
Mapping from a dataflow to its sink statement.
Definition: prgm_mapping.c:104

References CAR, CDR, DATAFLOW, dfg_arc_label_dataflows, DtfToDist, fprint_dataflow(), fprintf(), graph_vertices, hash_get(), NIL, polynome_fprint(), pu_is_inferior_var(), pu_variable_name(), sink_stmt, SUCCESSOR, successor_arc_label, successor_vertex, VERTEX, vertex_int_stmt(), and vertex_successors.

Referenced by prgm_mapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ plc_fprint_proto()

void plc_fprint_proto ( FILE *  fp,
graph  g,
hash_table  StmtToProto 
)

========================================================================

For each node of the data flow graph we print its prototype.

Print

Definition at line 118 of file print.c.

122 {
123 
124  list l;
125 
126  /* For each node of the data flow graph we print its prototype. */
127  for(l = graph_vertices(g); l != NIL; l = CDR(l))
128  {
129  vertex v = VERTEX(CAR(l));
131 
132  Ppolynome pp_proto = (Ppolynome) hash_get(StmtToProto, (char *) stmt);
133 
134  /* Print */
135  fprintf(fp, "ins_%d: ", stmt);
137  fprintf(fp, "\n");
138  }
139 }
#define vertex_vertex_label(x)
Definition: graph.h:152
#define dfg_vertex_label_statement(x)
Definition: paf_ri.h:413
hash_table StmtToProto
Mapping from a dataflow to its weight.
Definition: prgm_mapping.c:106
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453

References CAR, CDR, dfg_vertex_label_statement, entity_local_name(), fprintf(), graph_vertices, hash_get(), NIL, polynome_fprint(), pu_is_inferior_var(), StmtToProto, VERTEX, and vertex_vertex_label.

Referenced by is_not_trivial_p(), and prgm_mapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: