OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [remove_cycle/] [agony/] [agony.cpp] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 alirezamon
#include "graph.h"
2
#include <stdio.h>
3
 
4
 
5
int
6
main(int argc, char **argv)
7
{
8
        agony ag;
9
 
10
        if (argc == 1) {
11
                printf("USAGE: %s <input file> [<output file>]\n", argv[0]);
12
                printf("input file format:\n");
13
                printf("<from1> <to1>\n");
14
                printf("<from2> <to2>\n");
15
                printf("...\n");
16
                return 1;
17
        }
18
 
19
        FILE *in = fopen(argv[1], "r");
20
        if (in == NULL) return 1;
21
        ag.read(in);
22
        fclose(in);
23
 
24
        ag.cycledfs();
25
        ag.initagony();
26
        ag.initrank();
27
        printf("%d %d\n", ag.primal(), ag.dual());
28
        ag.minagony();
29
        printf("%d\n", ag.dual());
30
 
31
        if (argc > 2) {
32
                FILE *out = fopen(argv[2], "w");
33
                if (out == NULL) return 1;
34
                ag.writeagony(out);
35
                fclose(out);
36
        }
37
 
38
        return 0;
39
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.