Skip to content

Commit 1bc6f1f

Browse files
committed
feat: make axi4 config extend from inst config
1 parent 49afbf4 commit 1bc6f1f

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

rtl/tc_l2/src/main/scala/common/AXI4Config.scala

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ package treecorel2
22

33
import chisel3._
44
import chisel3.util._
5-
65
//AXI parameters
7-
trait AXI4Config {
6+
trait AXI4Config extends InstConfig {
87
val AxiReqLen = 2
98
val AxiReqRd = 0
109
val AxiReqWt = 1
1110
val AxiReqNop = 2
1211

13-
val AxiDataWidth = 64
14-
val AxiAddrWidth = 32 // FIME: is right? the original val is 64
15-
val AxiProtLen = 3
16-
val AxiIdLen = 4
17-
val AxiUserLen = 1
18-
val AxiSizeLen = 2
19-
val AxiBurstLen = 2
20-
val AxiCacheLen = 4
21-
val AxiQosLen = 4
22-
val AxiRegionLen = 4
23-
val AxiRespLen = 2
12+
val AxiDataWidth = 64
13+
val AxiInstDataWidth = if (SoCEna) 32 else 64
14+
val AxiAddrWidth = 32 // FIME: is right? the original val is 64
15+
val AxiProtLen = 3
16+
val AxiIdLen = 4
17+
val AxiUserLen = 1
18+
val AxiSizeLen = 2
19+
val AxiBurstLen = 2
20+
val AxiCacheLen = 4
21+
val AxiQosLen = 4
22+
val AxiRegionLen = 4
23+
val AxiRespLen = 2
2424
}

rtl/tc_l2/src/main/scala/core/TreeCoreL2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package treecorel2
33
import chisel3._
44
import difftest._
55

6-
class TreeCoreL2() extends Module with AXI4Config with InstConfig {
6+
class TreeCoreL2() extends Module with AXI4Config {
77
val io = IO(new Bundle {
88
val inst: AXI4USERIO = Flipped(new AXI4USERIO)
99
val mem: AXI4USERIO = Flipped(new AXI4USERIO)

rtl/tc_l2/src/main/scala/core/inst/PCReg.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package treecorel2
33
import chisel3._
44
import AXI4Bridge._
55

6-
class PCReg() extends Module with AXI4Config with InstConfig {
6+
class PCReg() extends Module with AXI4Config {
77
val io = IO(new Bundle {
88
val axi: AXI4USERIO = Flipped(new AXI4USERIO) // from axi
99
val ctrl2pc: CTRL2PCIO = Flipped(new CTRL2PCIO) // from ctrl

rtl/tc_l2/src/main/scala/core/ma/MemoryAccessStage.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import treecorel2.common.{getSignExtn, getZeroExtn}
88

99
// read data addr is calc by alu
1010
// write data addr is passed from id stage directly
11-
class MemoryAccessStage extends Module with AXI4Config with InstConfig {
11+
class MemoryAccessStage extends Module with AXI4Config {
1212
val io = IO(new Bundle {
1313
// wt mem ena signal is send from ex2ma stage
1414
// example: sd -> M[x[rs1]+ sext(offset)] = x[rs2][7:0]

rtl/tc_l2/src/main/scala/top/SimTop.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import chisel3._
44
import treecorel2._
55
import difftest._
66

7-
class SimTop() extends Module with AXI4Config with InstConfig {
7+
class SimTop() extends Module with AXI4Config {
88
val io = IO(new Bundle {
99
val logCtrl = new LogCtrlIO
1010
val perfInfo = new PerfInfoIO

rtl/tc_l2/src/main/scala/top/SoCTop.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import chisel3._
44
import treecorel2._
55
import difftest._
66

7-
class SoCTop() extends Module with AXI4Config with InstConfig {
7+
class SoCTop() extends Module with AXI4Config {
88
val io = IO(new Bundle {
99
val interrupt = Input(Bool())
1010
val master = new SOCAXI4IO

0 commit comments

Comments
 (0)