First draft of local FPGA support, targeting ARTY. Able to build verilog and bitfile for Rocket + Chipyard GCD example. To test, add GCD mixin to fpga/src/main/scala/arty/Config.scala, run make -f Makefile.e300artydevkit verilog and make -f Makefile.e300artydevkit mcs in fpga directory. Output will be in fpga/build.
This commit is contained in:
65
fpga/src/main/scala/arty/Config.scala
Normal file
65
fpga/src/main/scala/arty/Config.scala
Normal file
@@ -0,0 +1,65 @@
|
||||
// See LICENSE for license details.
|
||||
package sifive.freedom.everywhere.e300artydevkit
|
||||
|
||||
import freechips.rocketchip.config._
|
||||
import freechips.rocketchip.subsystem._
|
||||
import freechips.rocketchip.devices.debug._
|
||||
import freechips.rocketchip.devices.tilelink._
|
||||
import freechips.rocketchip.diplomacy.{DTSModel, DTSTimebase}
|
||||
import freechips.rocketchip.system._
|
||||
import freechips.rocketchip.tile._
|
||||
|
||||
import sifive.blocks.devices.mockaon._
|
||||
import sifive.blocks.devices.gpio._
|
||||
import sifive.blocks.devices.pwm._
|
||||
import sifive.blocks.devices.spi._
|
||||
import sifive.blocks.devices.uart._
|
||||
import sifive.blocks.devices.i2c._
|
||||
|
||||
// Default FreedomEConfig
|
||||
class DefaultFreedomEConfig extends Config (
|
||||
new WithNBreakpoints(2) ++
|
||||
new WithNExtTopInterrupts(0) ++
|
||||
new WithJtagDTM ++
|
||||
new TinyConfig
|
||||
)
|
||||
|
||||
// Freedom E300 Arty Dev Kit Peripherals
|
||||
class E300DevKitPeripherals extends Config((site, here, up) => {
|
||||
case PeripheryGPIOKey => List(
|
||||
GPIOParams(address = 0x10012000, width = 32, includeIOF = true))
|
||||
case PeripheryPWMKey => List(
|
||||
PWMParams(address = 0x10015000, cmpWidth = 8),
|
||||
PWMParams(address = 0x10025000, cmpWidth = 16),
|
||||
PWMParams(address = 0x10035000, cmpWidth = 16))
|
||||
case PeripherySPIKey => List(
|
||||
SPIParams(csWidth = 4, rAddress = 0x10024000, defaultSampleDel = 3),
|
||||
SPIParams(csWidth = 1, rAddress = 0x10034000, defaultSampleDel = 3))
|
||||
case PeripherySPIFlashKey => List(
|
||||
SPIFlashParams(
|
||||
fAddress = 0x20000000,
|
||||
rAddress = 0x10014000,
|
||||
defaultSampleDel = 3))
|
||||
case PeripheryUARTKey => List(
|
||||
UARTParams(address = 0x10013000),
|
||||
UARTParams(address = 0x10023000))
|
||||
case PeripheryI2CKey => List(
|
||||
I2CParams(address = 0x10016000))
|
||||
case PeripheryMockAONKey =>
|
||||
MockAONParams(address = 0x10000000)
|
||||
case PeripheryMaskROMKey => List(
|
||||
MaskROMParams(address = 0x10000, name = "BootROM"))
|
||||
})
|
||||
|
||||
// Freedom E300 Arty Dev Kit Peripherals
|
||||
class E300ArtyDevKitConfig extends Config(
|
||||
new E300DevKitPeripherals ++
|
||||
new DefaultFreedomEConfig().alter((site,here,up) => {
|
||||
case DTSTimebase => BigInt(32768)
|
||||
case JtagDTMKey => new JtagDTMConfig (
|
||||
idcodeVersion = 2,
|
||||
idcodePartNum = 0x000,
|
||||
idcodeManufId = 0x489,
|
||||
debugIdleCycles = 5)
|
||||
})
|
||||
)
|
||||
Reference in New Issue
Block a user