~shiny/gbcap

4ea98473af754ea430485e7c3f3a401f83d9ebd5 — Thomas Spurden 3 years ago d95edc0
Detect overflow in gbcap verilator testbench
2 files changed, 6 insertions(+), 0 deletions(-)

M gbcap.py
M gbcap_tb_wrap.cpp
M gbcap.py => gbcap.py +1 -0
@@ 308,6 308,7 @@ if __name__ == '__main__':
            tb.line_pads.data, tb.line_pads.valid,
            tb.loopback.tx.data, tb.loopback.tx.valid,
            tb.loopback.rx.data, tb.loopback.rx.valid,
            tb.compress.error,
        }
        c = convert(tb, ios=ios)
        utils.update_verilog_if_changed('gbcap_tb.v', c)

M gbcap_tb_wrap.cpp => gbcap_tb_wrap.cpp +5 -0
@@ 75,6 75,11 @@ int main(int argc, char **argv)
			top->valid = 0;
		}

		if(top->error) {
			fprintf(stderr, "Overflow!\n");
			std::exit(1);
		}

		sys_clk += 1;
	}