-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmp pins fix + chisel 3 update (#150)
* cmp pins fix + chisel 3 update * also update LedsCmp
- Loading branch information
Showing
26 changed files
with
152 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,33 @@ | ||
/* | ||
|
||
package cmp | ||
|
||
import Chisel._ | ||
import chisel3._ | ||
import io._ | ||
import ocp.OcpCoreSlavePort | ||
import patmos.Constants.{ADDR_WIDTH, DATA_WIDTH} | ||
|
||
|
||
MS: commented out for the moment until we find a good better solution for pins on CPM devices. | ||
class LedsCmp(nrCores: Int, nrLedPerCore: Int) extends Module { | ||
val io = new CmpIO(nrCores) with patmos.HasPins { | ||
class LedsCmp(nrCores: Int, nrLedPerCore: Int) extends CmpDevice(nrCores) { | ||
val io = IO(new CmpIO(nrCores) with patmos.HasPins { | ||
override val pins = new Bundle() { | ||
val led = Output(Bits(width = nrCores * nrLedPerCore)) | ||
val led = Output(UInt((nrCores * nrLedPerCore).W)) | ||
} | ||
} | ||
}) | ||
// commented out below as chisel3 do not support setWidth, trait are parameterless which means | ||
// there is no good way of setting with. All uses of this class has nrLedPerCore = 1 anyway | ||
//io.ledsCmpPins.led.setWidth(nrCores * nrLedPerCore) //modify number of ledPins dynamically | ||
|
||
io.pins.led := 0.U | ||
|
||
val ledDevs = Vec(nrCores, Module(new Leds(nrLedPerCore)).io) | ||
val ledDevs = Seq.fill(nrCores)(Module(new Leds(nrLedPerCore)).io) | ||
|
||
//Wire one led IO device per core, each with a number of led | ||
for (i <- 0 until nrCores) { | ||
ledDevs(i).ocp.M := io.cores(i).M | ||
io.cores(i).S := ledDevs(i).ocp.S | ||
io.pins.led(i) := ledDevs(i).pins.led(0) | ||
ledDevs(i).superMode := false.B | ||
} | ||
io.pins.led := ledDevs.map(_.pins.led).reduceLeft((l, h) => h ## l) | ||
|
||
} | ||
|
||
*/ |
Oops, something went wrong.