chipsalliance / chipsalliance/rocket-chip

HasAPBControlRegMap hangs processor

Open
#2,304 2 comments 0 reactions 0 assignees View on GitHub
bug build needs new testing
Dominant language
Scala
Stars
3.9k
Forks
1.3k
Avg merge
5d 13m
Merged PRs (30d)
1

Description

**Type of issue**: bug report

**Impact**: API modification

**Development Phase**: request

**Other information**

**If the current behavior is a bug, please provide the steps to reproduce the problem:**
- Create a class that extends RegisterRouter with HasAPBControlRegMap.
- In that class, create an AXI4 node and APB node (not sure if this is needed).
- Use the **regmap** function to assign a memory addressable register.
- Connect all three nodes to the memory bus with **mbus.toDRAMController**.
- The APB register is connected to the controlNode defined in the trait, like so:
```scala
ddr4.controlNode := mbus.toDRAMController(Some("ddr4_mem_ctl_apb")) {
TLToAPB() :=
TLDelayer(0.2) :=
TLBuffer(BufferParams.flow) :=
TLDelayer(0.2) :=
TLFragmenter(minSize = 8, maxSize = 64, holdFirstDeny = true)
```
- The processor hanging happens with just TLToAPB in the connection path, with just TLToAPB and the TLFragmenter in the connection path, and a few other combinations.

**What is the current behavior?**
- The code elaborates successfully but the processor hangs during simulation.
- With all other things being held constant, the simulation executes successfully when in the class definition, **HasAPBControlRegMap** is replaced with **HasAXI4ControlRegMap** and the register node connected to the controlXing defined in the trait, like so:
```scala
ddr4.controlXing(SynchronousCrossing()) :=
mbus.toDRAMController(Some("ddr4_mem_ctl_axi4")) {
AXI4UserYanker() :=
AXI4IdIndexer(0) :=
TLToAXI4() :=
TLFragmenter(minSize = 8, maxSize = 64, holdFirstDeny = true)
}
```
- When the processor hangs, it gets stuck on an infinite loop of this:
```bash
C0: 35017 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
C0: 35018 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
C0: 35019 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
C0: 35020 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
C0: 35021 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
C0: 35022 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
C0: 35023 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
C0: 35024 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
C0: 35025 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
C0: 35026 [x] pc=[00000045a2c41045] W[r 0=0000000000000000] R[r12=0000000000000000] R[r30=0000000000000000] inst=[00004231] DASM(00004231)
```

**What is the expected behavior?**
The processor should not hang.

**Please tell us about your environment:**

- Version: 4f0cdea8
- OS: Linux 2.6.32-754.11.1.el6.x86_64 #1 SMP Tue Jan 22 17:25:23 EST 2019 x86_64 x86_64 x86_64 GNU/Linux

**What is the use case for changing the behavior?**
To make it so a processor doesn't hang when using this utility. Additionally, helping me understand why this happens.

Contributor guide

Open the contributing guide

Research direction

Start with RegisterRouter, HasAPBControlRegMap, and the controlNode connection through TLToAPB, TLFragmenter, and mbus.toDRAMController. Reproduce the simulation hang using the reported APB path, then compare it with the working HasAXI4ControlRegMap and controlXing path. Done means the APB configuration no longer hangs and the relevant simulation completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.