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.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiscarelli committed Dec 16, 2020
1 parent 656a511 commit 0fa5ab5
Show file tree
Hide file tree
Showing 243 changed files with 22,463 additions and 433 deletions.
Binary file added .DS_Store
Binary file not shown.
47 changes: 31 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)

<p align="center">
<img src="./cep_logo.jpg">
<img src="./doc/cep_logo.jpg" width="721" height="300">
</p>
<p align="center">
<img src="./doc/version.jpg" width="98" height="60">
</p>
<p align="center">
v2.71
<br>
Copyright 2020 Massachusetts Institute of Technology
</p>
<p align="center">
<img src="./doc/related_logos.jpg" width="450" height="71">
</p>

The Common Evaluation Platform (CEP) is intended as a surrogate System on a Chip (SoC) that provides users an open-source evaluation platform for the evaluation of custom tools and techniques. An extensive verification environment provided to ensure the underlying functionality is maintained even after modification.

<br>
The Logic Locking Key Interface (LLKI) has been provided as a representative means of distributing key / configuration material to LLKI-enabled cores.

The Common Evaluation Platform (CEP) is intended as a surrogate System on a Chip (SoC) allowing users to test a variety of tools and techniques. Test vectors are provided to ensure the underlying functionality is maintained even after modification.
For CEP v3.0, the Surrogate Root of Trust (SRoT) and LLKI-enabled AES-192 core has been added. Example test vectors have been with additional LLKI information being available in the comments of files located in ./hdl_cores/llki.

<p align="center">
<img src="./cep_architecture.jpg">
<img src="./doc/cep_v3.0_architecture.jpg">
</p>

Additional information on the objectives of the CEP may be found in [./CEP_SecEvalTargets.pdf](CEP_SecEvalTargets.pdf).
Additional information on the objectives of the CEP may be found in [./doc/CEP_SecEvalTargets.pdf](CEP_SecEvalTargets.pdf).

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 @@ -82,6 +88,8 @@ The RISC-V source code resides in <CEP_ROOT>/software/riscv-gnu-toolchain
Begin by installing the dependencies by executing the following:
`sudo apt install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev`

Now, build the toolchain.

Ensure you have write permissions to the directory pointed to by $RISCV and that the current shell has NOT sourced the Xilinx Vivado environment script:

