PIPS
model.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "genC.h"
#include "misc.h"
#include "top-level.h"
#include "properties.h"
+ Include dependency graph for model.c:

Go to the source code of this file.

Functions

void model_fprint (FILE *fd, int pn, int bn, int ls)
 Code Generation for Distributed Memory Machines. More...
 
void model_fscan (FILE *fd, int *ppn, int *pbn, int *pls)
 
void get_model (int *ppn, int *pbn, int *pls)
 

Function Documentation

◆ get_model()

void get_model ( int ppn,
int pbn,
int pls 
)
Parameters
ppnpn
pbnbn
plsls

Definition at line 71 of file model.c.

72 {
73  FILE * fd;
74  const char* model_rc = get_string_property("WP65_MODEL_FILE");
75  if ((fd = fopen(model_rc, "r")) == NULL) {
76  fd = fopen_config(model_rc, NULL,NULL);
77  }
78 
79  model_fscan(fd, ppn, pbn, pls);
80 }
char * get_string_property(const char *)
FILE * fopen_config(const char *canonical_name, const char *cproperty, const char *cenv)
Definition: file.c:952
void model_fscan(FILE *fd, int *ppn, int *pbn, int *pls)
Definition: model.c:59

References fopen_config(), get_string_property(), and model_fscan().

Referenced by wp65().

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

◆ model_fprint()

void model_fprint ( FILE *  fd,
int  pn,
int  bn,
int  ls 
)

Code Generation for Distributed Memory Machines.

model.c

Reads and prints the target machine description (compatible formats) Temporary version. A more general machine model should be defined by Lei for complexity evaluation.

File: model.c

PUMA, ESPRIT contract 2701

Francois Irigoin 1991 ???

Parameters
fdd
pnn
bnn
lss

Definition at line 50 of file model.c.

51 {
52  fprintf(fd,
53  "Target Machine:\n"
54  "Processor number: %d\n"
55  "Memory bank number: %d\n"
56  "Bank width (i.e. line size): %d\n\n", pn, bn, ls);
57 }
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

References fprintf().

Referenced by wp65().

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

◆ model_fscan()

void model_fscan ( FILE *  fd,
int ppn,
int pbn,
int pls 
)
Parameters
fdd
ppnpn
pbnbn
plsls

Definition at line 59 of file model.c.

60 {
61  int i1, i2, i3, i4;
62  i1 = fscanf(fd, "Target Machine:\n");
63  i2 = fscanf(fd, "Processor number: %d\n", ppn);
64  i3 = fscanf(fd, "Memory bank number: %d\n", pbn);
65  i4 = fscanf(fd, "Bank width (i.e. line size): %d\n\n", pls);
66  if(i1!=0 && i2!=1 && i3!=1 && i4!=1) {
67  user_error("model_fscan", "Bad format for machine model\n");
68  }
69 }
#define user_error(fn,...)
Definition: misc-local.h:265

References user_error.

Referenced by get_model().

+ Here is the caller graph for this function: