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

Commit 0eb7170

Browse files
author
Fiscarelli
committed
CEP Release v3.3
1 parent c777dbc commit 0eb7170

File tree

180 files changed

+8168
-5349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+8168
-5349
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<img src="./doc/cep_logo.jpg" width="721" height="300">
99
</p>
1010
<p align="center">
11-
<img src="./doc/version3.2.jpg" width="98" height="60">
11+
<img src="./doc/version3.3.jpg" width="98" height="60">
1212
</p>
1313
<p align="center">
1414
Copyright 2021 Massachusetts Institute of Technology
@@ -25,7 +25,7 @@ For CEP v3.1+, the full LLKI has been added. This includes the Surrogate Root o
2525

2626
### Please check the [Release Notes](./RELEASE_NOTES.md) to understand what has changed and a list of known issues.
2727

28-
<br/><br/>
28+
<br/>
2929

3030
<p align="center">
3131
<img src="./doc/cep_v3.1_architecture.jpg">
@@ -341,7 +341,7 @@ You should see the following logo/text appear:
341341
./+++++++++++oo+++: +oo++o++++o+o+oo+oo.- `s+++s`-
342342
.--:---:-:-::-::` -::::::::::::::::::. :::::.
343343
344-
Common Evaluation Platform v3.20
344+
Common Evaluation Platform v3.30
345345
Copyright 2021 Massachusetts Institute of Technology
346346
347347
Built upon the SiFive Freedom U500 Platform using
@@ -364,7 +364,7 @@ At the command prompt, you can run the CEP diagnostics by commanding `cep_diag`.
364364
A partial output should be similar to:
365365

366366
```sh
367-
*** CEP Tag=CEPTest CEP HW VERSION = v3.20 was built on Apr 15 2021 09:22:15 ***
367+
*** CEP Tag=CEPTest CEP HW VERSION = v3.30 was built on Apr 15 2021 09:22:15 ***
368368
CEP FPGA Physical: cepReg/ddr3/other/sys -> Virtual=0x0000000700000000, 0x0000000800000000, 0x0000000600000000, 0x0000000c00000000 ScratchPad=0x0000002000800000
369369
gSkipInit=0/0
370370
gverbose=0/0

RELEASE_NOTES.md

+10
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,14 @@ v3.2 - (16 April 2021)
121121
* Linux tests updated and expanded
122122
* New tests added to cosim focused on LLKI and Scratchpad RAM
123123

124+
v3.3 - (19 May 2021)
125+
* Increased capacity for LLKI key size including larger KeyRAM (2048 64-bit words)
126+
* Added Cosim JTAG/OpenOCD
127+
* Stability fixes for cep_diag under Linux
128+
* Virtual Address TLB test suite is added to regression (not 100% complete)
129+
* Expanded cep_diag
130+
* New simulation ONLY interrupt tests for CLINT and PLIC modules (on going)
131+
* Re-capture vectors for unit sim due to changes in LLKI key size
132+
* Bootrom size is increased to 32K bytes (8kx32) to accomodate new built-in test (execute codes out of bootrom without main memory)
133+
124134
#### Return to the root CEP [README](./README.md)

cosim/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ SIM_DIR = ${DUT_TOP_DIR}/${COSIM_NAME}
3434
TEST_GROUP = bareMetalTests \
3535
bfmTests \
3636
isaTests \
37-
37+
vBareTest \
3838

3939
runAll:
4040
make cleanAll

cosim/README.md

+50-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Several environments are supported:
1616
* Linux Mode (tests run on xilinx VC707 development card). Build and installation instructions can be found in: [../README.md](../README.md)
1717
* Benchmarking on Linux (TBA)
1818
* Cycle-accurate and translation-level accurate unit level simulations.
19+
* JTAG support to inferace with Openocd tool (via bitbang adapter) for Open On-Chip debugger (version 3.3 or later)
1920

2021
## Benefits: ##
2122

@@ -53,7 +54,7 @@ Assuming you already have the CEP-master (version 2.0 or later) sandbox pulled f
5354
isaTests/rv64mi-p-access
5455
isaTests/rv64ud-p-ldst
5556
```
56-
NOTE: All tests (including the above failed tests) are now passing with version 2.8 or later under Linux machine..
57+
**NOTE**: All tests (including the above failed tests) are now passing with version 2.8 or later under Linux machine..
5758

5859
## Verify environment settings and tools: ##
5960

@@ -330,10 +331,11 @@ During simulation, you will notice each of the core will print out its PC (Progr
330331

331332
Also, there are riscv_wrapper.dump (created from objdump to help track the PC), riscv_wrapper.elf (to preload to main memory) and riscv_wrapper.hex files are created by Make under each test directory.
332333

334+
**Note**: for version 3.3 or later, directory **.../cosim/drivers/bootbare** is removed and the official bootrom generation Makefile is adjusted to also produce the bootrom image for simulation.
333335

334336
## Building ISA tests for simulation ##
335337

336-
As of version 2.7 or later, ISA (Instruction-Set-Architecture) tests are added to simulation to improve overall chip coverages.
338+
For version 2.7 or later, ISA (Instruction-Set-Architecture) tests are added to simulation to improve overall chip coverages.
337339

338340
**All ISA tests are re-used from https://github.com/riscv/riscv-tests.git repository**.
339341

@@ -401,7 +403,7 @@ And now you are ready to do the build as follows
401403
cd <CEP_ROOT>/software/riscv-tests
402404
autoconf
403405
./configure
404-
make isa <-- only need to make ISA, without argument benchmark tests will be included (benchmarks have NOT be ported)
406+
make isa <-- only need to make ISA, without argument benchmark tests will also be included (benchmarks have NOT been ported)
405407
```
406408

