VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
libarchfpga/main.c
Go to the documentation of this file.
1 /*
2  Test libarchfpga, try reading an architecture and print the results to a file
3 
4  Date: February 19, 2009
5  Author: Jason Luu
6  */
7 
8 #include <stdio.h>
9 #include <stdlib.h>
10 
11 #include "read_xml_arch_file.h"
12 
13 void print_help();
14 
15 int main(int argc, char **argv) {
16  struct s_arch arch;
17  t_type_descriptor *types;
18  int numTypes;
19  ;
20 
21  if (argc - 1 != 3) {
22  printf(
23  "Error: Unexpected # of arguments. Expected 3 found %d arguments\n",
24  argc);
25  print_help();
26  }
27 
28  printf(
29  "------------------------------------------------------------------------------\n");
30  printf(
31  "- Read architecture file and print library data structures into an output file\n");
32  printf(
33  "------------------------------------------------------------------------------\n\n");
34 
35  printf("Inputs: \n"
36  "architecture %s \n"
37  "timing_driven %d \n"
38  "output file %s\n", argv[1], atoi(argv[2]), argv[3]);
39  printf("Reading in architecture\n");
40 
41  /* function declarations */
42  XmlReadArch(argv[1], (boolean) atoi(argv[2]), &arch, &types, &numTypes);
43 
44  printf("Printing Results\n");
45 
46  EchoArch(argv[3], types, numTypes, &arch);
47 
48  printf("Done\n");
49 
50  return 0;
51 }
52 
53 void print_help() {
54  printf(
55  "\n---------------------------------------------------------------------------------------\n");
56  printf(
57  "read_arch: Read a VPR architecture file and output internal data structures");
58  printf(
59  "Usage: read_arch <arch_file.xml> <timing_driven (0|1)> <output_file>\n");
60  printf(" ex: read_arch k4_n10.xml 1 arch_data.out\n");
61  printf(
62  " Read timing-driven architecture k4_n10.xml and output the results to arch_data.out\n");
63  printf(
64  "\n---------------------------------------------------------------------------------------\n");
65 }
66 
void EchoArch(INP const char *EchoFile, INP const t_type_descriptor *Types, INP int NumTypes, struct s_arch *arch)
void XmlReadArch(INP const char *ArchFile, INP boolean timing_enabled, OUTP struct s_arch *arch, OUTP t_type_descriptor **Types, OUTP int *NumTypes)
int main(int argc, char **argv)
void print_help()