Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
CEP Release v3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiscarelli committed Aug 9, 2021
1 parent 0eb7170 commit d3b836b
Show file tree
Hide file tree
Showing 210 changed files with 8,822 additions and 3,898 deletions.
50 changes: 27 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<img src="./doc/cep_logo.jpg" width="721" height="300">
</p>
<p align="center">
<img src="./doc/version3.3.jpg" width="98" height="60">
<img src="./doc/version3.4.jpg" width="98" height="60">
</p>
<p align="center">
Copyright 2021 Massachusetts Institute of Technology
Expand All @@ -28,7 +28,7 @@ For CEP v3.1+, the full LLKI has been added. This includes the Surrogate Root o
<br/>

<p align="center">
<img src="./doc/cep_v3.1_architecture.jpg">
<img src="./doc/cep_v3.4_architecture.jpg">
</p>

The CEP is based on the SiFive U500 Platform which leverages the UCB Rocket Chip. Much of the design is described in Chisel (https://github.com/freechipsproject/chisel3), a domain specific extension to Scala tailored towards constructing hardware. The output of the Chisel generators is synthesizable verilog.
Expand Down Expand Up @@ -104,10 +104,11 @@ Ensure you have write permissions to the directory pointed to by $RISCV and that
$ make -jN (Where N is the number of cores that can be devoted to the build)
```

#### Ubuntu 18.04 LTS instructions
### Install additional CEP package dependencies
The CEP co-simulation environment and test software uses Crypto++. Install it by executing
`sudo apt install libcrypto++-dev`

Default openssl version is 18.04 is different than 16.04. Install the following additional package.
`sudo apt install libssl1.0-dev`
#### Ubuntu 18.04 LTS instructions

You'll also need to force the compilation of the riscv-toolchain with GCC-5, which is not installed by default.

Expand Down Expand Up @@ -341,7 +342,7 @@ You should see the following logo/text appear:
./+++++++++++oo+++: +oo++o++++o+o+oo+oo.- `s+++s`-
.--:---:-:-::-::` -::::::::::::::::::. :::::.
Common Evaluation Platform v3.30
Common Evaluation Platform v3.40
Copyright 2021 Massachusetts Institute of Technology
Built upon the SiFive Freedom U500 Platform using
Expand All @@ -364,8 +365,9 @@ At the command prompt, you can run the CEP diagnostics by commanding `cep_diag`.
A partial output should be similar to:

```sh
*** CEP Tag=CEPTest CEP HW VERSION = v3.30 was built on Apr 15 2021 09:22:15 ***
CEP FPGA Physical: cepReg/ddr3/other/sys -> Virtual=0x0000000700000000, 0x0000000800000000, 0x0000000600000000, 0x0000000c00000000 ScratchPad=0x0000002000800000
*** CEP SW=0x3.40 HW VERSION = v3.40 was built on Aug 5 2021 08:36:41 ***
CEP FPGA Physical: cepReg/ddr3/other/sys -> Virtual=0x700000000, 0x800000000, 0x600000000, 0xc00000000
ScratchPad=0x2000400000
gSkipInit=0/0
gverbose=0/0
Setting terminal to VT102 with erase=^H
Expand All @@ -377,33 +379,34 @@ EnterCmd> menu
3 : dcacheCoherency : D-cache coherency Test (all cores)
4 : icacheCoherency : I-cache coherency Test (all cores)
5 : cepMaskromTest : CEP Maskrom Read-Only Test (all cores)
6 : cepSrotMemTest : CEP SRoT memory test (single core)
6 : cepSrotMemTest : CEP SRoT memory test (single core)
7 : ddr3Test : Main Memory Test (all cores)
8 : smemTest : Scratchpad Memory Test (all cores)
9 : cepGpioTest : CEP GPIO test (single core)
10 : cepSpiTest : CEP SPI test (single core)
11 : cepSrotErrTest : CEP SRoT Error Test (single core)
9 : cepGpioTest : CEP GPIO test (single core)
10 : cepSpiTest : CEP SPI test (single core)
11 : cepSrotErrTest : CEP SRoT Error Test (single core)
12 : cepAccessTest : CEP various bus/size access test (all cores)
13 : cepAtomicTest : CEP atomic intructions test (all cores)
14 : cepClintTest : CEP CLINT register test (all cores)
15 : cepLockTest : CEP single lock test (all cores)
16 : cepLockfreeAtomic : CEP lock-free instructions test (all cores)
16 : cepLockfreeAtomic : CEP lock-free instructions test (all cores)
17 : cepLrscOps : CEP Load-Reserve/Store-Conditional test (all cores)
18 : cepMultiLock : CEP multi-lock test (all cores)
19 : cepPlicTest : CEP PLIC register test (all cores)
20 : cepRegTest : CEP register tests on all cores
21 : cepMacroBadKey : CEP Macro tests with badKey (all cores)
22 : cepMacroMix : CEP Macro tests (all cores)
23 : cepSrotMaxKeyTest : CEP Macro tests with maxKey (single core)
24 : cep_AES : CEP AES test (single core)
25 : cep_DES3 : CEP DES3 test (single core)
26 : cep_DFT : CEP DFT and IDFT test (single core)
27 : cep_FIR : CEP FIR test (single core)
28 : cep_GPS : CEP GPS test (single core)
29 : cep_IIR : CEP IIR test (single core)
30 : cep_MD5 : CEP MD5 test (single core)
31 : cep_RSA : CEP RSA test (single core)
32 : cep_SHA256 : CEP SHA256 test (single core)
23 : cepMultiThread : CEP multi-thread per core (all cores)
24 : cepSrotMaxKeyTest : CEP Macro tests with maxKey (single core)
25 : cep_AES : CEP AES test (single core)
26 : cep_DES3 : CEP DES3 test (single core)
27 : cep_DFT : CEP DFT and IDFT test (single core)
28 : cep_FIR : CEP FIR test (single core)
29 : cep_GPS : CEP GPS test (single core)
30 : cep_IIR : CEP IIR test (single core)
31 : cep_MD5 : CEP MD5 test (single core)
32 : cep_RSA : CEP RSA test (single core)
33 : cep_SHA256 : CEP SHA256 test (single core)
EnterCmd>
```

Expand All @@ -428,6 +431,7 @@ The following cores have been integrated into the "standard" CEP build:
Beginning with the v2.4 release, the following "generated" cores have been added to the repository, but are currently not integrated into the CEP build.
- A(EE)ES-WB : Advanced Egregiously Extended Encryption Standard - Whitebox Edition [./hdl_cores/aeees/README.md](./hdl_cores/aeees/README.md).
- (RI)IIR : Randomly Indeterminate Infinite Impulse Response [./hdl_cores/auto-fir/README.md](./hdl_cores/auto-fir/README.md).
- SHA(AA) : Secure Hash Algorithm Arbitrarily Augment [./hdl_cores/shaaa/README.md](./hdl_cores/shaaa/README.md).

Reminder: Beginning with CEP v3.1, all the aforementioned cores have been Logic Locking Key Interface (LLKI) enabled, and thus must have the mock keys loaded to function properly.

Expand Down
13 changes: 13 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,17 @@ v3.3 - (19 May 2021)
* Re-capture vectors for unit sim due to changes in LLKI key size
* Bootrom size is increased to 32K bytes (8kx32) to accomodate new built-in test (execute codes out of bootrom without main memory)

v3.4 - (6 August 2021)

* Added external interrupt test (extIntr)
* Added test to boot rom to verify code execution out of scratchpad is working
* Added cryptoMask to cep_srot to support individual key loading only if enable
* Restructured cosim Makefiles to support re-use from other repos
* Modified cadence Makefile to enable partial toggle scoring
* Changed un-initialized main memory default state (from 0 -> 1) to improve coverage
* Addressed an LLKI bug in which the LLKI-PP component would send a respond to the SRoT before llkid_key_complete is asserted by the mock_tss_fsm
* Fixed GPS port directions in verilog
* Scratchpad RAM changed to blackbox implementation to facilitate ASIC development
* OpenSSL replaced by Cryptopp for crypto-related tests (cosim + linux)

#### Return to the root CEP [README](./README.md)
Binary file added cosim/.DS_Store
Binary file not shown.
7 changes: 3 additions & 4 deletions cosim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TEST_GROUP = bareMetalTests \

runAll:
make cleanAll
make libsBuild
make buildLibs
@for i in ${TEST_GROUP}; do \
rm -f $${i}/$${i}.log; \
(cd $${i}; make STAND_ALONE=0 runAll); \
Expand All @@ -53,8 +53,7 @@ summary: .force
#
# override anything here before calling the common file
#
include ./common.make


MKFILE_DIR ?= .
include $(MKFILE_DIR)/common.make


6 changes: 4 additions & 2 deletions cosim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Several environments are supported:
* Cycle-accurate and translation-level accurate unit level simulations.
* JTAG support to inferace with Openocd tool (via bitbang adapter) for Open On-Chip debugger (version 3.3 or later)


## Benefits: ##

* Re-usability: tests or SW drivers that are written to run on the actual HW can be used here. This allows SW to be verified/checked for functionality even before the HW is built. And of course, debugging HW at the same time.
Expand All @@ -44,6 +45,7 @@ Several environments are supported:

- Vivado and Modelsim (or xcelium) have been installed (tested versions are listed in [../README.md](../README.md))
- CEP hardware has be built as described in "Building the Hardware" in [../README.md](../README.md)
- Openssl 1.0.2

Assuming you already have the CEP-master (version 2.0 or later) sandbox pulled from git and went thru the vivado build successfully. In other words, all the design files (Verilog/VHDL files) are all created.

Expand Down Expand Up @@ -525,9 +527,9 @@ make COVERAGE=1 <-- run simulation with coverage turned on. Coverage data a
be merged together for analysis (via make merge)
make CADENCE=1 <-- run simulation targetting Cadence XCellium on RHEL7
make mergeAll <-- merge all coverage data and report in HTLM format for modelsim
make mergeAll <-- merge all coverage data and report in HTML format for modelsim
make CADENCE=1 mergeAll <-- merge all coverage data and report in HTLM format for xcelium
make CADENCE=1 mergeAll <-- merge all coverage data and report in HTML format for xcelium
```

* By default, under each test directory, one file will be created **if and only if** it is not yet there: **vsim.do**. It is used when **vsim** command is called to control the wave capturing.. If there is a need to override, users are free to modify and change it to anyway to fit the needs. Makefile will not overwrite it as long as it is there.
Expand Down
Binary file added cosim/bareMetalTests/.DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion cosim/bareMetalTests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ BARE_TEST_LIST = \
bootViaScratch \
clintIntr \
plicPrioIntr \
extIntr \


TESTINFO_LIST := $(sort $(foreach t,${TALUS_TEST_LIST},${BLD_DIR}/${t}/testInfo.txt))
Expand All @@ -80,7 +81,7 @@ TESTINFO_LIST := $(sort $(foreach t,${TALUS_TEST_LIST},${BLD_DIR}/${t}/testInfo.
runAll:
ifeq (${STAND_ALONE},1)
make cleanAll
make libsBuild
make buildLibs
endif
-rm -rf ${BLD_DIR}/*_work ${BLD_DIR}/.*work_dependList.make
-rm -f ${BLD_DIR}/*/*.elf
Expand Down
File renamed without changes.
126 changes: 126 additions & 0 deletions cosim/bareMetalTests/extIntr/c_dispatch.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
//************************************************************************
// Copyright 2021 Massachusetts Institute of Technology
// SPDX short identifier: BSD-2-Clause
//
// File Name:
// Program: Common Evaluation Platform (CEP)
// Description:
// Notes:
//
//************************************************************************
#include <unistd.h>
#include "v2c_cmds.h"
#include "access.h"
#include "c_dispatch.h"
#include "c_module.h"
#include "cep_apis.h"
#include "cep_adrMap.h"
#include "simPio.h"
/*
* main
*/
int main(int argc, char *argv[])
{

/* ===================================== */
/* SETUP SECTION FOR SIMULATION */
/* ===================================== */
unsigned long seed;
sscanf(argv[1],"0x%x",&seed);
printf("Seed = 0x%x\n",seed);
int errCnt = 0;
int verbose = 0x1f;

/* ===================================== */
/* spawn all the paralle threads */
/* ===================================== */
int activeSlot=0; // only 1 board
//
// ============================
// fork all the tests here
// ============================
//
shPthread thr;
//
// max number of cores not include the system thread
//
int maxHost = MAX_CORES; // number of cores/threads
//
// each bit is to turn on the given core (bit0 = core0, bit1=core1, etc..)
//
long unsigned int mask = 0xf;
//
// Set the active CPU mask before spawn the threads...
//
thr.SetActiveMask(mask);
//
// c_module is the threead to run
//
for (int i=0;i<maxHost;i++) {
if ((long unsigned int)(1 << i) & mask) {
thr.ForkAThread(activeSlot,i,verbose, seed * (1+i), c_module);
}
}
//
// lastly: Added system thread always
//
thr.AddSysThread(SYSTEM_SLOT_ID,SYSTEM_CPU_ID);
//
// ============================
// Turn on the wave here
// ============================
//
int cycle2start=0;
int cycle2capture=-1; // til end
int wave_enable=1;
#ifndef NOWAVE
dump_wave(cycle2start, cycle2capture, wave_enable);
#endif
//
// Enable main memory logging
//
//DUT_WRITE_DVT(DVTF_ENABLE_MAIN_MEM_LOGGING, DVTF_ENABLE_MAIN_MEM_LOGGING, 1);
//
// wait for calibration??
//
#if 1
//int calibDone = calibrate_ddr3(50);
int backdoor_on = 1;
int verify = 0;
int srcOffset = 0x1000;
int destOffset = 0;
errCnt += load_mainMemory((char *)"./riscv_wrapper.elf", ddr3_base_adr,srcOffset, destOffset, backdoor_on, verify);
#endif
DUT_WRITE_DVT(DVTF_DISABLE_MAIN_MEM_LOGGING, DVTF_DISABLE_MAIN_MEM_LOGGING, 1);
//
// log the write only
DUT_WRITE_DVT(DVTF_ENABLE_MAIN_MEMWR_LOGGING, DVTF_ENABLE_MAIN_MEMWR_LOGGING, 1);
//
// ============================
// wait until all the threads are done
// ============================
//
int Done = 0;
while (!Done) {
Done = thr.AllThreadDone();
sleep(2);
}
//
toggleDmiReset();
//

/* ===================================== */
/* END-OF-TEST CHECKING */
/* ===================================== */
errCnt += thr.GetErrorCount();
if (errCnt != 0) {
LOGE("======== TEST FAIL ========== %x\n",errCnt);
} else {
LOGI("%s ======== TEST PASS ========== \n",__FUNCTION__);
}
//
// shutdown HW side
// dont call this DUT_SetInActiveStatus is used
thr.Shutdown();
return(errCnt);
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ void *c_module(void *arg) {
int calibDone = is_program_loaded(50);

//
// use seed as timeout
errCnt += check_PassFail_status(cpuId,2000);

errCnt += check_bare_status(cpuId,500);
//
pio.RunClk(100);
//
Expand Down
File renamed without changes.
Loading

0 comments on commit d3b836b

Please sign in to comment.