$ cd <CEP_ROOT>/software/riscv-gnu-toolchain
Expand Down Expand Up @@ -138,7 +146,10 @@ Install the required dependencies by running the following command:
|-- generated_dsp_code/ - Placeholder for the generated DSP code that cannot be
| directly included in the CEP repository due to licensing
| restrictions.
|-- software/
|
|-- opentitan/ - Copy of the OpenTitan repository, some components are used by the LLKI.
|
|-- software/
|
|-- freedom-u-sdk/ - Directory containing an export of the https://github.com/
| mcd500/freedom-u-sdk directory, which is a fork of the
Expand Down Expand Up @@ -274,7 +285,7 @@ You should see the following logo/text appear:
./+++++++++++oo+++: +oo++o++++o+o+oo+oo.- `s+++s`-
.--:---:-:-::-::` -::::::::::::::::::. :::::.
Common Evaluation Platform v2.71
Common Evaluation Platform v3.0
Copyright (C) 2020 Massachusetts Institute of Technology
Built upon the SiFive Freedom U500 Platform using
Expand All @@ -297,7 +308,7 @@ 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 = v2.71 was built on Sep 17 2020 12:01:26 ***
*** CEP Tag=CEPTest CEP HW VERSION = v3.00 was built on Sep 17 2020 12:01:26 ***
CEP FPGA Physical=0x70000000 -> Virtual=0x00000020004fa000
gSkipInit=0/0
gverbose=0/0
Expand Down Expand Up @@ -428,7 +439,7 @@ v2.6 - (18 September 2020)
https://github.com/sifive/sifive-blocks/tree/12bdbe50636b6c57c8dc997e483787fdb5ee540b - Dec 17, 2019
https://github.com/mcd500/freedom-u-sdk/tree/29fe529f8dd8e1974fe1743184b3e13ebb2a21dc - Apr 12, 2019
* riscv-tools (formerly under rocket-chip) now located in ./software/riscv-gnu-toolchain
7* KNOWN ISSUES:
* KNOWN ISSUES:
- The iCacheCoherency passes when running bare-metal simulation, but fails when running on the VC-707. There is an issue with
the iCache protocol that the tight-looped iCache coherency test results in one or more of the Rocket Cores (there are 4 in
the CEP) L1 iCache not getting the value associated with the most recent write to instruction memory.
Expand All @@ -455,8 +466,11 @@ v2.7 - (28 October 2020)
- isaTests/rv64ud-p-ldst

v2.71 - (2 November 2020)
* Corrected README.md issues
* Corrected README.md issue

v3.0 - (18 December 2020)
* Initial LLKI release with Surrogate Root of Trust
* AES core replaced with LLKI-enabled AES core, all other cores remain unchanged

## Licensing
The CEP been developed with a goal of using components with non-viral, open source licensing whenever possible. When not feasible (such as Linux), pointers to reference repositories are given using the [get_external_dependencies.sh](./get_external_dependencies.sh) script.
Expand All @@ -466,10 +480,11 @@ Additional licensing information can be found in the [LICENSE](./LICENSE) and [l

## DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.

This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Assistant Secretary of Defense for Research and Engineering.
© 2020 MASSACHUSETTS INSTITUTE OF TECHNOLOGY

© 2020 Massachusetts Institute of Technology.
Subject to FAR 52.227-11 – Patent Rights – Ownership by the Contractor (May 2014)
SPDX-License-Identifier: BSD-2-Clause

The software/firmware is provided to you on an as-is basis.
This material is based upon work supported by the Name of Sponsor under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Name of Sponsor.

Delivered to the U.S. Government with Unlimited Rights, as defined in DFARS Part 252.227-7013 or 7014 (Feb 2014). Notwithstanding any copyright notice, U.S. Government rights in this work are defined by DFARS 252.227-7013 or DFARS 252.227-7014 as detailed above. Use of this work other than as specifically authorized by the U.S. Government may violate any copyrights that exist in this work.
The software/firmware is provided to you on an As-Is basis
Binary file removed cep_architecture.jpg
Binary file not shown.
14 changes: 0 additions & 14 deletions cosim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,17 +452,3 @@ make CADENCE=1 <-- run simulation targetting Cadence XCellium on RHEL7
* 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.

* Under bare metal mode, some of main memory locations are used as mailbox to help RISCV core tracking and printing. See .**../cosim/dvt/cep_adrMap.incl** file. **NOTE**: there is also a file under .../cosim/include/cep_adrMap.h This file is auto-generated from the cep_adrMap.incl mentioned. Therefore, any modification should be made to the cep_adrMap.incl file.

# Food for thought #

* At the time of this writing, running regression is done one test at a time on the same machine, serially. It takes about day+ to run all tests. As more tests are added or moving the platform to support ASIC, there will be hundreds of tests added to verify full coverage of the design before any fabrication attempted. Running serially is not do-able as turn around time is key during physical design and verification process for ASIC. This requires moving to support multiple machines (as on a cloud or grid/networks) where tests can be batched to run concurrently...The Makefile structure already takes that in mind and supports it. The requirements are the grid setup where all the machines on the networks need to be configured identically w.r.t where the tools are, all disks are mounted and visible... Not sure MIT LL support such a thing due to security??

* The environment is also capable of supporting distributed simulation where multiple large blocks (multi corer per board, big large ASIC, etc...) can be spawn off to run on different machines (or physical cores) to speed up simulation. However, this requires more simulation license usages and some manual system splitting during test bench construction.

* The environment also can be expanded to support socket communication instead of shared memory such that the DUT can be run off an emulated system (Amazon FPGA cloud??) to get more performance. This should be able to support booting Linux OS for higher level verification.






3 changes: 3 additions & 0 deletions cosim/bareMetalTests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ BARE_TEST_LIST = \
ddr3 \
cacheCoherence \
idcache_smc \
miscTests \
lrscOps \
atomicOps \



Expand Down
32 changes: 32 additions & 0 deletions cosim/bareMetalTests/srotTest/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#//************************************************************************
#// Copyright (C) 2020 Massachusetts Institute of Technology
#// SPDX short identifier: BSD-2-Clause
#//
#// File Name:
#// Program: Common Evaluation Platform (CEP)
#// Description:
#// Notes:
#//
#//************************************************************************
#
#
#
COSIM_NAME = $(shell cd ../..; basename `pwd`)
DUT_TOP_DIR = $(shell cd ../../..; pwd | ./${COSIM_NAME}/bin/strip_net.pl )
BLD_DIR = $(shell cd ..; pwd | ../bin/strip_net.pl )
TEST_SUITE = $(shell basename ${BLD_DIR})
TEST_DIR = $(shell cd .; pwd | ../../bin/strip_net.pl )
TEST_NAME = $(shell basename `pwd`)
SIM_DIR = ${DUT_TOP_DIR}/${COSIM_NAME}


#
# Top target!!!
#
all: .vrun_flag riscv_wrapper.elf

#
# override anything here before calling the common file
#
include ${BLD_DIR}/common.make

122 changes: 122 additions & 0 deletions cosim/bareMetalTests/srotTest/c_dispatch.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
//************************************************************************
// Copyright (C) 2020 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 = 1 << (seed & 0x3);
//
// 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);
}
/* ===================================== */
/* 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);
}
23 changes: 23 additions & 0 deletions cosim/bareMetalTests/srotTest/c_dispatch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//************************************************************************
// Copyright (C) 2020 Massachusetts Institute of Technology
// SPDX short identifier: BSD-2-Clause
//
// File Name:
// Program: Common Evaluation Platform (CEP)
// Description:
// Notes:
//
//************************************************************************
#ifndef __C_DISPATCH_H
#define __C_DISPATCH_H


// Dispatch setup
#ifdef LONGTEST
#define MAX_LOOP 50
#else
#define MAX_LOOP 5
#endif

#endif

Loading

0 comments on commit 0fa5ab5

Please sign in to comment.