VPR-6.0

libvpr/main.c

Go to the documentation of this file.
00001 /**
00002  * @file
00003  *
00004  * Test libvpr, try reading an architecture and print the results to a file
00005  * Date: February 19, 2009
00006  * Author: Jason Luu
00007 */
00008 
00009 #include <stdio.h>
00010 #include <stdlib.h>
00011 
00012 #include "read_xml_arch_file.h"
00013 
00014 void print_help();
00015 
00016 int main(int argc, char **argv) {
00017         struct s_arch arch;
00018         t_type_descriptor *types;
00019         int numTypes;;
00020 
00021         if(argc - 1 != 3) {
00022                 printf("Error: Unexpected # of arguments.  Expected 3 found %d arguments\n", argc);
00023                 print_help();
00024         }
00025 
00026         printf("------------------------------------------------------------------------------\n");
00027         printf("- Read architecture file and print library data structures into an output file\n");
00028         printf("------------------------------------------------------------------------------\n\n");
00029 
00030         printf( "Inputs: \n"
00031                         "architecture %s \n"
00032                         "timing_driven %d \n"
00033                         "output file %s\n", 
00034                         argv[1], atoi(argv[2]), argv[3]);
00035         printf("Reading in architecture\n");
00036 
00037         /* function declarations */ 
00038         XmlReadArch( argv[1], atoi(argv[2]), 
00039                                  &arch, &types, &numTypes);
00040         
00041         printf("Printing Results\n");
00042 
00043         EchoArch( argv[3],
00044                           types, numTypes, &arch);
00045 
00046         printf("Done\n");
00047 
00048         return 0;
00049 }
00050 
00051 
00052 void print_help() {
00053         printf("\n---------------------------------------------------------------------------------------\n");
00054         printf("read_arch: Read a VPR architecture file and output internal data structures");
00055         printf("Usage: read_arch <arch_file.xml> <timing_driven (0|1)> <output_file>\n");
00056         printf("  ex: read_arch k4_n10.xml 1 arch_data.out\n");
00057         printf("      Read timing-driven architecture k4_n10.xml and output the results to arch_data.out\n");
00058         printf("\n---------------------------------------------------------------------------------------\n");
00059 }
00060