mirror of https://github.com/YosysHQ/icestorm.git
icemulti: Treat offset printing like ordinary flag
This commit is contained in:
parent
0e503a69a8
commit
7dad1afe6d
|
|
@ -25,13 +25,10 @@
|
|||
#include <string.h>
|
||||
|
||||
#define log(...) fprintf(stderr, __VA_ARGS__);
|
||||
#define info(...) do { if (log_level > 0) fprintf(stderr, __VA_ARGS__); } while (0)
|
||||
#define error(...) do { fprintf(stderr, "%s: ", program_short_name); fprintf(stderr, __VA_ARGS__); exit(EXIT_FAILURE); } while (0)
|
||||
|
||||
static char *program_short_name;
|
||||
|
||||
int log_level = 0;
|
||||
|
||||
static const int NUM_IMAGES = 4;
|
||||
static const int HEADER_SIZE = 32;
|
||||
|
||||
|
|
@ -191,6 +188,7 @@ int main(int argc, char **argv)
|
|||
Image *header_images[NUM_IMAGES];
|
||||
std::unique_ptr<Image> images[NUM_IMAGES];
|
||||
const char *outfile_name = NULL;
|
||||
bool print_offsets = false;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{NULL, 0, NULL, 0}
|
||||
|
|
@ -234,7 +232,7 @@ int main(int argc, char **argv)
|
|||
outfile_name = optarg;
|
||||
break;
|
||||
case 'v':
|
||||
log_level++;
|
||||
print_offsets = true;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
|
|
@ -268,7 +266,8 @@ int main(int argc, char **argv)
|
|||
images[i]->place(offs);
|
||||
offs += images[i]->size();
|
||||
align_offset(offs, align_bits);
|
||||
info("Place image %d at %06x .. %06x.\n", i, int(images[i]->offset()), int(offs));
|
||||
if (print_offsets)
|
||||
fprintf(stderr, "Place image %d at %06x .. %06x.\n", i, int(images[i]->offset()), int(offs));
|
||||
}
|
||||
|
||||
// Populate headers
|
||||
|
|
@ -302,6 +301,5 @@ int main(int argc, char **argv)
|
|||
images[i]->write(*osp, file_offset);
|
||||
}
|
||||
|
||||
info("Done.\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue