- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've created a simulation setup for a Nios II cpu design using SOPC Buillder and Nios II IDE to generate all of the required simulation files, converted everything to run using NCSim on a UNIX environment. I've had no trouble with the simulations or setup up to this point. The trouble started when I wanted to write a simple test script to run on the Nios processor to read a input command file and act on the commands with that file, and then write out a log file. However, when it tries to access the file, it prints "Cannot open command input file" to the console window. Below is the C code I'm using to access the HAL file I/O: # include <stdio.h> # include <stdlib.h> # include <string.h> # include <system.h> int main () { FILE *infile = NULL; FILE *logfile = NULL; /***************************************************/ /* Open files for access */ /***************************************************/ infile=fopen("Nios_II_cpu_model.in","r"); if (infile == NULL) { printf ("Cannot open input command file!\n"); exit(1); } logfile=fopen("Nios_II_cpu_model.log","w"); if (logfile == NULL) { printf ("Cannot open output log file!\n"); exit(1); } /***************************************************/ /* Close the files */ /***************************************************/ fclose(infile); fclose(logfile); return 0; } Anyone have any ideas??? Thanks, TonyLink Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page