gateware

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 91dff4fe651486162397df78e08f188324a7aa65
parent e250a1aaa851485022cabacd1e3366119660f917
Author: Brian Swetland <swetland@frotz.net>
Date:   Tue, 29 Dec 2015 20:55:07 -0800

testbench: 64K words memory to avoid clobbering

This thing needs some cleanup...

Diffstat:
Mhdl/testbench.sv | 2+-
Msrc/testbench.cpp | 8+++++---
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hdl/testbench.sv b/hdl/testbench.sv @@ -11,7 +11,7 @@ reg [15:0]count = 16'd0; always @(posedge clk) begin count <= count + 16'd1; - if (count == 16'hFFFF) $finish; + if (count == 16'd256) $finish; end wire [15:0]wdata; diff --git a/src/testbench.cpp b/src/testbench.cpp @@ -31,14 +31,16 @@ #include "verilated.h" #include <verilated_vcd_c.h> -static unsigned memory[4096]; +static unsigned memory[65536]; void dpi_mem_write(int addr, int data) { - memory[addr & 0xFFF] = data; + fprintf(stderr,"WR %04x = %08x\n", addr, data); + memory[addr & 0xFFFF] = data; } void dpi_mem_read(int addr, int *data) { - *data = (int) memory[addr & 0xFFF]; + //fprintf(stderr,"RD %04x = %08x\n", addr, memory[addr & 0xFFFF]); + *data = (int) memory[addr & 0xFFFF]; } void loadmem(const char *fn) {