Skip to content

Commit

Permalink
Modifications to support Codasip simulator.
Browse files Browse the repository at this point in the history
	The simulator is renamed as Codasip-simulator (was
	Codasip-IA-simulator), compliance_test.h has been moved to target
	directories and a COMPILE_TARGET has been added to Makefile to
	allow use of LLVM.

ChangeLog:

        * Makefile: Include Codasip simulator target.
	* riscv-target/codasip-IA-simulator/compliance_io.h: Renamed as
	riscv-target/Codasip-simulator/compliance_io.h.
	* riscv-target/Codasip-simulator/compliance_io.h: Renamed from
	riscv-target/codasip-IA-simulator/compliance_io.
	* riscv-target/Codasip-simulator/compliance_test.h: Created.
	* riscv-target/codasip-IA-simulator/device/rv32i/Makefile.include:
	Renamed as
	riscv-target/Codasip-simulator/device/rv32i/Makefile.include
	* riscv-target/Codasip-simulator/device/rv32i/Makefile.include:
	Renamed from
	riscv-target/codasip-IA-simulator/device/rv32i/Makefile.include.
	* riscv-test-env/compliance_test.h: Renamed as
	riscv-target/riscvOVPsim/compliance_test.h.
	* riscv-target/riscvOVPsim/compliance_test.h: Renamed from
	riscv-test-env/compliance_test.h.
	* riscv-target/riscvOVPsim/device/rv32i/Makefile.include: Updated
	for new environment.
	* riscv-target/spike/compliance_test.h: Created.
	* riscv-target/spike/device/rv32i/Makefile.include: Updated for
	new environment.
	* riscv-test-suite/rv32i/Makefile: Likewise.
  • Loading branch information
jeremybennett committed Jun 18, 2018
1 parent e373062 commit beb5b06
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 22 deletions.
32 changes: 32 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
2018-06-15 Radek Hajek <[email protected]>

Modifications to support Codasip simulator.

The simulator is renamed as Codasip-simulator (was
Codasip-IA-simulator), compliance_test.h has been moved to target
directories and a COMPILE_TARGET has been added to Makefile to
allow use of LLVM.

* Makefile: Include Codasip simulator target.
* riscv-target/codasip-IA-simulator/compliance_io.h: Renamed as
riscv-target/Codasip-simulator/compliance_io.h.
* riscv-target/Codasip-simulator/compliance_io.h: Renamed from
riscv-target/codasip-IA-simulator/compliance_io.
* riscv-target/Codasip-simulator/compliance_test.h: Created.
* riscv-target/codasip-IA-simulator/device/rv32i/Makefile.include:
Renamed as
riscv-target/Codasip-simulator/device/rv32i/Makefile.include
* riscv-target/Codasip-simulator/device/rv32i/Makefile.include:
Renamed from
riscv-target/codasip-IA-simulator/device/rv32i/Makefile.include.
* riscv-test-env/compliance_test.h: Renamed as
riscv-target/riscvOVPsim/compliance_test.h.
* riscv-target/riscvOVPsim/compliance_test.h: Renamed from
riscv-test-env/compliance_test.h.
* riscv-target/riscvOVPsim/device/rv32i/Makefile.include: Updated
for new environment.
* riscv-target/spike/compliance_test.h: Created.
* riscv-target/spike/device/rv32i/Makefile.include: Updated for
new environment.
* riscv-test-suite/rv32i/Makefile: Likewise.

2018-06-10 Jeremy Bennett <[email protected]>

Put placeholders in empty directories to make sure they show in
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

RISCV_TARGET ?= riscvOVPsim
RISCV_DEVICE ?= rv32i
RISCV_PREFIX ?= riscv64-unknown-elf-

export ROOTDIR = $(shell pwd)
export WORK = $(ROOTDIR)/work
Expand All @@ -21,7 +22,7 @@ all: simulate verify
simulate:
make \
RISCV_TARGET=$(RISCV_TARGET) RISCV_DEVICE=$(RISCV_DEVICE) \
RISCV_PREFIX=riscv64-unknown-elf- run -C $(SUITEDIR)
RISCV_PREFIX=$(RISCV_PREFIX) run -C $(SUITEDIR)

verify:
riscv-test-env/verify.sh
Expand All @@ -32,4 +33,4 @@ clean:
help:
@echo "make"
@echo "RISCV_TARGET='riscvOVPsim|spike'"
@echo "RISCV_DEVICE='rv32i|...'"
@echo "RISCV_DEVICE='rv32i|...'"
45 changes: 45 additions & 0 deletions riscv-target/Codasip-simulator/compliance_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// RISC-V Compliance Test Header File
// Copyright (c) 2017, Codasip Ltd. All Rights Reserved.
// See LICENSE for license details.
//
// Description: Common header file for RV32I tests

#ifndef _COMPLIANCE_TEST_H
#define _COMPLIANCE_TEST_H

#include "riscv_test.h"

//-----------------------------------------------------------------------
// RV Compliance Macros
//-----------------------------------------------------------------------

#define RV_COMPLIANCE_HALT \
.globl codasip_syscall; \
codasip_syscall: \
add x15, x0, 1; \
sw x15, codasip_syscall, t0; \

#define RV_COMPLIANCE_RV32M \
\

#define RV_COMPLIANCE_CODE_BEGIN \
.section .text.init; \
.align 4; \
.globl _start; \
_start: \

