-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from pulp-platform/control_pulp_dev
Add cv32e40p support for pulpissimo, pulp and control-pulp
- Loading branch information
Showing
17 changed files
with
845 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash -e | ||
|
||
export PULPRT_TARGET=pulp | ||
export PULPRUN_TARGET=pulp | ||
export USE_CV32E40P=1 | ||
|
||
if [ -n "${ZSH_VERSION:-}" ]; then | ||
DIR="$(readlink -f -- "${(%):-%x}")" | ||
scriptDir="$(dirname $DIR)" | ||
else | ||
|
||
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" | ||
|
||
fi | ||
|
||
source $scriptDir/common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash -e | ||
|
||
export PULPRT_TARGET=pulpissimo | ||
export PULPRUN_TARGET=pulpissimo | ||
export USE_CV32E40P=1 | ||
|
||
if [ -n "${ZSH_VERSION:-}" ]; then | ||
DIR="$(readlink -f -- "${(%):-%x}")" | ||
scriptDir="$(dirname $DIR)" | ||
else | ||
|
||
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" | ||
|
||
fi | ||
|
||
source $scriptDir/common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (C) 2018 ETH Zurich and University of Bologna | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
/* | ||
* Bit definitions for Performance counters mode registers | ||
* | ||
*/ | ||
#define CSR_PCER_CYCLES 0 /* Count the number of cycles the core was running */ | ||
#define CSR_PCER_INSTR 1 /* Count the number of instructions executed */ | ||
#define CSR_PCER_LD_STALL 2 /* Number of load use hazards */ | ||
#define CSR_PCER_JMP_STALL 3 /* Number of jump register hazards */ | ||
#define CSR_PCER_IMISS 4 /* Cycles waiting for instruction fetches. i.e. the number of instructions wasted due to non-ideal caches */ | ||
#define CSR_PCER_LD 5 /* Number of memory loads executed. Misaligned accesses are counted twice */ | ||
#define CSR_PCER_ST 6 /* Number of memory stores executed. Misaligned accesses are counted twice */ | ||
#define CSR_PCER_JUMP 7 /* Number of jump instructions seen, i.e. j, jr, jal, jalr */ | ||
#define CSR_PCER_BRANCH 8 /* Number of branch instructions seen, i.e. bf, bnf */ | ||
#define CSR_PCER_TAKEN_BRANCH 9 /* Number of taken branch instructions seen, i.e. bf, bnf */ | ||
#define CSR_PCER_COMP_INSTR 10 /* Number of compressed instructions */ | ||
#define CSR_PCER_PIPE_STALL 11 /* Cycles wasted due to ELW instruction */ | ||
#define CSR_PCER_APU_TYPE 12 /* Number of memory loads to EXT executed. Misaligned accesses are counted twice. Every non-TCDM access is considered external */ | ||
#define CSR_PCER_APU_CONT 13 /* Number of memory stores to EXT executed. Misaligned accesses are counted twice. Every non-TCDM access is considered external */ | ||
#define CSR_PCER_APU_DEP 14 /* Cycles used for memory loads to EXT. Every non-TCDM access is considered external */ | ||
#define CSR_PCER_APU_WB 15 /* Cycles used for memory stores to EXT. Every non-TCDM access is considered external */ | ||
|
||
|
||
// Gives from the event ID, the HW mask that can be stored (with an OR with other events mask) to the PCER | ||
#define CSR_PCER_EVENT_MASK(eventId) (1<<(eventId)) | ||
#define CSR_PCER_ALL_EVENTS_MASK 0xffffffff | ||
|
||
#define CSR_PCMR_ACTIVE 0x1 /* Activate counting */ | ||
#define CSR_PCMR_SATURATE 0x2 /* Activate saturation */ | ||
|
||
#define CSR_PCER_NAME(id) \ | ||
( id == 0 ? "Cycles" : \ | ||
id == 1 ? "Instructions" : \ | ||
id == 2 ? "LD_Stall" : \ | ||
id == 3 ? "Jmp_Stall" : \ | ||
id == 4 ? "IMISS" : \ | ||
id == 5 ? "LD" : \ | ||
id == 6 ? "ST" : \ | ||
id == 7 ? "JUMP" : \ | ||
id == 8 ? "BRANCH" : \ | ||
id == 9 ? "TAKEN_BRANCH" : \ | ||
id == 10 ? "COMP_INSTR" : \ | ||
id == 11 ? "PIPE_STALL" : \ | ||
id == 12 ? "APU_TYPE" : \ | ||
id == 13 ? "APU_CONT" : \ | ||
id == 14 ? "APU_DEP" : \ | ||
id == 15 ? "APU_WB" : \ | ||
"NA") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (C) 2018 ETH Zurich and University of Bologna | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef _ARCHI_RISCV_PRIV_1_9_H | ||
#define _ARCHI_RISCV_PRIV_1_9_H | ||
|
||
#define RV_CSR_MSTATUS 0x300 | ||
#define RV_CSR_MEPC 0x341 | ||
#define RV_CSR_MCAUSE 0x342 | ||
#define RV_CSR_MTVAL 0x343 | ||
#define RV_CSR_MESTATUS 0x7C0 | ||
#ifdef RISCV_1_7 | ||
#define RV_CSR_MCPUID 0xF00 | ||
#define RV_CSR_MIMPID 0xF01 | ||
#define RV_CSR_MHARTID 0xF10 | ||
#else | ||
#define RV_CSR_MISA 0xF10 | ||
#define RV_CSR_MIMPID 0xF13 | ||
#define RV_CSR_MHARTID 0xF14 | ||
#endif | ||
|
||
#define CSR_PCCR(N) (0x780 + (N)) | ||
#define CSR_PCER 0xCC0 | ||
#define CSR_PCMR 0xCC1 | ||
|
||
#define CSR_STACK_CONF 0x7D0 | ||
#define CSR_STACK_START 0x7D1 | ||
#define CSR_STACK_END 0x7D2 | ||
|
||
#define CSR_MESTATUS_INTEN_BIT 0 | ||
#define CSR_MESTATUS_PRV_BIT 1 | ||
|
||
#define CSR_MESTATUS_PRV_MACH 3 | ||
|
||
#define CSR_HWLOOP0_START 0x800 | ||
#define CSR_HWLOOP0_END 0x801 | ||
#define CSR_HWLOOP0_COUNTER 0x802 | ||
#define CSR_HWLOOP1_START 0x804 | ||
#define CSR_HWLOOP1_END 0x805 | ||
#define CSR_HWLOOP1_COUNTER 0x806 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.