Ignore:
Timestamp:
Jun 1, 2016, 10:25:43 AM (8 years ago)
Author:
meunier
Message:

In rosenfeld:

  • Updated nrio0, nrio1, nrio2, nrio1f, nrio2f, nrio1x, nrbool1, nrbool2 and nralloc1 in the nrc2 lib in order to use macro-typed functions
  • Updated the simulation script to include performance evaluation with random images, and a script to generate graphs
  • Updated the clock.h to use 64-bit integers, which potentially breaks the printing on the giet
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/rosenfeld/nrc2/src/nrio1xf.c

    r772 r822  
    1111#include <stdio.h>
    1212
     13#include "nrc_os_config.h"
    1314#include "mypredef.h"
    1415#include "nrtype.h"
     
    1819
    1920#include "nralloc1.h"
    20 #include "nrio1xf.h"
     21#include "nrio1x.h"
    2122
    2223
     
    2425/* -- write_vector_circular -- */
    2526/* --------------------------- */
    26 /* ------------------------------------------------------------------------------------------------------------ */
    27 IMAGE_EXPORT(void) write_bvector_circular(byte *v,long nl,long nh, long c0, long c1, char *format, char *filename)
    28 /* ------------------------------------------------------------------------------------------------------------ */
    29 {
    30   long i, n=nh-nl+1;
    31   FILE *f;
    3227
    33   f = fopen(filename, "wt");
    34   if(f == NULL) { nrerror("Can't open file in write_bvector_circular"); }
     28#undef write_type_vector_circular
     29#define write_type_vector_circular(t) \
     30void short_name(t,write_,vector_circular)(t * v, int32_t nl, int32_t nh, int32_t c0, int32_t c1, char * format, char * filename) \
     31{                                                                  \
     32    int32_t n = nh - nl + 1;                                       \
     33    FILE * f = fopen(filename, "wt");                              \
     34    if (f == NULL) {                                               \
     35        nrerror("Can't open file %s in %s\n", filename, __func__); \
     36    }                                                              \
     37    for (int32_t i = c0; i <= c1; i++) {                           \
     38        fprintf(f, format, v[i % n + nl]);                         \
     39    }                                                              \
     40    fprintf(f, "\n");                                              \
     41    fclose(f);                                                     \
     42}
    3543
    36   for(i=c0; i<=c1; i++) { fprintf(f, format, v[i%n+nl]);} fputc('\n', f);
    37   fclose(f);
    38 }
     44write_type_vector_circular(int8_t);
     45write_type_vector_circular(uint8_t);
     46write_type_vector_circular(int16_t);
     47write_type_vector_circular(uint16_t);
     48write_type_vector_circular(int32_t);
     49write_type_vector_circular(uint32_t);
     50write_type_vector_circular(int64_t);
     51write_type_vector_circular(uint64_t);
     52write_type_vector_circular(float);
     53write_type_vector_circular(double);
     54
     55
     56
     57// Local Variables:
     58// tab-width: 4
     59// c-basic-offset: 4
     60// c-file-offsets:((innamespace . 0)(inline-open . 0))
     61// indent-tabs-mode: nil
     62// End:
     63
     64// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     65
Note: See TracChangeset for help on using the changeset viewer.