Go to file
XiChen 3f453ead6a TMP: add patch of tl-test for test-top-l2 2024-09-18 15:50:28 +08:00
Emu Emu: execute ~Emu at ABORT 2024-09-12 19:49:24 +08:00
Fuzzer misc: add transactions sent count 2024-06-03 15:59:35 +08:00
TLAgent Agent: fix typo 2024-09-11 14:28:54 +08:00
Utils Emu: addr_t set to uint32 by default 2024-09-18 12:49:17 +08:00
scripts Scripts: update TLLOG parser script and its Usage 2024-05-21 19:51:17 +08:00
.clang-format Initial commit 2021-10-21 18:20:53 +08:00
.gitignore Add Readme/.gitignore 2021-10-22 14:39:03 +08:00
CMakeLists.txt Util: add ChiselDB support 2023-06-30 14:52:45 +08:00
LICENSE Add LICENSE 2024-05-21 17:11:52 +08:00
README.md Scripts: update TLLOG parser script and its Usage 2024-05-21 19:51:17 +08:00
main.cpp Emu: execute ~Emu at ABORT 2024-09-12 19:49:24 +08:00
run.sh Script: add run.sh for compile/build/make/run 2024-09-18 12:59:07 +08:00
test-top-l2.patch TMP: add patch of tl-test for test-top-l2 2024-09-18 15:50:28 +08:00

README.md

Compile CoupledL2

> git clone https://github.com/OpenXiangShan/CoupledL2.git
> git checkout BRANCH_UNDER_TEST
> make init

Next we need to generate a DUT wrapper. We provide two pre-written wrappers, you can also build new DUT wrappers.
> make test-top-l2l3l2  // For L2-L3-L2 test

Compile tl-test

> git clone https://github.com/OpenXiangShan/tl-test.git
> mkdir build
> cd build

> cmake .. -DDUT_DIR=${PATH_TO_CPL2}/build
For trace-dump, add -DTRACE=1
For multi-thread, add -DTHREAD=${NR_THREADS}
For gdb support, add -DCMAKE_BUILD_TYPE=Debug

> make

Run tl-test

> ./tlc_test

-s --seed=N        Set N as random seed
-c --cycle=N       Simulate for N cycles
-b --wave-begin=N  Wave dump starts from cycle N
-e --wave-end=N    Wave dump ends to cycle N
-f --wave-full     Dump wave in full cycles
-v --verbose       Verbose mode
Please check -DTRACE=1 is added to tl-test compiling cmake arguments before wave dump.

Tl-test will dump wave to directory tl-test/build/ if wave_begin < wave_end.

Use TLLog

TLLog is a method that can capture messages on TileLink bus, which may be helpful for debugging. To use TLLog:

Make sure that your TestTop enables chiselDB

CoupledL2/src/test/TestTop.scala: object TestTop_L2L3L2

ChiselDB.init(false) -> ChiselDB.init(true)

Make sure that SQlite3 has been installed in your machine.

Build CoupledL2 and clone tl-test following above steps.

> cmake .. -DDUT_DIR=${PATH_TO_CPL2}/build -DTLLOG=1
> make
> ./tlc_test -d

The .db file will write to tl-test/build.

*Attention: it won't save the .db file until the tl-test program ends.

Use the following commands to open .db file:

> sqlite3 <database.db> "SELECT * FROM TLLog"

To filter the table by a specific table entry:

> sqlite3 <database.db> "SELECT * FROM TLLog WHERE <ENTRY>=<VALUE>"

e.g.

  1. see all messages between L1D_0 and L2:
> sqlite3 <database.db> "SELECT * FROM TLLog WHERE SITE='L1D_L2_0'"
  1. see all messages on channel A
> sqlite3 <database.db> "SELECT * FROM TLLog WHERE CHANNEL='0'"

** There is a script in tl-test/script, which help you get better experience on reading the database file: **

> sqlite3 <database.db> "SELECT * FROM TLLog" | sh script/convert_tllog.sh