#define RV_COMPLIANCE_CODE_END \
\

#define RV_COMPLIANCE_DATA_BEGIN \
.align 4; \
.global codasip_signature_start; \
codasip_signature_start: \

#define RV_COMPLIANCE_DATA_END \
.align 4; \
.global codasip_signature_end; \
codasip_signature_end:

#endif

18 changes: 18 additions & 0 deletions riscv-target/Codasip-simulator/device/rv32i/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# TBD

RUN_TARGET=\
codix_berkelium-ia-isimulator -r --info 5 \
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@ 1>$(work_dir_isa)/$(*)_signature.output
# +signature=$(work_dir_isa)/$(*)_signature.output \
# $(work_dir_isa)/$< 2> $(work_dir_isa)/$@

RISCV_PREFIX ?= codix_berkelium-ia-
RISCV_GCC ?= $(RISCV_PREFIX)gcc
RISCV_GCC_OPTS ?= -nostdlib -nodefaultlibs

COMPILE_TARGET=\
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \
-I$(ROOTDIR)/riscv-test-env/ \
-I$(ROOTDIR)/riscv-test-env/p/ \
-I$(ROOTDIR)/riscv-target/$(RISCV_TARGET)/ \
$$< -o $(work_dir_isa)/$$@

This file was deleted.

File renamed without changes.
16 changes: 15 additions & 1 deletion riscv-target/riscvOVPsim/device/rv32i/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@ RUN_TARGET=\
--override riscvOVPsim/cpu/sigdump/SignatureFile=$(work_dir_isa)/$(*)_signature.output \
--override riscvOVPsim/cpu/sigdump/ResultReg=3 \
--override riscvOVPsim/cpu/simulateexceptions=T \
--logfile $(work_dir_isa)/$@
--logfile $(work_dir_isa)/$@

RISCV_PREFIX ?= riscv32-unknown-elf-
RISCV_GCC ?= $(RISCV_PREFIX)gcc
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles

COMPILE_TARGET=\
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \
-I$(ROOTDIR)/riscv-test-env/ \
-I$(ROOTDIR)/riscv-test-env/p/ \
-I$(ROOTDIR)/riscv-target/$(RISCV_TARGET)/ \
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \
-o $(work_dir_isa)/$$@; \
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/[email protected]
34 changes: 34 additions & 0 deletions riscv-target/spike/compliance_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// RISC-V Compliance Test Header File
// Copyright (c) 2017, Codasip Ltd. All Rights Reserved.
// See LICENSE for license details.
//
// Description: Common header file for RV32I tests

#ifndef _COMPLIANCE_TEST_H
#define _COMPLIANCE_TEST_H

#include "riscv_test.h"

//-----------------------------------------------------------------------
// RV Compliance Macros
//-----------------------------------------------------------------------

#define RV_COMPLIANCE_HALT \
RVTEST_PASS \

#define RV_COMPLIANCE_RV32M \
RVTEST_RV32M \

#define RV_COMPLIANCE_CODE_BEGIN \
RVTEST_CODE_BEGIN \

#define RV_COMPLIANCE_CODE_END \
RVTEST_CODE_END \

#define RV_COMPLIANCE_DATA_BEGIN \
RVTEST_DATA_BEGIN \

#define RV_COMPLIANCE_DATA_END \
RVTEST_DATA_END \

#endif
16 changes: 15 additions & 1 deletion riscv-target/spike/device/rv32i/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
RUN_TARGET=\
spike --isa=rv32i \
+signature=$(work_dir_isa)/$(*)_signature.output \
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@
$(work_dir_isa)/$< 2> $(work_dir_isa)/$@

RISCV_PREFIX ?= riscv32-unknown-elf-
RISCV_GCC ?= $(RISCV_PREFIX)gcc
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles

COMPILE_TARGET=\
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \
-I$(ROOTDIR)/riscv-test-env/ \
-I$(ROOTDIR)/riscv-test-env/p/ \
-I$(ROOTDIR)/riscv-target/$(RISCV_TARGET)/ \
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \
-o $(work_dir_isa)/$$@; \
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/[email protected]
13 changes: 1 addition & 12 deletions riscv-test-suite/rv32i/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ default: all
# Build rules
#--------------------------------------------------------------------

RISCV_PREFIX ?= riscv32-unknown-elf-
RISCV_GCC ?= $(RISCV_PREFIX)gcc
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles

vpath %.S $(act_dir)

-include $(ROOTDIR)/riscv-target/$(RISCV_TARGET)/device/$(RISCV_DEVICE)/Makefile.include
Expand All @@ -35,13 +30,7 @@ define compile_template

$$($(1)_tests): %.elf: $(src_dir)/%.S
mkdir -p $(work_dir_isa)/$$(@D)
$$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) \
-I$(ROOTDIR)/riscv-test-env/ \
-I$(ROOTDIR)/riscv-test-env/p/ \
-I$(ROOTDIR)/riscv-target/$(RISCV_TARGET)/ \
-T$(ROOTDIR)/riscv-test-env/p/link.ld $$< \
-o $(work_dir_isa)/$$@
$$(RISCV_OBJDUMP) -D $(work_dir_isa)/$$@ > $(work_dir_isa)/$$@.objdump
$(COMPILE_TARGET)
$(1)_tests += $$($(1)_p_tests)

.PHONY: $(1)
Expand Down

0 comments on commit beb5b06

Please sign in to comment.