OpenCores
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 202 to Rev 209
    Reverse comparison

Rev 202 → Rev 209

/Makefile
1,69 → 1,72
################################################################################
#
# 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: $(OBJDIR)/ hellosim simtest simuart cmptest
all:
PROGRAMS := hellosim simuart simtest cmptest
all: $(PROGRAMS)
 
CC := zip-gcc
CPP := zip-cpp
74,12 → 77,14
CFLAGS := -O3
LIBD := ../../sw/install/cross-tools/zip/lib
LIBS := -L$(LIBD) -lzipbasic
LDSCRIPT:= ../zipsim.ld
LDSCRIPT:= ./simscript.ld
 
$(OBJDIR)/%.o: %.c $(OBJDIR)/
$(OBJDIR)/%.o: %.c
$(mk-objdir)
$(CC) $(CFLAGS) -c $< -o $@
 
$(OBJDIR)/%.o: %.s $(OBJDIR)/
$(OBJDIR)/%.o: %.s
$(mk-objdir)
$(AS) $< -o $@
 
%.txt: %
113,7 → 118,8
# 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 $(OBJDIR)/
$(OBJDIR)/simtest.o: simtest.s
$(mk-objdir)
$(CPP) $< > $(OBJDIR)/simtest.s
$(AS) $(OBJDIR)/simtest.s -o $@
 
124,10 → 130,15
$(LD) -T $(LDSCRIPT) -Map=map.txt $< -o $@
 
 
$(OBJDIR)/:
define mk-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 hellosim simuart simtest
rm -rf $(PROGRAMS)
/zipdhry.S
7,6 → 7,19
; 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

powered by: WebSVN 2.1.0

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