Skip to content

Commit

Permalink
todo: wrapper code in README
Browse files Browse the repository at this point in the history
  • Loading branch information
schoeberl committed Jun 6, 2024
1 parent 50203b1 commit 86e9586
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,29 @@ To analyze memory issues (e.g., increase the heap size with Xmx) use a ```.sbtop
* [ ] Get one-way memory back in here
* [ ] AXI wrapper

OCP Wrapper like this:

```scala
class S4nocOCPWrapper(nrCores: Int, txFifo: Int, rxFifo: Int) extends CmpDevice(nrCores) {

val s4noc = Module(new S4noc(nrCores, txFifo, rxFifo))

for (i <- 0 until nrCores) {

val resp = Mux(io.cores(i).M.Cmd === OcpCmd.RD || io.cores(i).M.Cmd === OcpCmd.WR,
OcpResp.DVA, OcpResp.NULL)

// addresses are in words
s4noc.io.cpuPorts(i).addr := io.cores(i).M.Addr >> 2
s4noc.io.cpuPorts(i).wrData := io.cores(i).M.Data
s4noc.io.cpuPorts(i).wr := io.cores(i).M.Cmd === OcpCmd.WR
s4noc.io.cpuPorts(i).rd := io.cores(i).M.Cmd === OcpCmd.RD
io.cores(i).S.Data := RegNext(s4noc.io.cpuPorts(i).rdData)
io.cores(i).S.Resp := Reg(init = OcpResp.NULL, next = resp)
}
}
```

### Next Paper

* Build a standard NoC router for best effort

0 comments on commit 86e9586

Please sign in to comment.