verify_blif.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "arch_types.h"
#include "globals.h"
#include "types.h"
#include "util.h"
#include "netlist_utils.h"
#include "read_xml_arch_file.h"
#include "simulate_blif.h"
#include "read_blif.h"
#include "multipliers.h"
#include "hard_blocks.h"
#include "memories.h"
#include "netlist_visualizer.h"
#include "print_netlist.h"
Include dependency graph for verify_blif.c:

Go to the source code of this file.

Functions

void do_simulation_of_netlist ()
void get_options (int argc, char **argv)
int main (int argc, char **argv)

Variables

global_args_read_blif_t global_args_read_blif
t_arch Arch
t_type_descriptor * type_descriptors
config_t configuration
char * one_string = "ONE_VCC_CNS"
char * zero_string = "ZERO_GND_ZERO"
char * pad_string = "ZERO_PAD_ZERO"
static const char * optString = "hHa:b:s:S:h:H:g:G:t:T:c:"

Function Documentation

void do_simulation_of_netlist (  ) 

Definition at line 125 of file verify_blif.c.

00126 {
00127         if (global_args_read_blif.sim_type == NO_SIMULATION)
00128                 return;
00129         printf("---------------------------------------------------------------------------------------------");
00130         printf("Netlist Simulation Begin\n");
00131         if (global_args_read_blif.sim_type == GENERATE_VECTORS)
00132         {
00133                 printf("Testing new (random) vectors.\n");
00134                 simulate_new_vectors(global_args_read_blif.num_test_vectors,blif_netlist);
00135         }
00136         else //global_args_read_blif.sim_type == TEST_EXISTING_VECTORS
00137         {
00138                 printf("Testing existing vectors.\n");
00139                 simulate_blif(global_args_read_blif.sim_vectors_file,blif_netlist);
00140         }
00141         printf("\n--------------------------------------------------------------------\n");
00142 }

Here is the call graph for this function:

void get_options ( int  argc,
char **  argv 
)

Definition at line 149 of file verify_blif.c.

00150 {
00151         int opt = 0;
00152 
00153         /* set up the global arguments to there defualts */
00154         global_args_read_blif.config_file = NULL;
00155         global_args_read_blif.blif_file = NULL;
00156         global_args_read_blif.arch_file = NULL;
00157         global_args_read_blif.sim_vectors_file = NULL;
00158         global_args_read_blif.sim_type = NO_SIMULATION;
00159         global_args_read_blif.num_test_vectors = 0;
00160 
00161 
00162    /* Does not read from a config file as of now. Can be included later  */
00163 
00164 
00165         /* read in the option line */
00166         opt = getopt(argc, argv, optString);
00167 
00168         while(opt != -1) 
00169         {
00170                 switch(opt) 
00171                 {
00172                 /* arch file */
00173                 case 'a': 
00174                         global_args_read_blif.arch_file = optarg;
00175                         break;
00176                 /* config file not included yet */
00177                 case 'c': 
00178                         global_args_read_blif.config_file = optarg;
00179                         break; 
00180                 
00181                 /* blif file */
00182                 case 'b':
00183                         global_args_read_blif.blif_file = optarg;
00184                         break;
00185                 
00186                 case 'h':
00187                 case 'H':
00188                         printf("Usage: verify_blif.exe\n\t Options :\n\t\t-c <config_file_name.xml>\n\t\t-b <input_blif_fil_name.blif>\n\t\t-a <architecture_file_in_VPR6.0_form>\n\nSimulation options:\n\t\t -g <number_of_random_test_vectors\n\t\t -s <Simulate a particular input_vector_file>\n\t\t -t test_vector_file\n");
00189                         exit(-1);
00190                         break;
00191 
00192                 /* simulation options */
00193                 case 'g':
00194                 case 'G':
00195                         global_args_read_blif.num_test_vectors = atoi(optarg);
00196                         global_args_read_blif.sim_type = GENERATE_VECTORS;
00197                         break;
00198                 case 't':
00199                 case 'T':
00200                         global_args_read_blif.sim_vectors_file = optarg;
00201                         global_args_read_blif.sim_type = TEST_EXISTING_VECTORS;
00202                         break;
00203                 case 's':
00204                 case 'S':
00205                         global_args_read_blif.sim_vectors_file = optarg;
00206                         break;
00207                 default : 
00208                         printf("Usage: \"verify_blif.exe -h\" for usage\n");
00209                         exit(-1);
00210                         break;
00211                 }
00212 
00213                 opt = getopt(argc, argv, optString);
00214 
00215         }
00216 
00217         if ((global_args_read_blif.config_file == NULL) && ((global_args_read_blif.blif_file == NULL)|| (global_args_read_blif.arch_file==NULL)))
00218                         
00219         {
00220                 printf("Error: must include either a config file, or a blif file and Fpga Architecture file \n");
00221                 exit(-1);
00222         }
00223         
00224 }

