chipsalliance / chipsalliance/rocket-chip

Fatal when run a case in VSIM

Open
#2,522 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build: emulator
Dominant language
Scala
Stars
3.9k
Forks
1.3k
Avg merge
5d 13m
Merged PRs (30d)
1

Description

Hi, I write a simple case test.S.After the compilation,I want to simulate it in VSIM. But it gave me a hint :

lh@ubuntu:~/rocket-chip/vsim$ make -f Liu\'s_Makefile sim_file=rv64test-p-test sim_vpd                                                                                                                                                                                             
./simv-freechips.rocketchip.system-DefaultConfig-debug \                                                                                                                                                                                                                           
+permissive -q +ntb_random_seed_automatic \                                                                                                                                                                                                                                        
+permissive-off +permissive +verbose \                                                                                                                                                                                                                                             
+vcdplusfile=./test/rv64test-p-test.vpd +max-cycles=1000000 +permissive-off \                                                                                                                                                                                                      
./rv64test-p-test 3>&1 1>&2 2>&3 | /home/lh/RV-installation/rocket-tool/bin/spike-dasm  > ./test/rv64test-p-test.out                                                                                                                                                               
                                                                                                                                                                                                                                                                                   
Note-[RT_BS] Larger stack needed                                                                                                                                                                                                                                                   
  Note: Bumping stack limit from 8192 to 8194 Kbytes.                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                   
NOTE: automatic random seed used: 1704709622                                                                                                                                                                                                                                       
VCD+ Writer L-2016.06_Full64 Copyright (c) 1991-2016 by Synopsys Inc.                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                   
Warning-[NVPD-ERR-LARGE-MEMORY-SIZE] VPD Maximum mem obj size exceeded.                                                                                                                                                                                                            
  Memory object "TestDriver.testHarness.mem.srams.mem.mem_ext.ram" exceeds VPD
  API maximum memory size of 2048 million bits. Value change recording will be
  disabled for this object.
  Change memory packed and/or unpacked dimension size of object to allow this
  object to be dumped.

Fatal: "/home/lh/rocket-chip/src/main/resources/vsrc/TestDriver.v", 147: TestDriver: at time 1000000500 ps
$finish called from file "/home/lh/rocket-chip/src/main/resources/vsrc/TestDriver.v", line 147.
$finish at simulation time            100000050

I find the cause is timeout in TestDriver.v

my case test.S is following:

       .section .text.init
        .align  6
        .weak stvec_handler
        .weak mtvec_handler
        .globl _start
_start: 
li a1, 0xAAAAAAAA
li a0, 0xAAAAAAAA
add a2, a1, a0
	j pass
pass:
	fence
	li gp, 1
	li a7, 93
	li a0, 0
	ecall
RVTEST_CODE_END
    .data
RVTEST_DATA_BEGIN
EXTRA_DATA


TEST_DATA

RVTEST_DATA_END

The last 5 are macros in riscv_test.h. And there is another macro called RVTEST_CODE_BEGIN, when I use it , it will succeed; but when it not be used ,the fatal will appear:
Fatal: "/home/lh/rocket-chip/src/main/resources/vsrc/TestDriver.v", 147: TestDriver: at time 1000000500 ps $finish called from file "/home/lh/rocket-chip/src/main/resources/vsrc/TestDriver.v", line 147. $finish at simulation time 100000050

So what should i do ?
My environment is Ubuntu18.04 ,

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading src/main/resources/vsrc/TestDriver.v around line 147 and compare the test with and without RVTEST_CODE_BEGIN in riscv_test.h. Reproduce the VSIM command using the supplied test.S and determine why the run reaches the timeout; done means explaining the difference and identifying the required test setup or a verified fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
ubuntu
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.