OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 197 to Rev 196
    Reverse comparison

Rev 197 → Rev 196

/zipcpu/trunk/bench/cpp/zippy_tb.cpp
792,7 → 792,7
printw("%8s","");
mvprintw(ln-1, 48, "%s%s%s ",
(m_core->v__DOT__thecpu__DOT__alu_valid)?"A"
:((m_core->v__DOT__thecpu__DOT__doalu__DOT__r_busy)?"a":" "),
:((m_core->v__DOT__thecpu__DOT__doalu__DOT__genblk2__DOT__r_busy)?"a":" "),
(m_core->v__DOT__thecpu__DOT__div_valid)?"D"
:((m_core->v__DOT__thecpu__DOT__div_busy)?"d":" "),
(m_core->v__DOT__thecpu__DOT__div_valid)?"F"
/zipcpu/trunk/bench/cpp/Makefile
58,16 → 58,6
# debugging output) if successful. To actually run this test,
# you'll need to run ./div_tb (no arguments necessary).
#
# mpy_tb
# A raw test bench to test the multiply instructions within the
# cpuops (ALU) unit separate from the rest of the CPU. For more
# details, look at the usage statement wtihin mpy_tb.
#
# zipmmu_tb
# Like div_tb, this is another raw component test bench. In this
# case, zipmmu_tb tests whether or not the MMU works when
# separated from the rest of the CPU.
#
# pdump
# zippy_tb can be configured to produce a profile output that is
# very useful when debugging the Dhrystone benchmark. (It is
107,17 → 97,15
#
################################################################################
#
all: zippy_tb pdump div_tb mpy_tb
all: zippy_tb pdump div_tb
 
CXX := g++
FLAGS := -Wall -Og -g
ZASM := ../../sw/zasm
RTLD := ../../rtl
VERILATOR_ROOT ?= $(shell bash -c 'verilator -V|grep VERILATOR_ROOT | head -1 | sed -e " s/^.*=\s*//"')
VROOT := $(VERILATOR_ROOT)
INCS := -I$(RTLD)/obj_dir/ -I$(RTLD) -I$(VROOT)/include -I$(ZASM)
INCS := -I$(RTLD)/obj_dir/ -I$(RTLD) -I/usr/share/verilator/include -I$(ZASM)
SOURCES := zippy_tb.cpp memsim.cpp twoc.cpp $(ZASM)/zopcodes.cpp $(ZASM)/zparser.cpp
VLIB := $(VROOT)/include/verilated.cpp
VLIB := /usr/share/verilator/include/verilated.cpp
RAWLIB := $(VLIB) $(RTLD)/obj_dir/Vzipsystem__ALL.a
LIBS := $(RAWLIB) -lncurses -lelf
TESTF := $(ZASM)/z.out
130,12 → 118,6
div_tb: div_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vdiv__ALL.a testb.h
$(CXX) $(FLAGS) $(INCS) div_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vdiv__ALL.a -o $@
 
mpy_tb: mpy_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vcpuops__ALL.a testb.h
$(CXX) $(FLAGS) $(INCS) mpy_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vcpuops__ALL.a -o $@
 
zipmmu_tb: zipmmu_tb.cpp $(VLIB) ../rtl/obj_dir/Vzipmmu_tb__ALL.a
$(CXX) $(FLAGS) $(INCS) -I ../rtl/obj_dir zipmmu_tb.cpp $(VLIB) ../rtl/obj_dir/Vzipmmu_tb__ALL.a -o $@
 
pdump: pdump.cpp $(ZASM)/zopcodes.cpp $(ZASM)/zparser.cpp
pdump: $(ZASM)/zopcodes.h $(ZASM)/zparser.h testb.h twoc.cpp
$(CXX) $(FLAGS) $(INCS) pdump.cpp $(ZASM)/zopcodes.cpp $(ZASM)/zparser.cpp twoc.cpp -lelf -o $@
158,4 → 140,4
 
.PHONY: clean
clean:
rm ./zippy_tb pdump div_tb mpy_tb
rm ./zippy_tb pdump div_tb
/zipcpu/trunk/bench/cpp/memsim.cpp
47,7 → 47,6
;
m_len = nxt; m_mask = nxt-1;
m_mem = new BUSW[m_len];
m_nxt_ack = 0;
}
 
MEMSIM::~MEMSIM(void) {
84,25 → 83,13
const unsigned char wb_stb, const unsigned char wb_we,
const BUSW wb_addr, const BUSW wb_data,
unsigned char &o_ack, unsigned char &o_stall, BUSW &o_data) {
o_ack = m_nxt_ack;
o_data= m_nxt_data;
m_nxt_data = wb_data;
o_stall= 0;
if ((wb_cyc)&&(wb_stb)&&(clk)) {
if (wb_we)
m_mem[wb_addr & m_mask] = wb_data;
m_nxt_ack = 1;
m_nxt_data = m_mem[wb_addr & m_mask];
// o_ack = 1;
o_ack = 1;
o_stall= 0;
o_data = m_mem[wb_addr & m_mask];
 
{
extern FILE *gbl_dbgfp;
if (gbl_dbgfp) {
if (wb_we) fprintf(gbl_dbgfp, "MEMSIM::MEM[%08x] = %08x\n", wb_addr&m_mask, wb_data);
else
fprintf(gbl_dbgfp, "MEMSIM::BUS = MEM[%08x] = %08x\n", wb_addr&m_mask, m_nxt_data);
}
}
/*
printf("MEMBUS -- ACK %s 0x%08x - 0x%08x\n",
(wb_we)?"WRITE":"READ",
109,7 → 96,7
wb_addr, o_data);
*/
} else if (clk) {
m_nxt_ack = 0;
o_ack = 0;
o_stall = 0;
}
}
/zipcpu/trunk/bench/cpp/memsim.h
46,8 → 46,6
typedef unsigned char uchar;
 
BUSW *m_mem, m_len, m_mask;
int m_nxt_ack;
BUSW m_nxt_data;
 
MEMSIM(const unsigned int nwords);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.