407409
The make command above will compile **mostly** assembly tests in the directory **isa** under it. These are the ones will be re-used to run in our simulation. **NOTE**: only RV64*-p/v-* tests are used since the cores are 64-bit cores.
@@ -419,6 +421,43 @@ Next step is to port and prepare those ISA tests above for simulation.
419421

420422
And we are now done for this ISA porting.
421423

424+
## About JTAG/Debug port testing and Openocd ##
425+
426+
To test JTAG port in simulation, openocd tool is needed. The Makefile will check for the present of such tool before any jtag related test is allowed to run.
427+
428+
This JTAG port is connected to the CEP's DTM (DebugTransportModule). It is used to facilitate debugging via GDB. Openocd acts as transport layer between the internal DTM and GDB.
429+
430+
A short description of what openocd is about:
431+
432+
```
433+
OpenOCD provides on-chip programming and debugging support with a
434+
layered architecture of JTAG interface and TAP support including:
435+
436+
- (X)SVF playback to facilitate automated boundary scan and FPGA/CPLD
437+
programming;
438+
- debug target support (e.g. ARM, MIPS): single-stepping,
439+
breakpoints/watchpoints, gprof profiling, etc;
440+
- flash chip drivers (e.g. CFI, NAND, internal flash);
441+
- embedded TCL interpreter for easy scripting.
442+
```
443+
444+
To support simulation, DPI & remote-bitbang must be enable when building openocd tool.
445+
446+
Download openocd via this link: **https://github.com/riscv/riscv-openocd**
447+
448+
And follow the README file in there to build the tool or for more details how to use the tool. Instructions are cut/paste below for quick reference:
449+
450+
```
451+
To build OpenOCD, use the following sequence of commands:
452+
453+
./bootstrap (when building from the git repository)
454+
./configure -enable-remote-bitbang --enable-jtag_dpi [options]
455+
make
456+
sudo make install
457+
```
458+
459+
To see how this works, run this test: **<...>/cosim/isaTests/dtmTest**
460+
422461
## How to add your new test for regression ##
423462

424463
Open ../Makefile (one level up where your test directory is located).
@@ -494,3 +533,11 @@ make CADENCE=1 mergeAll <-- merge all coverage data and report in HTLM format
494533
* 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.
495534

496535
* 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.
536+
537+
* Below is the short-cut to quickly build cep_diag application for Linux:
538+
539+
```
540+
cd <...>/cosim/drivers/linux
541+
make buildMe
542+
```
543+

cosim/bareMetalTests/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ BARE_TEST_LIST = \
6666
fragmemter \
6767
csrTest \
6868
srotMemTest \
69+
bootViaScratch \
70+
clintIntr \
71+
plicPrioIntr \
6972

7073

