Esempio n. 1
0
static PLI_INT32 sys_sdf_annotate_compiletf(PLI_BYTE8*name)
{
      check_command_line_args();

      vpiHandle sys = vpi_handle(vpiSysTfCall,0);
      vpiHandle argv = vpi_iterate(vpiArgument, sys);

      vpiHandle path = vpi_scan(argv);
      if (path == 0) {
	    vpi_printf("SDF ERROR: First argument of %s is required.\n", name);
	    vpi_control(vpiFinish, 1);
	    return 0;
      }

      assert(path);

      vpiHandle scope = vpi_scan(argv);
      if (scope == 0)
	    return 0;

      if (vpi_get(vpiType,scope) != vpiModule) {
	    vpi_printf("SDF ERROR: The second argument of %s"
		       " must be a module instance.\n", name);
	    vpi_control(vpiFinish, 1);
      }

      vpi_free_object(argv);

      return 0;
}
int main(int argc, char *argv[])
{

	player_maze maze;
	SDL_on_off SDL_indicator = SDL_off; 
	possible_impossible solveable_indicator;
	int maze_dims[NUM_DIMENSIONS];
	int entrance_coords[NUM_DIMENSIONS];
	SDL_Simplewin sw;

	clear_screen();

	check_command_line_args(argc, argv, &SDL_indicator, maze, maze_dims, &sw);

	find_entrance(maze, maze_dims, entrance_coords, &sw, SDL_indicator);

	solveable_indicator = solve_maze(maze, maze_dims, entrance_coords[row], entrance_coords[col], &sw, entrance_coords);

	end_action(maze, maze_dims, solveable_indicator, &sw, SDL_indicator);

	if(SDL_indicator == SDL_on){
		// Clear up graphics subsystems
   		atexit(SDL_Quit);
	}

	return(solveable_indicator);

}
Esempio n. 3
0
static PLI_INT32 sys_sdf_annotate_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
{
      vpiHandle callh = vpi_handle(vpiSysTfCall,0);
      vpiHandle argv = vpi_iterate(vpiArgument, callh);
      vpiHandle module;

      check_command_line_args();

	/* Check that we have a file name argument. */
      if (argv == 0) {
	    vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
	               (int)vpi_get(vpiLineNo, callh));
	    vpi_printf("%s requires a file name argument.\n", name);
	    vpi_control(vpiFinish, 1);
	    return 0;
      }
      if (! is_string_obj(vpi_scan(argv))) {
	    vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
	               (int)vpi_get(vpiLineNo, callh));
	    vpi_printf("%s's file name must be a string.\n", name);
	    vpi_control(vpiFinish, 1);
      }

	/* The module argument is optional. */
      module = vpi_scan(argv);
      if (module == 0) return 0;
      if (vpi_get(vpiType, module) != vpiModule) {
	    vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
	               (int)vpi_get(vpiLineNo, callh));
	    vpi_printf("%s's second argument must be a module instance.\n",
	               name);
	    vpi_control(vpiFinish, 1);
      }

	/* Warn the user that we only use the first two arguments. */
      if (vpi_scan(argv) != 0) {
	    vpi_printf("WARNING: %s:%d: ", vpi_get_str(vpiFile, callh),
	               (int)vpi_get(vpiLineNo, callh));
	    vpi_printf("%s currently only uses the first two argument.\n",
	               name);
	    vpi_free_object(argv);
      }

      return 0;
}