int main ( int  argc,
char **  argv 
)

Definition at line 64 of file verify_blif.c.

00065 {
00066     int num_types; // not sure what value does this store
00067     printf("----------------------------------------------------------------------\n");
00068     printf("Reading the verify_blif for verification\n");
00069 
00070     // reading the command line flags
00071     get_options(argc,argv);
00072 
00073     /* read the configuration file (unavailable) */
00074     if (global_args_read_blif.config_file != NULL)
00075         {
00076                 printf("Reading Configuration file\n");
00077                 printf("Config read function not included yet\n");
00078         }
00079     
00080     /* read the architecture file */
00081     if (global_args_read_blif.arch_file != NULL)
00082     {
00083        printf("Reading FPGA Architecture file\n");
00084 #ifdef VPR5
00085        t_clocks ClockDetails = { 0 };
00086        t_power PowerDetails = { 0 };
00087        XmlReadArch(global_args_read_blif.arch_file, FALSE, &Arch, &type_descriptors, &num_types, &ClockDetails, &PowerDetails);
00088 #endif
00089 #ifdef VPR6
00090        XmlReadArch(global_args_read_blif.arch_file, FALSE, &Arch, &type_descriptors, &num_types);
00091 #endif
00092     }
00093 
00094 printf("--------------------------------------------------------------------------\n");
00095 printf("Reading the read_blif and Extracting the netlist\n");
00096     //lut_size = type_descriptors[2].max_subblock_inputs; /* VPR6 does not support
00097    read_blif(global_args_read_blif.blif_file);
00098 
00099 printf("Printing the netlist as a graph\n");
00100     char path[]=".";
00101     char name[]="net_blif1";
00102     graphVizOutputNetlist(path,name,1, blif_netlist);
00103     /* prints the netlist as net_blif.dot */    
00104 
00105 printf("Extraction of netlist Completed\n");    
00106     // Call the function to due simulation of the extracted netlist
00107     do_simulation_of_netlist();
00108 
00109 #ifdef print_netlist    
00110         print_netlist_for_checking(blif_netlist,"blif_netlist");
00111 #endif
00112 
00113 return 0;
00114 }

Here is the call graph for this function:


Variable Documentation

t_arch Arch

Definition at line 48 of file verify_blif.c.

Definition at line 50 of file verify_blif.c.

Definition at line 47 of file verify_blif.c.

char* one_string = "ONE_VCC_CNS"

Definition at line 54 of file verify_blif.c.

const char* optString = "hHa:b:s:S:h:H:g:G:t:T:c:" [static]

Definition at line 145 of file verify_blif.c.

char* pad_string = "ZERO_PAD_ZERO"

Definition at line 56 of file verify_blif.c.

t_type_descriptor* type_descriptors

Definition at line 49 of file verify_blif.c.

char* zero_string = "ZERO_GND_ZERO"

Definition at line 55 of file verify_blif.c.

Generated on Tue Aug 2 10:43:53 2011 for ODIN_II by  doxygen 1.6.3