From a151407ca4a6f5de92e8bef94b0f5f25a9b1073c Mon Sep 17 00:00:00 2001 From: Cary R Date: Sun, 31 May 2020 12:49:59 -0700 Subject: [PATCH] Update the flag count from 256 to 512 --- tgt-vvp/vvp.c | 11 +++++++---- vvp/vthread.cc | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tgt-vvp/vvp.c b/tgt-vvp/vvp.c index 9ab70ebf3..9d6dc4cd9 100644 --- a/tgt-vvp/vvp.c +++ b/tgt-vvp/vvp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2020 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -28,7 +28,7 @@ static const char*version_string = "Icarus Verilog VVP Code Generator " VERSION " (" VERSION_TAG ")\n\n" -"Copyright (c) 2001-2015 Stephen Williams (steve@icarus.com)\n\n" +"Copyright (c) 2001-2020 Stephen Williams (steve@icarus.com)\n\n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" " the Free Software Foundation; either version 2 of the License, or\n" @@ -50,7 +50,8 @@ unsigned show_file_line = 0; int debug_draw = 0; -# define FLAGS_COUNT 256 +/* This needs to match the actual flag count in the VVP thread. */ +# define FLAGS_COUNT 512 static uint32_t allocate_flag_mask[FLAGS_COUNT / 32] = { 0x000000ff, 0 }; @@ -109,7 +110,9 @@ int allocate_flag(void) return idx; } - return -1; + fprintf(stderr, "vvp.tgt error: Exceeded the maximum flag count of " + "%d during VVP code generation.\n", FLAGS_COUNT); + exit(1); } void clr_flag(int idx) diff --git a/vvp/vthread.cc b/vvp/vthread.cc index f2e3961fc..77cc06d02 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2018 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2020 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -102,7 +102,7 @@ struct vthread_s { /* This is the program counter. */ vvp_code_t pc; /* These hold the private thread bits. */ - enum { FLAGS_COUNT = 256, WORDS_COUNT = 16 }; + enum { FLAGS_COUNT = 512, WORDS_COUNT = 16 }; vvp_bit4_t flags[FLAGS_COUNT]; /* These are the word registers. */