#define BRAM_DEBUG
// sigh yes, all these should be runtime commandline options
-#define TRIGGER_ENABLE
+//#define TRIGGER_ENABLE
#define TRIGGER_OCCURENCES 1
#define TRIGGER_COUNTDOWN 20000
//#define TERMINATE_AT_COUNTDOWN
memset(_mem, sz, 0);
vluint64_t restore_time = 0;
+ bool traceme = false; // true: dump to trace file, false: don't
// identify bram files to load (if not starting "+[verilator]")
// here we can specify any number of files, but at present only
// (realistically) two are supported: the bootloader (at address 0x0)
// of hassle
for (int i = 1; i < argc; i++) {
char *bram_file = NULL;
- if (strcmp("-s", argv[i]) == 0) {
+ if (strcmp("-h", argv[i]) == 0) {
+ printf("---Microwatt-verilator binary.---\n");
+ printf("Line args:\n");
+ printf("-h <- shows this help string\n");
+ printf("-s [NUMBER] <- start sim from snapshot\n");
+ printf("first arg <- binary file to load into bram\n");
+ printf("second arg <- linux binary to load to 0x600000 (a hack)\n");
+ exit(1);
+ }
+ else if (strcmp("-d", argv[i]) == 0) {
+ printf("Trace dump enabled. NOTE: Generates *LARGE* files!\n");
+ traceme = true;
+ }
+ else if (strcmp("-s", argv[i]) == 0) {
bram_file = (char*)malloc(128); // okok not freed, i know
restore_time = atol(argv[i+1]); // yees, we knoow, check argc
restore_model(restore_time, top);
unsigned long long bram_do = 0;
// trace conditions
- bool traceme = true;
int trigger_occurrences = TRIGGER_OCCURENCES;
#ifdef TRIGGER_COUNTDOWN
int trigger_countdown = TRIGGER_COUNTDOWN;