7174
TESTINFO_LIST := $(sort $(foreach t,${TALUS_TEST_LIST},${BLD_DIR}/${t}/testInfo.txt))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#//************************************************************************
2+
#// Copyright 2021 Massachusetts Institute of Technology
3+
#// SPDX short identifier: BSD-2-Clause
4+
#//
5+
#// File Name:
6+
#// Program: Common Evaluation Platform (CEP)
7+
#// Description:
8+
#// Notes:
9+
#//
10+
#//************************************************************************
11+
#
12+
#
13+
#
14+
COSIM_NAME = $(shell cd ../..; basename `pwd`)
15+
DUT_TOP_DIR = $(shell cd ../../..; pwd | ./${COSIM_NAME}/bin/strip_net.pl )
16+
BLD_DIR = $(shell cd ..; pwd | ../bin/strip_net.pl )
17+
TEST_SUITE = $(shell basename ${BLD_DIR})
18+
TEST_DIR = $(shell cd .; pwd | ../../bin/strip_net.pl )
19+
TEST_NAME = $(shell basename `pwd`)
20+
SIM_DIR = ${DUT_TOP_DIR}/${COSIM_NAME}
21+
22+
23+
#
24+
# Top target!!!
25+
#
26+
all: .vrun_flag riscv_wrapper.elf
27+
28+
#
29+
# override anything here before calling the common file
30+
#
31+
include ${BLD_DIR}/common.make
32+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
//************************************************************************
2+
// Copyright 2021 Massachusetts Institute of Technology
3+
// SPDX short identifier: BSD-2-Clause
4+
//
5+
// File Name:
6+
// Program: Common Evaluation Platform (CEP)
7+
// Description:
8+
// Notes:
9+
//
10+
//************************************************************************
11+
#include <unistd.h>
12+
#include "v2c_cmds.h"
13+
#include "access.h"
14+
#include "c_dispatch.h"
15+
#include "c_module.h"
16+
#include "cep_apis.h"
17+
#include "cep_adrMap.h"
18+
#include "simPio.h"
19+
/*
20+
* main
21+
*/
22+
int main(int argc, char *argv[])
23+
{
24+
25+
/* ===================================== */
26+
/* SETUP SECTION FOR SIMULATION */
27+
/* ===================================== */
28+
unsigned long seed;
29+
sscanf(argv[1],"0x%x",&seed);
30+
printf("Seed = 0x%x\n",seed);
31+
int errCnt = 0;
32+
int verbose = 0x1f;
33+
34+
/* ===================================== */
35+
/* spawn all the paralle threads */
36+
/* ===================================== */
37+
int activeSlot=0; // only 1 board
38+
//
39+
// ============================
40+
// fork all the tests here
41+
// ============================
42+
//
43+
shPthread thr;
44+
//
45+
// max number of cores not include the system thread
46+
//
47+
int maxHost = MAX_CORES; // number of cores/threads
48+
//
49+
// each bit is to turn on the given core (bit0 = core0, bit1=core1, etc..)
50+
//
51+
long unsigned int mask = 0xF;
52+
//
53+
// Set the active CPU mask before spawn the threads...
54+
//
55+
thr.SetActiveMask(mask);
56+
//
57+
// c_module is the threead to run
58+
//
59+
for (int i=0;i<maxHost;i++) {
60+
if ((long unsigned int)(1 << i) & mask) {
61+
thr.ForkAThread(activeSlot,i,verbose, seed * (1+i), c_module);
62+
}
63+
}
64+
//
65+
// lastly: Added system thread always
66+
//
67+
thr.AddSysThread(SYSTEM_SLOT_ID,SYSTEM_CPU_ID);
68+
//
69+
// ============================
70+
// Turn on the wave here
71+
// ============================
72+
//
73+
int cycle2start=0;
74+
int cycle2capture=-1; // til end
75+
int wave_enable=1;
76+
#ifndef NOWAVE
77+
dump_wave(cycle2start, cycle2capture, wave_enable);
78+
#endif
79+
//
80+
// Enable main memory logging
81+
//
82+
//DUT_WRITE_DVT(DVTF_ENABLE_MAIN_MEM_LOGGING, DVTF_ENABLE_MAIN_MEM_LOGGING, 1);
83+
//
84+
// wait for calibration??
85+
//
86+
#if 1
87+
//int calibDone = calibrate_ddr3(50);
88+
int backdoor_on = 1;
89+
int verify = 0;
90+
int srcOffset = 0x1000;
91+
int destOffset = 0;
92+
errCnt += load_mainMemory((char *)"./riscv_wrapper.elf", ddr3_base_adr,srcOffset, destOffset, backdoor_on, verify);
93+
#endif
94+
DUT_WRITE_DVT(DVTF_DISABLE_MAIN_MEM_LOGGING, DVTF_DISABLE_MAIN_MEM_LOGGING, 1);
95+
//
96+
// log the write only
97+
DUT_WRITE_DVT(DVTF_ENABLE_MAIN_MEMWR_LOGGING, DVTF_ENABLE_MAIN_MEMWR_LOGGING, 1);
98+
//
99+
// ============================
100+
// wait until all the threads are done
101+
// ============================
102+
//
103+
int Done = 0;
104+
while (!Done) {
105+
Done = thr.AllThreadDone();
106+
sleep(2);
107+
}
108+
//
109+
toggleDmiReset();
110+
//
111+
112+
/* ===================================== */
113+
/* END-OF-TEST CHECKING */
114+
/* ===================================== */
115+
errCnt += thr.GetErrorCount();
116+
if (errCnt != 0) {
117+
LOGE("======== TEST FAIL ========== %x\n",errCnt);
118+
} else {
119+
LOGI("%s ======== TEST PASS ========== \n",__FUNCTION__);
120+
}
121+
//
122+
// shutdown HW side
123+
// dont call this DUT_SetInActiveStatus is used
124+
thr.Shutdown();
125+
return(errCnt);
126+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//************************************************************************
2+
// Copyright 2021 Massachusetts Institute of Technology
3+
// SPDX short identifier: BSD-2-Clause
4+
//
5+
// File Name:
6+
// Program: Common Evaluation Platform (CEP)
7+
// Description:
8+
// Notes:
9+
//
10+
//************************************************************************
11+
#ifndef __C_DISPATCH_H
12+
#define __C_DISPATCH_H
13+
14+
15+
// Dispatch setup
16+
#ifdef LONGTEST
17+
#define MAX_LOOP 50
18+
#else
19+
#define MAX_LOOP 5
20+
#endif
21+
22+
#endif
23+

0 commit comments

Comments
 (0)