URL
https://opencores.org/ocsvn/zipcpu/zipcpu/trunk
Subversion Repositories zipcpu
Compare Revisions
- This comparison shows the changes necessary to convert path
/zipcpu/trunk/bench/asm
- from Rev 209 to Rev 202
- ↔ Reverse comparison
Rev 209 → Rev 202
/Makefile
1,72 → 1,69
################################################################################ |
## |
## Filename: Makefile |
## |
## Project: Zip CPU -- a small, lightweight, RISC CPU soft core |
## |
## Purpose: To direct and simplify the build of a variety of simple assembly |
## language test programs which will use one (or both) of the |
## ZipCPU simulators. |
## |
## Targets include: |
## |
## hellosim |
## Using the SIM instruction, prints Hello World to the screen. |
## |
## simuart |
## Same as hellosim, but without using the SIM instruction. This |
## *should* be able to run successfully on a verilated or |
## synthesized hardware, although I hvae yet to test it there. |
## |
## simtest |
## A set of simple tests designed to demonstrate if the simulator |
## works or not. |
## |
## clean |
## Removes the object file directory and any executables that have |
## been created. |
## |
## None of the files/targets below have any dependencies, or if they did, |
## GCC can't determine them, so thus there is no make depends step. |
## |
## To actually run one of these programs, list the program on the command |
## line with the ZipCPU simulator, zsim. |
## |
## |
## |
## Creator: Dan Gisselquist, Ph.D. |
## Gisselquist Technology, LLC |
## |
# |
# Filename: Makefile |
# |
# Project: Zip CPU -- a small, lightweight, RISC CPU soft core |
# |
# Purpose: To direct and simplify the build of a variety of simple assembly |
# language test programs which will use one (or both) of the |
# ZipCPU simulators. |
# |
# Targets include: |
# |
# hellosim |
# Using the SIM instruction, prints Hello World to the screen. |
# |
# simuart |
# Same as hellosim, but without using the SIM instruction. This |
# *should* be able to run successfully on a verilated or |
# synthesized hardware, although I hvae yet to test it there. |
# |
# simtest |
# A set of simple tests designed to demonstrate if the simulator |
# works or not. |
# |
# clean |
# Removes the object file directory and any executables that have |
# been created. |
# |
# None of the files/targets below have any dependencies, or if they did, |
# GCC can't determine them, so thus there is no make depends step. |
# |
# To actually run one of these programs, list the program on the command |
# line with the ZipCPU simulator, zsim. |
# |
# |
# |
# Creator: Dan Gisselquist, Ph.D. |
# Gisselquist Technology, LLC |
# |
################################################################################ |
## |
## Copyright (C) 2017, Gisselquist Technology, LLC |
## |
## This program is free software (firmware): you can redistribute it and/or |
## modify it under the terms of the GNU General Public License as published |
## by the Free Software Foundation, either version 3 of the License, or (at |
## your option) any later version. |
## |
## This program is distributed in the hope that it will be useful, but WITHOUT |
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or |
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
## for more details. |
## |
## You should have received a copy of the GNU General Public License along |
## with this program. (It's in the $(ROOT)/doc directory. Run make with no |
## target there if the PDF file isn't present.) If not, see |
## <http://www.gnu.org/licenses/> for a copy. |
## |
## License: GPL, v3, as defined and found on www.gnu.org, |
## http://www.gnu.org/licenses/gpl.html |
## |
## |
# |
# Copyright (C) 2017, Gisselquist Technology, LLC |
# |
# This program is free software (firmware): you can redistribute it and/or |
# modify it under the terms of the GNU General Public License as published |
# by the Free Software Foundation, either version 3 of the License, or (at |
# your option) any later version. |
# |
# This program is distributed in the hope that it will be useful, but WITHOUT |
# ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
# for more details. |
# |
# You should have received a copy of the GNU General Public License along |
# with this program. (It's in the $(ROOT)/doc directory. Run make with no |
# target there if the PDF file isn't present.) If not, see |
# <http://www.gnu.org/licenses/> for a copy. |
# |
# License: GPL, v3, as defined and found on www.gnu.org, |
# http://www.gnu.org/licenses/gpl.html |
# |
# |
################################################################################ |
## |
## |
# |
.PHONY: all |
all: |
PROGRAMS := hellosim simuart simtest cmptest |
all: $(PROGRAMS) |
all: $(OBJDIR)/ hellosim simtest simuart cmptest |
|
CC := zip-gcc |
CPP := zip-cpp |
77,14 → 74,12
CFLAGS := -O3 |
LIBD := ../../sw/install/cross-tools/zip/lib |
LIBS := -L$(LIBD) -lzipbasic |
LDSCRIPT:= ./simscript.ld |
LDSCRIPT:= ../zipsim.ld |
|
$(OBJDIR)/%.o: %.c |
$(mk-objdir) |
$(OBJDIR)/%.o: %.c $(OBJDIR)/ |
$(CC) $(CFLAGS) -c $< -o $@ |
|
$(OBJDIR)/%.o: %.s |
$(mk-objdir) |
$(OBJDIR)/%.o: %.s $(OBJDIR)/ |
$(AS) $< -o $@ |
|
%.txt: % |
118,8 → 113,7
# needs to be run through the C pre-processor before it can go through the |
# assembler. Hence the build is a tocuh trickier, but still simple enough. |
# |
$(OBJDIR)/simtest.o: simtest.s |
$(mk-objdir) |
$(OBJDIR)/simtest.o: simtest.s $(OBJDIR)/ |
$(CPP) $< > $(OBJDIR)/simtest.s |
$(AS) $(OBJDIR)/simtest.s -o $@ |
|
130,15 → 124,10
$(LD) -T $(LDSCRIPT) -Map=map.txt $< -o $@ |
|
|
define mk-objdir |
$(OBJDIR)/: |
@bash -c "if [[ ! -e $(OBJDIR) ]]; then mkdir -p $(OBJDIR)/; fi" |
endef |
|
tags: $(wildcard *.c) $(wildcard *.h) $(wildcard *.cpp) |
@echo "Generating tags" |
@ctags $(wildcard *.c) $(wildcard *.h) |
|
.PHONY: clean |
clean: |
rm -rf $(OBJDIR)/ |
rm -rf $(PROGRAMS) |
rm -rf hellosim simuart simtest |
/zipdhry.S
7,19 → 7,6
; Purpose: Zip assembly file for running the Dhrystone benchmark in the |
; Zip CPU. |
; |
; **************************** |
; |
; This file is long since out of date. It is kept around for historical |
; reasons only. In many ways, this file never truly accomplished the |
; Dhrystone test, since it is an assembly file (not compiled), and since |
; it uses internally and locally optimized library versions. |
; |
; Another version of Dhrystone exists for the ZipCPU, in C, which properly |
; executes the benchmark. |
; |
; **************************** |
; |
; |
; To calculate a DMIPS value, take the value of R0 upon completion. This |
; is the number of clock ticks used from start to finish (i.e., from |
; entrance into user mode to the return to supervisor mode). Let |